@import url("./measure-editor.css");
.score-delivery-notice { flex: none; max-height: 140px; overflow: auto; padding: 10px 16px; background: #f5ead1; color: #48391e; font-size: 13px; }
.score-delivery-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score-delivery-actions [role=status] { margin-right: auto; }
.score-delivery-notice p { margin: 0 0 6px; }
.score-delivery-notice button { min-height: 44px; border: 1px solid #b9975c; border-radius: 8px; padding: 6px 12px; background: transparent; color: inherit; }
:root {
  color-scheme: dark;
  --bg: #121416;
  --surface: #1c1f22;
  --surface-2: #25292d;
  --surface-3: #30353b;
  --paper: #f8f7f2;
  --text: #f2f1eb;
  --muted: #b5bbc1;
  --dim: #858d96;
  --line: #383d43;
  --accent: #d8b56a;
  --accent-strong: #e3c482;
  --accent-ink: #211b10;
  --accent-soft: #2d2922;
  --accent-line: #514737;
  --success: #8dc8b1;
  --info: #78aef2;
  --danger: #e99186;
  /* CSS owns safe-area spacing; keep Capacitor ios.contentInset set to never. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --control-height: 48px;
  --motion-enter: 220ms;
  --motion-exit: 165ms;
  --motion-feedback: 120ms;
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

body {
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* App gestures own long presses; text editing retains native selection and paste. */
input, textarea, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
img { -webkit-user-drag: none; }

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

a {
  color: var(--accent-strong);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0.001 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

#app,
.view {
  width: 100%;
  height: 100%;
}

.view {
  display: none;
  background: var(--bg);
}

.view.active {
  display: flex;
  animation: view-enter var(--motion-enter) var(--motion-ease) both;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-mark,
.option-icon,
.account-avatar,
.empty-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent-strong);
  background: #252116;
  border: 1px solid #443923;
}

.brand-mark {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid #43391f;
  border-radius: 8px;
  background: #15120d;
  box-shadow:
    0 8px 18px rgb(217 164 65 / 15%),
    inset 0 1px 0 rgb(255 240 200 / 7%);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark svg,
.icon-button svg,
.text-button svg,
.option-icon svg,
.player-version-button svg,
.resume-follow-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.login-view {
  flex-direction: column;
  overflow-y: auto;
  padding: calc(var(--safe-top) + 28px) 24px calc(var(--safe-bottom) + 20px);
  background: var(--bg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.brand-name {
  display: grid;
  gap: 1px;
}

.brand-name strong {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-name small {
  color: #77766f;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-main {
  width: min(100%, 440px);
  margin: auto;
  padding: 54px 0 32px;
}

.login-main h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.25;
}

.login-main h1::after {
  display: block;
  width: 54px;
  height: 3px;
  margin-top: 20px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}

.login-copy {
  margin: 16px 0 32px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

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

.login-form > label {
  margin-bottom: 8px;
}

.login-form > .field-row,
.login-form > input {
  margin-bottom: 16px;
}

.sheet-form {
  display: grid;
  gap: 11px;
}

label,
legend {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
}

textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(210 167 79 / 14%);
}

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

.phone-number-field {
  display: grid;
  height: var(--control-height);
  min-width: 0;
  grid-template-columns: 62px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.phone-number-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(210 167 79 / 14%);
}

.phone-number-field input {
  height: 100%;
  min-height: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.phone-country-code {
  display: flex;
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.phone-number-field input:focus {
  border-color: transparent;
  box-shadow: none;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: var(--control-height);
  border-radius: 6px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.danger-button {
  border: 1px solid rgb(225 121 111 / 45%);
  background: rgb(225 121 111 / 10%);
  color: var(--danger);
}

.auth-method-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-method-tabs button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-method-tabs button.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(215 170 78 / 28%);
}

.auth-method-tabs svg,
.auth-unavailable svg {
  width: 17px;
  height: 17px;
}

.auth-unavailable {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid rgb(239 129 116 / 32%);
  border-radius: 6px;
  background: rgb(239 129 116 / 8%);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-loading {
  display: grid;
  min-height: 54px;
  place-items: center;
}

.auth-loading .spinner {
  width: 20px;
  height: 20px;
}

.auth-unavailable svg {
  flex: 0 0 auto;
  color: var(--danger);
}

.auth-unavailable span {
  display: grid;
  gap: 4px;
}

.auth-unavailable b {
  font-weight: 600;
}

.auth-unavailable a {
  width: fit-content;
  font-weight: 700;
  text-decoration: none;
}

.legal-consent-control {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.legal-consent-control input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.legal-document {
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: var(--bg);
}

.legal-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: calc(var(--safe-top) + 24px) 0 calc(var(--safe-bottom) + 48px);
}

.legal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.legal-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.legal-back {
  display: inline-grid;
  min-width: 48px;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.legal-nav {
  display: flex;
  gap: 8px 18px;
  padding: 18px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.legal-nav a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.legal-warning {
  margin: 22px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--danger);
  background: rgb(239 129 116 / 8%);
  color: var(--muted);
  line-height: 1.6;
}

.legal-section {
  padding: 34px 0 10px;
  border-bottom: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.legal-section h3 {
  margin: 24px 0 8px;
  font-size: 16px;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.legal-section ul,
.legal-section ol {
  padding-left: 22px;
}

.legal-section strong {
  color: var(--text);
}

.legal-notice {
  margin: 12px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.legal-notice summary {
  cursor: pointer;
  overflow-wrap: anywhere;
}

.legal-notice pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.6 ui-monospace, monospace;
}

.home-view {
  position: relative;
  flex-direction: column;
  background: var(--bg);
}

.app-header,
.player-header {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: calc(var(--safe-top) + 68px);
  padding: calc(var(--safe-top) + 12px) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: rgb(18 20 22 / 94%);
  backdrop-filter: blur(18px);
}

.tempo-review {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fff4d6;
  color: #644516;
  font-size: 12px;
  line-height: 1.5;
}

#scoreUpdateStatusText { flex: 1; min-width: 0; }
.notice-dismiss {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -6px -8px -6px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}
.notice-dismiss:hover { background: rgb(100 69 22 / 8%); }
.notice-dismiss:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.regenerate-sync-notice { color: var(--muted); font-size: 13px; line-height: 1.5; }

.tempo-review-button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.app-header {
  min-height: calc(var(--safe-top) + 65px);
  padding-top: calc(var(--safe-top) + 10px);
  padding-bottom: 10px;
  justify-content: space-between;
}

.home-brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.home-logo-badge {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  overflow: hidden;
  place-items: center;
  flex: 0 0 44px;
  border: 1px solid #43391f;
  border-radius: 8px;
  background: #15120d;
  box-shadow:
    0 8px 18px rgb(217 164 65 / 14%),
    inset 0 1px 0 rgb(255 240 200 / 7%);
}

.home-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-brand-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.home-brand-copy strong {
  color: var(--text);
  font-size: 19px;
  font-weight: 850;
  line-height: 1.05;
}

.home-brand-copy small {
  display: flex;
  gap: 2px;
  color: #77766f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

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

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgb(28 31 34 / 92%);
  color: var(--text);
  transition: border-color var(--motion-feedback) ease, background-color var(--motion-feedback) ease, filter var(--motion-feedback) ease;
}


.icon-button.accent {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.icon-button.compact {
  width: 34px;
  height: 34px;
}

.icon-button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button.refreshing svg {
  animation: icon-spin 800ms linear infinite;
}

.subscription-entry {
  border-color: rgb(215 170 78 / 42%);
  background:
    linear-gradient(145deg, rgb(215 170 78 / 11%), transparent 58%),
    rgb(28 31 34 / 92%);
  box-shadow: 0 7px 20px rgb(215 170 78 / 12%);
}

.icon-button .subscription-stars {
  width: 22px;
  height: 22px;
}

.subscription-stars path {
  stroke: none;
}

.subscription-stars .star-primary {
  fill: var(--accent-strong);
}

.subscription-stars .star-coral {
  fill: #e78a5c;
}

.subscription-stars .star-blue {
  fill: #8fb6d6;
}

.home-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px calc(var(--safe-bottom) + 28px);
  overscroll-behavior-y: contain;
  transform: translate3d(0, var(--pull-offset, 0px), 0);
  transition: transform 220ms cubic-bezier(0.22, 0.78, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

.upload-card {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.upload-filename {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.upload-card p {
  margin: 10px 0;
}

.upload-detail {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.upload-error #uploadStatus {
  color: var(--danger);
}

.upload-card progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 14px 0;
  accent-color: var(--success);
}

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

.upload-actions button {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13px;
}

.home-view.is-pulling .home-content {
  transition: none;
}

.pull-refresh-indicator {
  position: absolute;
  z-index: 11;
  top: calc(var(--safe-top) + 65px);
  left: 50%;
  display: flex;
  min-width: 104px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgb(215 170 78 / 22%);
  border-radius: 17px;
  background: rgb(28 31 34 / 94%);
  box-shadow: 0 8px 20px rgb(0 0 0 / 24%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  opacity: clamp(0, calc(var(--pull-progress, 0) * 1.4), 1);
  pointer-events: none;
  transform:
    translate3d(
      -50%,
      calc(-42px + var(--pull-offset, 0px)),
      0
    );
  transition:
    color 160ms ease,
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.22, 0.78, 0.3, 1);
}

.pull-refresh-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: var(--accent-strong);
  transform: rotate(calc(var(--pull-progress, 0) * 180deg));
}

.pull-refresh-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.home-view.is-pull-armed .pull-refresh-indicator,
.home-view.is-refreshing .pull-refresh-indicator {
  color: var(--text);
}

.home-view.is-refreshing .pull-refresh-indicator,
.home-view.is-refresh-complete .pull-refresh-indicator,
.home-view.is-refresh-error .pull-refresh-indicator {
  opacity: 1;
}

.home-view.is-refreshing .pull-refresh-icon {
  animation: icon-spin 800ms linear infinite;
}

.home-view.is-refresh-complete .pull-refresh-icon {
  color: var(--success);
}

.home-view.is-refresh-error .pull-refresh-icon {
  color: var(--danger);
}

.section-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 10px;
  color: var(--dim);
  font-size: 12px;
}

.section-status > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.section-status h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
}

.text-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.text-button svg {
  width: 15px;
  height: 15px;
}

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

.song-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgb(215 170 78 / 5%), transparent 42%),
    var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 30px rgb(0 0 0 / 15%);
  animation: view-enter var(--motion-enter) var(--motion-ease) both;
  touch-action: pan-y;
  user-select: none;
  -webkit-touch-callout: none;
  transition: border-color var(--motion-feedback) ease, background-color var(--motion-feedback) ease, filter var(--motion-feedback) ease;
}

.song-item::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--success);
  content: "";
}

.song-item.processing::before {
  background: var(--info);
}

.song-item.failed::before {
  background: var(--danger);
}

.song-item:active {
  border-color: rgb(215 170 78 / 46%);
}

.song-icon {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(215 170 78 / 20%);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent-strong);
}

.song-icon svg {
  width: 20px;
  height: 20px;
}

.song-item.processing .song-icon > svg {
  color: var(--info);
  animation: icon-spin 1.4s linear infinite;
}

.song-item.failed .song-icon > svg {
  color: var(--danger);
}

.source-cue {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
}

.source-cue svg {
  width: 10px;
  height: 10px;
}

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

.song-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.song-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--dim);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgb(85 203 178 / 12%);
  color: var(--success);
  font-weight: 700;
}

.status-pill.failed {
  background: rgb(225 121 111 / 12%);
  color: var(--danger);
}

.status-pill.processing {
  background: rgb(120 174 242 / 13%);
  color: var(--info);
}

.song-progress {
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.song-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--info), var(--success));
  background-size: 180% 100%;
  animation: progress-flow 1.5s linear infinite;
}

.player-view {
  --player-bar-padding: 8px;
  --player-bar-height: 61px;
  --transport-height: calc(var(--player-bar-height) + 44px);
  flex-direction: column;
  background: var(--paper);
}

/* Keep the system status area once, even when the app title bar is collapsed. */
.player-view.is-fullscreen { padding-top: var(--safe-top); background: var(--bg); }

.player-header {
  min-height: calc(var(--safe-top) + var(--player-bar-height));
  padding: calc(var(--safe-top) + var(--player-bar-padding))
    max(12px, env(safe-area-inset-right))
    var(--player-bar-padding) max(12px, env(safe-area-inset-left));
  gap: 4px;
  box-shadow: 0 7px 22px rgb(0 0 0 / 14%);
}

.player-header > .icon-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}
.player-header svg { color: var(--text); stroke: currentColor; }

.player-title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  height: 44px;
  flex: 1;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.player-title-block > strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-version-button {
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  text-align: left;
}

.player-version-button:active {
  background: rgb(215 170 78 / 10%);
}

.player-version-button span {
  overflow: hidden;
  max-width: 84px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-version-button svg {
  flex: 0 0 auto;
}

.score-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 calc(var(--safe-bottom) + var(--transport-height) + 19px);
  background: var(--paper);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.score-canvas { position: relative; width: 100%; }

/* A score is a gesture surface; text fields in sheets remain selectable. */
.score-viewport,
.score-viewport * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.score-renderer {
  position: relative;
  width: 100%;
  min-height: 0;
  color: #151717;
  transform-origin: top left;
}

.score-renderer svg {
  display: block;
  max-width: 100%;
}

.score-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--paper);
  color: #555b59;
  font-size: 13px;
}

.measure-indicator-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.loop-indicator-layer {
  z-index: 5;
}

.score-current-measure {
  position: absolute;
  border: 2px solid rgb(210 167 79 / 72%);
  border-radius: 4px;
  background: rgb(210 167 79 / 12%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 44%);
}

.score-current-measure span {
  position: absolute;
  top: 2px;
  left: 3px;
  color: #6f531b;
  font-size: 9px;
  font-weight: 800;
}

.score-loop-measure {
  position: absolute;
  border: 1px solid rgb(210 167 79 / 76%);
  border-radius: 4px;
  background: rgb(210 167 79 / 8%);
}

.score-loop-measure span {
  position: absolute; top: 2px; right: 3px; padding: 0 2px;
  background: var(--paper); color: #765521; font-size: 11px; line-height: 14px; font-weight: 500;
}

.resume-follow-button {
  position: fixed;
  right: auto;
  bottom: calc(var(--safe-bottom) + var(--transport-height) + 11px);
  left: 50%;
  z-index: 10;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #4a3d23;
  border-radius: 999px;
  background: #242116;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 26px rgb(0 0 0 / 22%);
  transform: translateX(-50%);
}

.loop-status {
  position: relative;
  z-index: 11;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  min-height: 54px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 0 12px 4px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgb(215 170 78 / 35%);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(215 170 78 / 16%), rgb(215 170 78 / 6%)),
    var(--surface);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgb(240 192 99 / 6%);
}

.loop-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 0 rgb(240 192 99 / 60%);
  animation: loop-status-pulse 1.5s ease-out infinite;
}

.loop-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

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

.loop-copy strong {
  font-size: 12px;
  font-weight: 750;
}

.loop-copy small {
  color: var(--muted);
  font-size: 10px;
}

.loop-exit-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgb(215 170 78 / 42%);
  border-radius: 999px;
  background: rgb(215 170 78 / 13%);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.transport-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 11;
  padding: var(--player-bar-padding) max(12px, env(safe-area-inset-right)) calc(var(--player-bar-padding) + var(--safe-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid transparent;
  background: transparent;
  color: #f4f5f7;
  transition: opacity var(--motion-enter) var(--motion-ease), transform var(--motion-enter) var(--motion-ease), display var(--motion-enter) allow-discrete;
}

/* One continuous scrim avoids a seam above the controls; it never captures score gestures. */
.transport-bar::before {
  content: "";
  position: absolute;
  inset: -20px 0 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgb(0 0 0 / 0%) 0,
    rgb(0 0 0 / 4%) 8px,
    rgb(0 0 0 / 20%) 18px,
    rgb(0 0 0 / 44%) 30px,
    rgb(0 0 0 / 62%) 42px,
    rgb(0 0 0 / 68%) 100%);
  pointer-events: none;
}
.transport-bar[hidden] { opacity: 0; transform: translateY(6px); transition-duration: var(--motion-exit); pointer-events: none; }
@starting-style { .transport-bar { opacity: 0; transform: translateY(6px); } }
.transport-inner { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 0 8px; }
.transport-primary { grid-area: 1 / 1; }
.transport-aux { grid-area: 2 / 1 / 3 / -1; }
.transport-fullscreen {
  grid-area: 1 / 2; display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 6px; background: transparent; color: #c5cad0;
}
.transport-fullscreen svg { width: 20px; height: 20px; stroke-width: 1.8; }
.transport-fullscreen:active { background: rgb(255 255 255 / 10%); }
.transport-primary { display: flex; align-items: center; gap: 8px; min-width: 0; }
.transport-aux { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; min-width: 0; }
.transport-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 6px 12px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
  background: rgb(23 26 30 / 96%);
  color: #d5d9de;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.seek-row { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; }
.transport-time { flex: none; color: #f0f1f3; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#currentTime { color: #f4f5f7; }
.seek-control {
  flex: 1;
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 44px;
  align-items: center;
}

.seek-buffered-ranges {
  position: absolute;
  top: 50%;
  right: 6px;
  left: 6px;
  height: 4px;
  transform: translateY(-50%);
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 20%);
  pointer-events: none;
}

.seek-buffered-ranges span {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
  border-radius: 999px;
  background: rgb(255 255 255 / 38%);
}

input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--accent);
  background: transparent;
  box-shadow: none;
}

#seekInput {
  --played-progress: 0%;
  border: 0;
  border-radius: 0;

  min-height: 44px;
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

#seekInput::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #dfbb79 0 var(--played-progress),
    transparent var(--played-progress) 100%
  );
}

#seekInput::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #f4f5f7;
  box-shadow: none;
}

#seekInput::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

#seekInput::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: #dfbb79;
}

#seekInput::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #f4f5f7;
  box-shadow: none;
}

.transport-play-row { display: flex; flex: 0 0 44px; align-items: center; justify-content: center; }
.transport-mode-row, .transport-speed-row, .transport-delay-row { position: relative; min-width: 0; }
.play-button {
  position: relative; display: grid; width: 44px; height: 44px; padding: 0; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #f4f5f7;
}
.play-button svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.play-button .lucide-play { transform: translateX(1px); }
.play-button.playback-counting svg { width: 24px; height: 24px; fill: none; stroke: currentColor; }
.play-button.playback-loading svg, .play-button.audio-loading svg { visibility: hidden; }
.play-button.playback-loading::after, .play-button.audio-loading::after {
  position: absolute; width: 18px; height: 18px; border: 2px solid rgb(255 255 255 / 20%); border-top-color: currentColor;
  border-radius: 50%; animation: icon-spin .8s linear infinite; content: "";
}
.transport-menu-trigger {
  display: flex; width: 100%; height: 44px; min-width: 0; align-items: center; justify-content: center;
  gap: 4px; padding: 0 2px; border: 0; border-radius: 6px; background: transparent; color: #f4f5f7;
  font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.transport-menu-trigger > span { overflow: hidden; text-overflow: ellipsis; }
.transport-menu-trigger svg { width: 16px; height: 16px; flex: none; color: #c5cad0; pointer-events: none; }
.transport-menu-trigger[aria-expanded="true"] { color: #f5d99e; }
.transport-menu-trigger[aria-expanded="true"] > svg { color: inherit; }
.transport-measure-row { display: flex; min-width: 0; align-items: center; justify-content: center; }
.transport-loop-exit { display: flex; align-items: center; justify-content: flex-start; width: 44px; height: 44px; flex: 0 0 44px; border: 0; padding: 0 0 0 4px; border-radius: 6px; background: transparent; color: #f5d99e; }
.transport-loop-exit svg { width: 16px; height: 16px; }
.transport-aux.has-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.player-view:has(.transport-aux.has-loop) { --transport-height: calc(var(--player-bar-height) + 88px); }
.transport-measure-row.is-loop .transport-menu-trigger { flex: none; width: auto; padding: 0 2px 0 4px; }
.transport-measure-row.is-loop .transport-menu-trigger > span { overflow: visible; }
.transport-measure-row.is-loop .transport-menu-trigger,
.transport-measure-row.is-loop .transport-menu-trigger svg { color: #f5d99e; }
.transport-menu-options {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 2;
  display: grid;
  width: 132px;
  max-height: calc(100dvh - 155px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgb(0 0 0 / 40%);
}

.transport-menu-options button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.accompaniment-label,
.audio-mode-options strong.accompaniment-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.accompaniment-label .subscription-stars {
  width: 19px;
  height: 19px;
  flex: none;
}

.transport-speed-row .transport-menu-options { left: 50%; transform: translateX(-50%); }
.transport-delay-row .transport-menu-options { left: auto; right: 0; width: 228px; max-width: calc(100vw - 24px); }
.transport-menu-trigger.is-enabled, .transport-menu-trigger.is-enabled svg { color: #f5d99e; }
.playback-delay-options { background: rgb(23 26 30 / 96%); border-color: rgb(255 255 255 / 14%); box-shadow: 0 8px 28px rgb(0 0 0 / 15%); }
.playback-delay-options button { color: #f4f5f7; font-weight: 400; }
.transport-delay-row .playback-delay-options button.active { background: rgb(223 187 121 / 18%); color: #f1d097; }

.transport-menu-options button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.transport-bar button:focus-visible,
#seekInput:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

@media (hover: hover) {
  .transport-menu-options button:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }
  .transport-delay-row .playback-delay-options button:hover { background: rgb(223 187 121 / 18%); color: #f1d097; }
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgb(0 0 0 / 56%);
  backdrop-filter: blur(2px);
}

.bottom-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 31;
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 8px 16px calc(var(--safe-bottom) + 20px);
  border-top: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: 0 -20px 50px rgb(0 0 0 / 38%);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 2px auto 12px;
  border-radius: 4px;
  background: var(--dim);
}

.sheet-heading {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sheet-heading h2 {
  margin: 0;
  font-size: 20px;
}

.sheet-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.danger-copy {
  color: var(--danger);
}

.delete-song-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(239 129 116 / 32%);
  border-radius: 50%;
  background: rgb(239 129 116 / 10%);
  color: var(--danger);
}

.delete-song-icon svg {
  width: 20px;
  height: 20px;
}

.delete-account-warning {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px 2px 18px;
}

.delete-account-warning p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.deletion-identity-options {
  display: grid;
  gap: 8px;
}

.deletion-identity-option {
  display: grid;
  min-height: 58px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.deletion-identity-option .option-icon {
  width: 36px;
  height: 36px;
}

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

.deletion-identity-option strong {
  font-size: 13px;
}

.deletion-identity-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.deletion-identity-option.selected {
  border-color: var(--accent);
  background: rgb(215 170 78 / 8%);
  box-shadow: inset 0 0 0 1px rgb(215 170 78 / 18%);
}

.deletion-identity-option:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.deletion-identity-mark {
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
}

.deletion-identity-option.selected .deletion-identity-mark {
  color: var(--accent-strong);
}

#deleteAccountForm .confirmation-actions {
  margin-top: 9px;
}

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

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 31;
  width: min(calc(100% - 32px), 380px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgb(0 0 0 / 48%);
  transform: translate(-50%, -50%);
}

.legal-update-dialog {
  position: fixed;
  top: calc(var(--legal-viewport-top, 0px) + var(--legal-viewport-height, 100dvh) / 2);
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 380px);
  max-height: calc(100vh - 48px);
  max-height: calc(var(--legal-viewport-height, 100dvh) - 32px);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 22px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 64px rgb(0 0 0 / 48%);
}
.legal-update-dialog:not([open]) { display: none; }
.legal-update-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / 56%); }
.legal-update-dialog[data-fallback] { z-index: 1001; }
.legal-update-dialog::backdrop { background: rgb(0 0 0 / 56%); }
.legal-update-dialog .legal-consent-confirmation h2 { font-size: 17px; line-height: 1.5; }
.legal-update-dialog .legal-consent-confirmation p { font-size: 14px; }
.legal-update-dialog .legal-consent-confirmation { min-height: 0; overflow-y: auto; overflow-wrap: anywhere; }
.legal-update-dialog .confirmation-actions { flex: none; }
.legal-update-dialog .confirmation-actions button { min-height: 44px; font-size: 14px; }
.legal-update-dialog #legalUpdateError { color: var(--danger); }

.legal-consent-confirmation {
  display: grid;
  gap: 10px;
  padding-bottom: 22px;
}

.playback-delay-dialog {
  width: min(228px, calc(100vw - 32px)); padding: 24px 20px 16px;
  border-color: #dadbd5; background: #faf9f5; color: #2d302b; text-align: center;
}
.playback-delay-dialog h2 { margin: 0; font-size: 15px; font-weight: 500; }
.playback-delay-dialog .playback-delay-remaining { margin: 10px 0 0; font-size: 52px; line-height: 1.25; font-weight: 600; font-variant-numeric: tabular-nums; }
#playbackDelayCaption { margin: 4px 0 16px; color: #666b61; font-size: 12px; }
#cancelPlaybackDelayButton { width: 100%; min-height: 44px; border: 1px solid #dadbd5; border-radius: 8px; background: transparent; color: #52594f; font-size: 14px; }
.sheet-backdrop[data-sheet="playbackDelaySheet"] { background: rgb(0 0 0 / 28%); backdrop-filter: none; }

.legal-consent-confirmation h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.legal-consent-confirmation p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.legal-consent-confirmation a {
  font-weight: 700;
  text-decoration: none;
}

.option-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.option-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
}

.option-row > span:nth-child(2) {
  min-width: 0;
}

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

.option-row strong {
  font-size: 14px;
}

.option-row small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.option-row > svg {
  width: 18px;
  height: 18px;
  color: var(--dim);
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 16px;
}

.media-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.media-preview strong,
.media-preview small {
  display: block;
}

.media-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview small {
  margin-top: 4px;
  color: var(--muted);
}

.account-avatar {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

.account-summary strong,
.account-summary small {
  display: block;
}

.account-summary small {
  margin-top: 4px;
  color: var(--muted);
}

.account-section {
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 1.5%);
}

.account-section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-section .option-row {
  margin-top: 7px;
}

.compact-row {
  min-height: 60px;
}

.row-action {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.option-row:disabled .row-action {
  color: var(--dim);
}

.account-section-hint {
  display: block;
  margin: 9px 2px 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.55;
}

.preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.preference-row:nth-of-type(2) {
  border-bottom: 0;
}

.preference-row strong,
.preference-row small {
  display: block;
}

.preference-row strong {
  color: var(--text);
  font-size: 13px;
}

.preference-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.preference-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--accent-strong);
}

#identitySheetCopy {
  margin: -4px 0 16px;
}

/* Subscription shares the home palette; surface luminance distinguishes groups. */
#subscriptionSheet { --billing-ink:var(--text); --billing-muted:var(--muted); --billing-line:var(--line); --billing-surface:var(--surface); --billing-gold:var(--accent); --billing-blue:#a1b9cd; --billing-feature:var(--billing-blue); color-scheme:dark; background:var(--bg); color:var(--billing-ink); left:0; right:0; margin-inline:auto; padding:12px 18px max(18px,env(safe-area-inset-bottom)); border:1px solid var(--billing-line); border-radius:22px 22px 0 0; max-height:calc(100dvh - var(--safe-top) - 20px); }
#subscriptionSheet .sheet-heading { margin:0 0 16px; min-height:44px; }
#subscriptionSheet h2 { font-size:18px; color:var(--billing-ink); }
#subscriptionSheet .sheet-handle { background:var(--dim); }
#subscriptionSheet .icon-button { color:var(--billing-ink); background:transparent; border:0; }
#subscriptionSheet svg { flex-shrink:0; width:18px; height:18px; }
#subscriptionSheet button { touch-action:manipulation; }
#subscriptionSheet button:disabled { opacity:.5; }
#subscriptionSheet .billing-header-actions { display:flex; align-items:center; gap:10px; }
#subscriptionSheet .billing-text-button { display:inline-flex; align-items:center; justify-content:center; gap:4px; min-height:44px; padding:8px 0; background:transparent; border:0; color:var(--billing-muted); font-size:12px; white-space:nowrap; }
#subscriptionSheet .billing-text-button svg { width:14px; height:14px; }
#subscriptionSheet .billing-intro { margin:0 0 18px; }
#subscriptionSheet .billing-intro .billing-kicker { display:flex; align-items:center; gap:6px; color:var(--billing-gold); font-size:12px; }
#subscriptionSheet .billing-intro h3 { margin:8px 0; font-size:24px; line-height:1.35; font-weight:600; letter-spacing:-.5px; text-wrap:balance; }
#subscriptionSheet .billing-intro p { margin:0; color:var(--billing-muted); font-size:12px; line-height:1.8; }
#subscriptionSheet .billing-content { display:grid; gap:14px; }
#subscriptionSheet .billing-overview, #subscriptionSheet .billing-actions { min-width:0; }
#subscriptionSheet .billing-member-card { background:linear-gradient(115deg,#302b24,#242529); color:var(--accent-strong); border:1px solid var(--accent-line); border-radius:18px; padding:18px 20px; margin-bottom:14px; }
#subscriptionSheet .billing-member-heading, #subscriptionSheet .billing-member-heading strong, #subscriptionSheet .billing-member-heading>span { display:flex; align-items:center; gap:6px; }
#subscriptionSheet .billing-member-heading { justify-content:space-between; }
#subscriptionSheet .billing-member-heading strong { font-size:16px; font-weight:600; }
#subscriptionSheet .billing-member-heading>span { font-size:11px; white-space:nowrap; }
#subscriptionSheet .billing-member-heading>span svg { width:13px; height:13px; }
#subscriptionSheet .billing-member-bottom { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; }
#subscriptionSheet #billingMemberExpiry { font-size:12px; margin:0; }
#subscriptionSheet .billing-manage-button { display:inline-flex; align-items:center; gap:4px; border:0; background:transparent; padding:8px 0; min-height:44px; color:var(--billing-gold); font-size:12px; white-space:nowrap; }
#subscriptionSheet .billing-manage-button svg { width:14px; height:14px; }
#subscriptionSheet .billing-quota-card { position:relative; padding:20px; background:var(--billing-surface); border:1px solid var(--billing-line); border-radius:18px; }
#subscriptionSheet .billing-quota-label { display:flex; align-items:center; gap:6px; min-height:26px; font-size:13px; color:var(--billing-muted); }
#subscriptionSheet #billingBalance { display:block; margin:5px 0 7px; font-size:32px; font-weight:600; letter-spacing:-1px; font-variant-numeric:tabular-nums; }
#subscriptionSheet[data-membership="active"] .billing-balance-prefix { display:none; }
#subscriptionSheet[data-membership="active"] .billing-balance-value { font-size:44px; line-height:1.15; }
#subscriptionSheet[data-membership="active"] .billing-balance-unit { font-size:13px; font-weight:400; color:var(--billing-muted); letter-spacing:0; }
#subscriptionSheet #billingSources { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:12px; color:var(--billing-muted); font-variant-numeric:tabular-nums; }
#subscriptionSheet #billingSources:empty { display:none; }
#subscriptionSheet #billingSources strong { color:var(--billing-ink); font-weight:500; }
#subscriptionSheet:not([data-membership="active"]):not([data-membership="loading"]) .billing-quota-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 8px; align-items:center; padding:14px 18px; }
#subscriptionSheet:not([data-membership="active"]) .billing-quota-label { grid-column:1; }
#subscriptionSheet:not([data-membership="active"]) #billingBalance { grid-column:1; font-size:16px; font-weight:500; margin:0; letter-spacing:0; }
#subscriptionSheet[data-credit-source="single"] .billing-quota-label { color:var(--billing-blue); }
#subscriptionSheet[data-credit-source="welcome"] .billing-quota-label { color:var(--billing-gold); }
#subscriptionSheet[data-membership="loading"] #billingBalance { font-size:16px; margin-top:8px; }
#subscriptionSheet .billing-metrics { display:grid; gap:8px; margin:12px 0; }
#subscriptionSheet .billing-metric { display:flex; justify-content:space-between; align-items:center; gap:10px; }
#subscriptionSheet .billing-metric span { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--billing-muted); }
#subscriptionSheet .billing-metric svg { width:14px; height:14px; }
#subscriptionSheet .billing-metric strong { font-size:13px; font-weight:500; font-variant-numeric:tabular-nums; }
#subscriptionSheet #billingReserved { color:var(--billing-muted); font-size:11px; line-height:1.6; margin:10px 0 0; grid-column:1/-1; }
#subscriptionSheet #billingQuotaDetails { grid-column:1/-1; }
#subscriptionSheet[data-membership="active"] #billingQuotaDetails>summary { position:absolute; top:10px; right:20px; gap:4px; }
#subscriptionSheet[data-membership="active"] #billingQuotaDetails[open] { margin-top:14px; padding-top:4px; border-top:1px solid var(--billing-line); }
#subscriptionSheet summary { display:flex; align-items:center; justify-content:space-between; list-style:none; min-height:44px; color:var(--billing-muted); font-size:12px; cursor:pointer; }
#subscriptionSheet summary::-webkit-details-marker { display:none; }
#subscriptionSheet summary svg { width:14px; height:14px; transition:transform var(--motion-feedback) ease; }
#subscriptionSheet details[open]>summary svg { transform:rotate(180deg); }
#subscriptionSheet #billingPeriod p, #subscriptionSheet #billingQuotaDetails>p { color:var(--billing-muted); font-size:12px; line-height:1.65; margin:5px 0; overflow-wrap:anywhere; }
#subscriptionSheet .billing-status-note { color:var(--billing-gold); background:var(--accent-soft); padding:11px 13px; font-size:12px; line-height:1.6; border-radius:12px; margin:13px 0 0; }
#subscriptionSheet .billing-access { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px 12px; border:1px solid var(--billing-line); border-radius:18px; background:var(--billing-surface); padding:18px; }
#subscriptionSheet .billing-access-heading { display:flex; align-items:center; gap:7px; grid-column:1/-1; color:var(--billing-feature); }
#subscriptionSheet .billing-access strong { font-size:15px; font-weight:600; }
#subscriptionSheet .billing-access p { font-size:12px; line-height:1.6; margin:0; color:var(--billing-muted); }
#subscriptionSheet #billingPracticeButton { color:var(--billing-feature); background:var(--surface-2); border-radius:10px; padding:8px 11px; }
#subscriptionSheet .billing-use-button, #subscriptionSheet .billing-buy-button { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; min-height:48px; padding:10px 12px; border:0; border-radius:11px; color:var(--accent-ink); background:var(--accent); font-size:14px; font-weight:600; }
#subscriptionSheet .billing-use-button { margin:18px 0 0; }
#subscriptionSheet:not([data-membership="active"]) .billing-use-button { grid-column:2; grid-row:1/3; width:auto; color:var(--billing-gold); background:transparent; font-size:13px; font-weight:500; min-height:44px; padding:0; margin:0; }
#subscriptionSheet .billing-products { display:grid; gap:12px; }
#subscriptionSheet .billing-product { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:9px 10px; width:100%; text-align:left; border:1px solid var(--billing-line); border-radius:16px; padding:15px 17px; background:var(--billing-surface); color:var(--billing-ink); }
#subscriptionSheet .billing-product[aria-pressed="true"] { border-color:var(--billing-gold); background:var(--accent-soft); }
#subscriptionSheet .billing-product-heading { display:flex; align-items:center; gap:7px; font-size:14px; }
#subscriptionSheet .billing-product-heading strong { font-weight:600; }
#subscriptionSheet .billing-product-monthly .billing-product-heading>svg { color:var(--billing-gold); }
#subscriptionSheet .billing-product-single .billing-product-heading>svg { color:var(--billing-blue); }
#subscriptionSheet .billing-choice-dot { flex:0 0 15px; width:15px; height:15px; border:1px solid var(--dim); border-radius:50%; background:transparent; }
#subscriptionSheet .billing-product[aria-pressed="true"] .billing-choice-dot { border:5px solid var(--billing-gold); }
#subscriptionSheet .billing-product-price { display:block; font-size:22px; font-weight:600; line-height:1.2; letter-spacing:-.6px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; text-align:right; }
#subscriptionSheet .billing-product-price>span { font-size:12px; color:var(--billing-muted); font-weight:400; letter-spacing:0; white-space:nowrap; }
#subscriptionSheet .billing-product-detail, #subscriptionSheet .billing-product-benefit { grid-column:1/-1; margin-left:22px; font-size:13px; font-weight:400; line-height:1.5; }
#subscriptionSheet .billing-product-benefit { margin-top:-5px; color:var(--billing-muted); font-size:12px; }
#subscriptionSheet .billing-preview-label { grid-column:1/-1; color:var(--billing-muted); font-size:12px; }
#subscriptionSheet #billingCheckout { margin-top:16px; }
#subscriptionSheet #billingCheckoutNote, #subscriptionSheet .billing-checkout-note { font-size:11px; line-height:1.7; text-align:center; color:var(--billing-muted); margin:9px 0 0; }
#subscriptionSheet #billingPreviewCheckout { margin-top:16px; }
#subscriptionSheet .billing-topup { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:14px 0 0; }
#subscriptionSheet .billing-topup strong { font-size:13px; font-weight:500; }
#subscriptionSheet .billing-topup p { margin:4px 0 0; font-size:12px; color:var(--billing-muted); }
#subscriptionSheet .billing-topup-button { background:transparent; color:var(--billing-blue); border:0; padding:8px 0 8px 8px; min-height:44px; font-size:13px; white-space:nowrap; }
#subscriptionSheet #billingMessage { color:var(--billing-muted); font-size:13px; line-height:1.6; margin:12px 0 0; overflow-wrap:anywhere; }
#subscriptionSheet #billingMessage:empty { display:none; }
#subscriptionSheet #billingAccount { margin:22px 0 4px; text-align:center; color:var(--billing-muted); font-size:11px; overflow-wrap:anywhere; }
#subscriptionSheet .billing-policy { border-top:1px solid var(--billing-line); margin-top:17px; }
#subscriptionSheet .billing-terms { color:var(--billing-muted); font-size:12px; line-height:1.7; }
#subscriptionSheet .billing-terms p { margin:0 0 10px; }
#subscriptionSheet .billing-footer { display:flex; gap:20px; justify-content:center; padding-top:4px; }
#subscriptionSheet .billing-footer a { display:flex; align-items:center; min-height:44px; color:var(--billing-muted); font-size:12px; text-decoration:none; }
#subscriptionSheet #testflightBillingStatus { display:flex; align-items:center; gap:10px; padding:14px 16px; background:var(--billing-surface); border:1px solid var(--billing-line); border-radius:16px; margin:0; }
#subscriptionSheet #testflightBillingStatus strong, #subscriptionSheet #testflightBillingStatus small { display:block; font-size:13px; }
#subscriptionSheet #testflightBillingStatus small { color:var(--billing-muted); margin-top:5px; font-size:12px; line-height:1.5; }
#subscriptionSheet #billingIntentNotice { color:var(--billing-muted); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
#purchaseIntentLoginHint { margin-bottom:8px; color:var(--muted); font-size:12px; }
#subscriptionSheet [hidden] { display:none!important; }
@media (min-width:700px) {
#subscriptionSheet { width:min(720px,calc(100% - 48px)); max-width:720px; padding:12px 24px 16px; top:50%; bottom:auto; transform:translateY(-50%); border-radius:22px; max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 48px); }
#subscriptionSheet .billing-content { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
#subscriptionSheet .billing-intro { margin:6px 0 24px; }
#subscriptionSheet .billing-intro h3 { font-size:26px; line-height:1.45; margin:13px 0 10px; }
#subscriptionSheet .billing-intro p { font-size:13px; }
#subscriptionSheet .billing-product { padding:17px 18px; }
#subscriptionSheet .billing-access { grid-template-columns:minmax(0,1fr); gap:11px; padding:20px; }
#subscriptionSheet .billing-access-heading { grid-column:1; }
#subscriptionSheet #billingPracticeButton { margin-top:4px; width:100%; }
}
@media (max-width:699px) {
#subscriptionSheet .billing-intro h3 br { display:none; }
}
@media (max-width:359px) {
#subscriptionSheet { padding-left:16px; padding-right:16px; }
#subscriptionSheet .billing-member-card,#subscriptionSheet .billing-quota-card { padding:16px; }
#subscriptionSheet .billing-member-heading strong { font-size:15px; }
#subscriptionSheet .billing-member-bottom { gap:4px; }
#subscriptionSheet #billingMemberExpiry { font-size:11px; }
#subscriptionSheet .billing-intro h3 { font-size:23px; }
#subscriptionSheet .billing-access { grid-template-columns:minmax(0,1fr); }
#subscriptionSheet .billing-access-heading { grid-column:1; }
#subscriptionSheet .billing-product { padding:15px; gap:9px 7px; }
#subscriptionSheet .billing-product-price { font-size:21px; }
}

/* Renewal notices share the same surfaces on home and subscription pages. */
.renewal-reminders .billing-product { display:grid; gap:20px; padding:22px; border:1px solid var(--line); border-radius:16px; background:var(--surface); color:var(--text); }
#billingContent > .renewal-reminders { grid-column:1 / -1; }
#subscriptionSheet .renewal-reminders .billing-product { grid-template-columns:minmax(0,1fr); gap:16px; background:var(--billing-surface); color:var(--billing-ink); border-color:var(--billing-line); }
#subscriptionSheet .renewal-reminders .account-section-hint { color:var(--billing-muted); }
#subscriptionSheet .renewal-reminders .secondary-button { background:transparent; color:var(--billing-ink); border-color:var(--billing-line); }

.full-width {
  width: 100%;
  margin-top: 10px;
}

/* Version picker styling stays inside its own sheet. */
#versionsSheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  padding: 0 20px calc(var(--safe-bottom) + 20px);
  border: 0;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}
#versionsSheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; }
#versionsSheet .sheet-heading { flex: none; min-height: 58px; margin: 0 -8px 0 0; }
#versionsSheet .sheet-heading h2 { font-size: 17px; line-height: 24px; font-weight: 500; }
#versionsSheet .icon-button { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
#versionsSheet .icon-button svg { width: 18px; height: 18px; stroke-width: 1.7; }
#versionsSheet .versions-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#versionsSheet .version-list { display: grid; gap: 0; overflow: clip; border-radius: 12px; background: var(--surface-2); }
#versionsSheet .version-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; min-height: 72px; padding: 0 4px 0 0; border: 0; background: transparent; }
#versionsSheet .version-row + .version-row::before { content: ""; position: absolute; top: 0; right: 14px; left: 14px; height: 1px; background: var(--line); }
#versionsSheet .version-select { display: flex; flex-direction: column; justify-content: center; align-self: stretch; gap: 5px; min-width: 0; min-height: 72px; padding: 12px 14px; border: 0; background: transparent; text-align: left; }
#versionsSheet .version-heading { align-items: center; gap: 4px 10px; }
#versionsSheet .version-select strong { font-size: 14px; font-weight: 500; line-height: 21px; overflow-wrap: anywhere; }
#versionsSheet .version-select small { display: block; margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 19px; overflow-wrap: anywhere; }
#versionsSheet .version-current-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; line-height: 18px; }
#versionsSheet .version-current-badge svg { width: 13px; height: 13px; stroke-width: 2; }
#versionsSheet button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -3px; }
#versionsSheet .version-select:not(:disabled):active,
#versionsSheet .icon-button:not(:disabled):active { background: var(--surface-3); }
@media (min-width: 700px) {
  #versionsSheet { top: 50%; bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px); padding-bottom: 20px; border-radius: 18px; }
  #versionsSheet .sheet-handle { display: none; }
}
@media (max-width: 359px) {
  #versionsSheet { padding-inline: 16px; }
}

#sourceAlignmentControls {
  margin-top: 12px;
}

.sheet-form fieldset {
  min-width: 0;
  margin: 2px 0 10px;
  padding: 0;
  border: 0;
}

.sheet-form legend {
  margin-bottom: 9px;
}

.choice-grid,
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

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

.choice-grid input,
.check-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-grid span,
.check-grid span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.choice-grid input:checked + span,
.check-grid input:checked + span {
  border-color: #705b31;
  background: #302919;
  color: var(--accent-strong);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: rgb(18 20 22 / 86%);
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgb(210 167 79 / 24%);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: icon-spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  top: calc(var(--safe-top) + 76px);
  left: 50%;
  z-index: 70;
  width: max-content;
  max-width: min(calc(100% - 32px), 440px);
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(37 41 45 / 96%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 12px 30px rgb(0 0 0 / 28%);
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

@keyframes icon-spin {
  to { transform: rotate(360deg); }
}

@keyframes view-enter {
  from { opacity: .92; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loop-status-pulse {
  0% { box-shadow: 0 0 0 0 rgb(240 192 99 / 58%); }
  72% { box-shadow: 0 0 0 8px rgb(240 192 99 / 0%); }
  100% { box-shadow: 0 0 0 0 rgb(240 192 99 / 0%); }
}

@keyframes loop-measure-beat {
  0%,
  100% {
    border-color: rgb(210 167 79 / 48%);
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 30%),
      0 0 8px rgb(210 167 79 / 10%);
  }
  45% {
    border-color: rgb(210 167 79 / 92%);
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 52%),
      0 0 20px rgb(210 167 79 / 34%);
  }
}

@keyframes progress-flow {
  to { background-position: -180% 0; }
}

@media (min-width: 720px) {
  .home-content,
  .app-header {
    padding-right: max(24px, calc((100vw - 820px) / 2));
    padding-left: max(24px, calc((100vw - 820px) / 2));
  }

  .bottom-sheet {
    right: max(0px, calc((100vw - 620px) / 2));
    left: max(0px, calc((100vw - 620px) / 2));
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 350px) {
  .home-logo-badge {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .home-brand-copy strong {
    font-size: 17px;
  }

  .home-brand-copy small {
    gap: 1.5px;
    font-size: 8px;
  }


}

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

.renewal-reminders { display: grid; gap: 12px; }
.home-content > .renewal-reminders { margin-bottom: 16px; }
.renewal-reminders .account-section-hint { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; }
.renewal-reminders a.secondary-button { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }

/* Failure details must keep long source titles inside the existing sheet. */
#songFailureTitle {
  overflow-wrap: anywhere;
}

/* Reading settings only affect this screen, never score generation or exports. */
.score-zoom-controls { position: absolute; z-index: 10; left: 12px; bottom: calc(var(--safe-bottom) + var(--transport-height) + 11px); }
.score-zoom-controls button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 1px solid #d9dbd7; border-radius: 8px; background: #fff; color: #3b403d; font-size: 12px; }
.score-zoom-controls svg { width: 16px; height: 16px; }
#scoreZoomValue { color: #6e746f; font-variant-numeric: tabular-nums; }
.score-zoomed .resume-follow-button { left: auto; right: 12px; transform: none; }
#scoreLayoutSheet { display: flex; flex-direction: column; padding: 0; max-height: calc(100dvh - var(--safe-top) - 12px); overflow: hidden; border-radius: 20px 20px 0 0; }
#scoreLayoutSheet .sheet-handle { flex: none; width: 32px; margin: 9px auto 3px; }
#scoreLayoutSheet .sheet-heading { flex: none; min-height: 58px; margin: 0; padding: 0 12px 0 20px; }
#scoreLayoutSheet .sheet-heading h2 { font-size: 17px; line-height: 24px; font-weight: 600; }
#scoreLayoutSheet .sheet-heading .close-sheet { flex: 0 0 44px; margin: 0; border: 0; background: transparent; color: var(--muted); }
.score-layout-body { min-height: 0; padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.score-layout-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
#scoreLayoutValue { font-size: 12px; }
.score-layout-auto { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.score-layout-auto>span { display: flex; align-items: center; gap: 8px; }
.score-layout-auto svg { width: 16px; height: 16px; }
.score-layout-auto>svg { width: 14px; height: 14px; visibility: hidden; }
.score-layout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.score-layout-grid button { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.score-layout-auto[aria-pressed="true"] { background: var(--surface-3); color: var(--accent-strong); }
.score-layout-auto[aria-pressed="true"]>svg { visibility: visible; }
.score-layout-grid button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.score-layout-error { margin: 8px 0 0; color: var(--danger); font-size: 12px; line-height: 20px; }
.score-layout-gesture { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 20px; }
.score-layout-gesture svg { flex: none; width: 16px; height: 16px; }
.score-layout-actions { flex: none; padding: 12px 20px calc(var(--safe-bottom) + 20px); border-top: 1px solid var(--line); }
.score-layout-actions>.primary-button { width: 100%; min-height: 46px; padding: 10px 12px; border: 0; border-radius: 10px; font-size: 14px; line-height: 20px; font-weight: 600; }
@media (min-width: 640px) {
  #scoreLayoutSheet { left: var(--score-layout-left, 12px); right: auto; top: var(--score-layout-top, 64px); bottom: auto; width: 336px; max-height: calc(100dvh - var(--score-layout-top, 64px) - var(--safe-bottom) - 12px); padding: 0; border: 1px solid var(--line); border-radius: 16px; }
  .sheet-backdrop[data-sheet="scoreLayoutSheet"] { background: transparent; backdrop-filter: none; }
  #scoreLayoutSheet .sheet-handle { display: none; }
  .score-layout-actions { padding-bottom: 16px; }
}
@media (max-width: 359px) {
  #scoreLayoutSheet .sheet-heading { padding-left: 16px; padding-right: 8px; }
  .score-layout-body, .score-layout-actions { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 600px) {
  .player-header { padding-left: max(4px, env(safe-area-inset-left)); padding-right: max(4px, env(safe-area-inset-right)); gap: 0; }
}

/* Keep player toolbar touch targets stable across compact widths. */
.player-header > .icon-button { flex: 0 0 44px; }
@media (max-width: 600px) {
  .player-title-block { grid-template-columns: minmax(0, 1fr); gap: 0; align-content: center; }
  .player-version-button { justify-self: start; max-width: 100%; min-height: 20px; padding: 0; }
  .player-version-button span { min-width: 0; }
}

.score-navigation-measure { border-color: var(--accent); background: rgb(215 170 78 / 12%); }


/* Confirmed mobile operation forms: visible choices, conditional numeric input. */
.sheet-form.score-operation-form { display: block; }
.score-operation-form .operation-fields { display: grid; gap: 20px; }
.score-operation-form fieldset { margin: 0; }
.score-operation-form legend,
.score-operation-form label { font-size: 14px; font-weight: 500; }
.score-operation-form legend { margin-bottom: 8px; }
.score-operation-form > fieldset { margin-bottom: 20px; }
.score-operation-form > label { display: block; margin-bottom: 8px; }
.score-operation-form input[type="number"],
.score-operation-form textarea { font-size: 16px; font-weight: 400; }
.operation-choices { gap: 8px; }
.operation-choices.two-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.operation-choices label { position: relative; min-width: 0; }
.operation-choices input { inset: 0; width: 100%; height: 100%; margin: 0; pointer-events: auto; }
.operation-choices span { min-height: 48px; padding: 0 6px; background: var(--surface); color: var(--text); font-size: 16px; font-weight: 400; }
.operation-choices input:focus-visible + span { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.operation-custom-field { display: block; margin-top: 12px; }
.operation-custom-field > input { margin-top: 8px; }
.operation-help { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 20px; }
.operation-footer { margin-top: 24px; }
.operation-consequence { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 20px; }
.operation-footer > button { width: 100%; }
.start-candidates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.start-candidates small { width: 100%; color: var(--muted); font-size: 12px; }
.start-candidates button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: 12px; }
.choice-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 15px; text-align: left; }
.choice-row > span:first-child { flex: 1; }
.choice-row-value { color: var(--muted); }
.choice-row > svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.choice-list-heading { gap: 6px; margin-left: -8px; margin-right: -8px; }
.choice-list-heading h2 { flex: 1; font-size: 18px; }
.single-choice-list { border: 0; padding: 0; margin: 0; min-width: 0; }
.single-choice-list label { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 16px; font-weight: 400; }
.single-choice-list label:last-child { border-bottom: 0; }
.single-choice-list input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; opacity: 0; }
.single-choice-list svg { width: 18px; height: 18px; color: var(--accent); visibility: hidden; }
.single-choice-list input:checked ~ svg { visibility: visible; }
.single-choice-list input:checked + span { color: var(--accent); }
.single-choice-list label:has(input:focus-visible) { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
.choice-row:focus-visible, .start-candidates button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.audio-mode-options { width: 248px; max-width: calc(100vw - 32px); }
.audio-mode-options button { min-height: 68px; padding: 10px 12px; gap: 12px; text-align: left; }
.audio-mode-options strong { display: block; font-size: 14px; font-weight: 500; }
.audio-mode-options small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 20px; }

.version-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.version-current-badge {
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.version-select { min-height: 48px; }
.version-hint { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.version-deletion-list { list-style: none; padding: 0; margin: 0 0 16px; }
.version-deletion-list li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.version-deletion-list .version-current-badge { margin-left: 8px; }
.version-deletion-list small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.version-deletion-warning { color: var(--danger); font-size: 13px; line-height: 1.7; }
.version-deletion-warning:empty { display: none; }
.version-deletion-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.version-deletion-actions button { flex: 1; min-height: 48px; min-width: 120px; }

/* I-06: compact practice panel, sharing the existing sheet focus and dismissal contract. */
.measure-sheet { padding: 12px 16px calc(12px + var(--safe-bottom)); background: var(--surface); }
.measure-sheet-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.measure-sheet-title { flex: 1; min-width: 0; }
.measure-sheet-title h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 500; }
.measure-sheet-title small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.measure-sheet-heading .icon-button { width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; background: transparent; border: 0; }
.measure-picker { display: flex; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.measure-picker button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; }
.measure-picker svg { width: 18px; height: 18px; }
.measure-picker input { width: 44px; min-height: 44px; height: 44px; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-size: 18px; background: transparent; appearance: textfield; box-shadow: none; }
.measure-picker input::-webkit-inner-spin-button { appearance: none; }
.measure-number-error { margin: 0 0 8px; color: var(--danger); font-size: 13px; }
.measure-practice-actions { display: grid; margin-bottom: 8px; }
.measure-action { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 15px; font-weight: 400; }
.measure-action svg { width: 20px; height: 20px; flex: none; }
#playFromMeasureButton { color: var(--accent-strong); }
#playFromMeasureButton svg { fill: currentColor; stroke: none; }
.measure-action:active { background: var(--surface-2); }
.measure-score-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 8px; gap: 8px; }
.measure-score-actions button { display: flex; min-height: 44px; justify-content: center; align-items: center; gap: 8px; border: 0; padding: 0; background: transparent; font-size: 14px; color: var(--muted); }
.measure-score-actions svg { width: 18px; height: 18px; }
.loop-range-heading { gap: 6px; margin-bottom: 16px; }
.loop-range-heading .icon-button:first-child { margin-left: -8px; }
.loop-range-heading .close-sheet { margin-right: -8px; }
.loop-range-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.loop-range-fields label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.loop-range-fields .measure-picker { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; min-width: 0; }
.loop-range-fields input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.loop-range-fields svg { width: 16px; height: 16px; }
#loopRangeError { margin: 10px 0 0; }
.loop-range-summary { display: flex; align-items: center; gap: 6px; margin: 16px 0; min-height: 20px; color: var(--muted); font-size: 12px; }
.loop-range-summary svg { width: 16px; height: 16px; flex: none; }
#applyLoopButton { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; border-radius: 10px; font-size: 15px; }
#applyLoopButton svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
#exitLoopSettingsButton { display: block; width: 100%; min-height: 44px; padding: 0; margin-top: 6px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
@media (min-width: 640px) {
  .player-view { --transport-height: var(--player-bar-height); }
  .player-view:has(.transport-aux.has-loop) { --transport-height: calc(var(--player-bar-height) + 44px); }
  .transport-inner { grid-template-columns: minmax(0, 1fr) 360px 44px; }
  .transport-aux { grid-area: 1 / 2; }
  .transport-fullscreen { grid-area: 1 / 3; }
  .transport-inner:has(.has-loop) { grid-template-columns: minmax(0, 1fr) 44px; }
  .transport-inner:has(.has-loop) .transport-aux { grid-area: 2 / 1 / 3 / -1; }
  .transport-inner:has(.has-loop) .transport-fullscreen { grid-area: 1 / 2; }
  .transport-aux.has-loop { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #measureSheet { left: var(--measure-panel-left, 12px); right: auto; bottom: var(--measure-panel-bottom, 64px); width: 336px; max-height: calc(100dvh - var(--measure-panel-bottom, 64px) - var(--safe-top) - 12px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
  .sheet-backdrop[data-sheet="measureSheet"] { background: transparent; backdrop-filter: none; }
}
@media (max-width: 350px) {
  .transport-menu-trigger { gap: 4px; padding: 0 2px; }
  .transport-menu-trigger > svg { width: 16px; height: 16px; }
  .measure-sheet { padding-left: 12px; padding-right: 12px; }
  .measure-sheet-heading { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .transport-bar, .play-button { transition: none; } }


/* Approved homepage A: practice feature, quiet library rows and one bottom action. */
.home-view { --bg:#121315; --muted:#a2a3a6; --accent:#d1b26f; }
.home-view .app-header { min-height:calc(var(--safe-top) + 68px); padding-top:calc(var(--safe-top) + 12px); padding-bottom:12px; border-bottom:0; background:var(--bg); backdrop-filter:none; }
.home-view .home-logo-badge { width:34px; height:34px; flex-basis:34px; border:0; border-radius:10px; box-shadow:none; }
.home-view .home-brand-copy { gap:4px; }
.home-view .home-brand-copy strong { font-size:17px; font-weight:600; line-height:20px; letter-spacing:1px; }
.home-view .home-brand-copy small { gap:2px; font-size:8px; line-height:10px; font-weight:500; color:#98958d; }
.home-view .header-actions { gap:2px; }
.home-view .header-actions .icon-button { border:0; border-radius:50%; background:transparent; box-shadow:none; }
.home-view .subscription-stars path { fill:var(--accent); }
.home-view .header-actions .icon-button:active { background:#ffffff08; }
.home-content { padding:14px max(20px, env(safe-area-inset-right)) calc(24px + var(--safe-bottom)) max(20px, env(safe-area-inset-left)); }
.pull-refresh-indicator { top:calc(var(--safe-top) + 68px); }
.practice-card { isolation:isolate; margin-bottom:26px; border:0; border-radius:20px; background:linear-gradient(118deg,#2b2924 0%,#232323 55%,#1c1e20 100%); box-shadow:inset 0 1px #ffffff0b; }
.practice-entry { display:block; width:100%; border:0; border-radius:inherit; padding:18px; background:transparent; color:inherit; text-align:left; }
.practice-entry:active { background:#ffffff06; }
.practice-entry:disabled { opacity:.7; cursor:wait; }
.practice-body { display:grid; grid-template-columns:minmax(0,1fr) 104px; align-items:center; gap:4px; }
.practice-heading, .practice-heading > span, .practice-meta, .practice-meta > span { display:flex; align-items:center; }
.practice-heading { justify-content:space-between; gap:8px; margin-bottom:19px; }
.practice-heading > span { gap:6px; color:var(--accent); font-size:12px; line-height:18px; font-weight:500; }
.practice-heading time { color:var(--muted); font-size:11px; line-height:18px; flex-shrink:0; }
.practice-heading svg, .practice-meta svg { width:15px; height:15px; flex-shrink:0; }
.practice-copy { display:flex; flex-direction:column; min-width:0; gap:15px; }
#practiceTitle { font-size:20px; line-height:27px; font-weight:600; letter-spacing:-.35px; overflow-wrap:anywhere; }
.practice-meta { flex-wrap:wrap; gap:6px 13px; color:#b7b4ad; font-size:11px; line-height:20px; }
.practice-meta > span { gap:5px; white-space:nowrap; }
.practice-meta .practice-chevron { display:none; margin-left:auto; width:19px; height:19px; color:var(--accent); }
.practice-drum-kit { display:block; width:100%; height:auto; object-fit:contain; pointer-events:none; filter:drop-shadow(0 12px 16px #0004); }
.section-status { min-height:44px; margin-bottom:5px; font-size:11px; }
.section-status h2 { font-size:17px; line-height:24px; font-weight:600; }
.section-status .library-actions { align-items:center; gap:8px; }
.library-actions .icon-button { width:44px; min-height:44px; height:44px; margin-right:-12px; }
.library-actions .icon-button svg { width:17px; height:17px; }
.home-add-dock { position:relative; z-index:2; flex:0 0 auto; display:flex; justify-content:center; padding:12px max(20px, env(safe-area-inset-right)) calc(12px + var(--safe-bottom)) max(20px, env(safe-area-inset-left)); background:var(--bg); }
.home-view:has(.home-add-dock:not([hidden])) .home-content { padding-bottom:24px; }
.library-add { display:inline-flex; align-items:center; justify-content:center; gap:9px; width:100%; max-width:260px; height:50px; min-height:50px; padding:12px 20px; border:0; border-radius:25px; background:var(--accent); color:var(--accent-ink); font-size:14px; font-weight:600; line-height:22px; white-space:nowrap; box-shadow:0 6px 22px #0003; }
.library-add:active { background:var(--accent-strong); }
.library-add svg { width:20px; height:20px; stroke-width:1.6; }
.song-list { gap:0; }
.song-item.ready { grid-template-columns:44px minmax(0,1fr) 16px; gap:13px; border:0; border-bottom:1px solid #ffffff12; border-radius:0; background:transparent; box-shadow:none; padding:14px 0 18px; }
.song-item.ready:active { background:#ffffff06; }
.song-item.ready::before { display:none; }
.song-item.ready .song-icon { width:44px; height:50px; border:0; border-radius:11px; background:#25272a; color:#c2b496; }
.song-item.ready .song-icon svg { width:23px; height:23px; stroke-width:1.4; }
.song-item.ready .song-copy strong { font-size:14px; font-weight:500; line-height:21px; }
.song-item.ready .song-meta { flex-wrap:wrap; gap:3px 6px; margin-top:5px; color:var(--muted); font-size:11px; line-height:18px; }
.song-item.ready .status-pill { min-height:0; padding:0; border-radius:0; background:none; color:inherit; font-weight:400; }
.song-item.ready .status-pill::after { content:"·"; margin-left:6px; }
.song-item.ready > svg { width:16px; height:16px; color:var(--dim); }
.home-content.is-empty { display:flex; flex-direction:column; }
.empty-library { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:380px; padding:20px 0 66px; text-align:center; }
.empty-drum-art { display:block; width:210px; height:auto; margin-bottom:26px; object-fit:contain; flex-shrink:0; }
.empty-library h2 { margin:0; font-size:23px; line-height:32px; font-weight:600; letter-spacing:.3px; }
.empty-library p { margin:9px 0 26px; color:var(--muted); font-size:13px; line-height:22px; }
.empty-source-actions { display:flex; gap:10px; width:100%; max-width:350px; }
.empty-source-action { display:flex; flex:1; min-width:0; min-height:48px; align-items:center; justify-content:center; gap:9px; padding:12px 10px; border:0; border-radius:11px; background:#292824; color:var(--text); font-size:14px; font-weight:500; line-height:24px; }
.empty-source-action svg { width:20px; height:20px; color:var(--accent); }
.empty-source-action:active { background:#35332d; }
@media (min-width:720px) {
  .home-content, .home-view .app-header { padding-right:max(32px, env(safe-area-inset-right), calc((100vw - 820px) / 2)); padding-left:max(32px, env(safe-area-inset-left), calc((100vw - 820px) / 2)); }
  .home-content { padding-top:20px; }
  .practice-entry { padding:22px 26px; }
  .practice-heading { margin-bottom:14px; }
  .practice-body { grid-template-columns:minmax(0,1fr) 176px; gap:12px; }
  .practice-copy { gap:13px; }
  #practiceTitle { font-size:26px; line-height:34px; letter-spacing:-.5px; }
  .practice-meta { font-size:12px; gap:6px 18px; }
  .practice-meta .practice-chevron { display:block; }
}
@media (max-width:350px) {
  .home-content { padding-right:max(16px, env(safe-area-inset-right)); padding-left:max(16px, env(safe-area-inset-left)); }
  .home-add-dock { padding-right:max(16px, env(safe-area-inset-right)); padding-left:max(16px, env(safe-area-inset-left)); }
  .section-status > div { gap:5px; }
  .practice-entry { padding:15px; }
  .practice-body { grid-template-columns:minmax(0,1fr) 86px; gap:5px; }
  #practiceTitle { font-size:18px; line-height:25px; }
  .practice-meta { gap:6px 8px; }
  .section-status>div:first-child { flex-wrap:wrap; }
  .empty-source-action { gap:6px; font-size:13px; }
}

/* Account sheets share the approved compact, single-column phone/iPad layout. */
.bottom-sheet.account-sheet {
  padding: 0 18px calc(var(--safe-bottom) + 18px);
  bottom: var(--account-viewport-bottom, 0px);
  min-height: min(540px, calc(var(--account-viewport-height, 100dvh) * .8));
  max-height: calc(var(--account-viewport-height, 100dvh) - var(--safe-top) - 24px);
  border: 0;
  border-radius: 20px 20px 0 0;
  overscroll-behavior: contain;
}
.account-sheet .sheet-handle { width: 32px; height: 4px; margin: 9px auto 3px; background: #62696f; }
.account-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 58px;
  margin: 0 -8px;
}
.account-heading h2 { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 500; text-align: center; }
.account-main-heading h2 { grid-column: 1 / 3; padding-left: 8px; text-align: left; }
.account-heading .icon-button {
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
}
.account-heading svg, .account-row > svg { width: 18px; height: 18px; stroke-width: 1.7; flex: none; }
.account-sheet .account-summary { padding: 10px 0 24px; }
.account-summary > div { min-width: 0; overflow-wrap: anywhere; }
.account-sheet .account-avatar { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--surface-3); color: #d9dde1; }
.account-avatar svg { width: 23px; height: 23px; }
.account-sheet .account-summary strong { font-size: 17px; font-weight: 500; }
.account-sheet .account-summary small { margin-top: 3px; font-size: 12px; letter-spacing: .3px; }
.account-group { margin-bottom: 14px; overflow: clip; border-radius: 12px; background: var(--surface-2); }
.account-row {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 54px; margin: 0; padding: 12px 14px;
  border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; text-decoration: none;
}
.account-row + .account-row::before { content: ""; position: absolute; top: 0; left: 43px; right: 14px; height: 1px; background: var(--line); }
.account-row > svg:first-child { color: var(--muted); }
.account-row-label { min-width: 0; flex: 1; font-size: 14px; line-height: 1.5; font-weight: 400; overflow-wrap: anywhere; }
.account-row-label strong { display: block; font-size: 14px; font-weight: 400; }
.account-row-label small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.account-row-meta { flex: none; font-size: 12px; font-weight: 400; color: var(--muted); }
.account-row > .account-chevron { width: 14px; height: 14px; color: var(--muted); }
.account-row.account-membership { min-height: 62px; }
.account-membership > svg:first-child { color: var(--accent); }
.account-row:disabled { opacity: 1; cursor: default; }
.account-row:disabled .account-row-meta { color: var(--dim); }
.account-row:not(:disabled):active { background: var(--surface-3); }
.account-section-label { margin: 17px 2px 9px; font-size: 12px; color: var(--muted); font-weight: 400; }
.account-hint { margin: -3px 2px 22px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.account-safety { margin-top: 26px; }
.account-danger, .account-danger > svg:first-child { color: var(--danger); }
#accountSheet { display: flex; flex-direction: column; }
#accountSheet > * { flex-shrink: 0; }
.account-footer { margin-top: auto; padding: 13px 0 15px; }
.account-logout { display: block; width: 100%; min-height: 44px; padding: 9px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 400; color: var(--muted); background: transparent; }
.account-preference { gap: 15px; min-height: 77px; }
.account-preference + .account-preference::before { left: 14px; }
.account-switch { position: relative; display: block; flex: none; width: 48px; height: 44px; }
.account-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.account-switch-track { position: absolute; top: 9px; left: 2px; width: 44px; height: 26px; border-radius: 15px; background: #565e65; transition: background-color var(--motion-feedback) ease; }
.account-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform var(--motion-feedback) ease; }
.account-switch input:checked + .account-switch-track { background: var(--accent); }
.account-switch input:checked + .account-switch-track::after { transform: translateX(18px); background: var(--accent-ink); }
.account-switch input:focus-visible + .account-switch-track { outline: 2px solid var(--accent); outline-offset: 4px; }
.account-switch input:disabled { cursor: default; }
.account-switch input:disabled + .account-switch-track { opacity: .5; }
.account-form-sheet .sheet-subtitle { font-size: 13px; line-height: 1.65; }
.account-form-sheet .account-section-hint { font-size: 12px; }
.account-logout-dialog { width: min(306px, calc(100vw - 32px)); padding: 21px; background: var(--surface-2); border-radius: 16px; }
.account-logout-dialog h2 { margin: 0 0 10px; font-size: 16px; font-weight: 500; }
.account-logout-dialog p { margin: 0 0 16px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.account-logout-dialog .confirmation-actions { gap: 8px; }
.account-logout-dialog .secondary-button { min-height: 44px; padding: 9px; border: 0; border-radius: 9px; font-size: 13px; font-weight: 400; background: var(--surface-3); }
@media (min-width: 700px) {
  .bottom-sheet.account-sheet {
    top: calc(var(--account-viewport-top, 0px) + var(--account-viewport-height, 100dvh) / 2);
    bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%);
    width: 430px; padding: 0 22px 18px; border-radius: 18px;
    min-height: min(538px, calc(var(--account-viewport-height, 100dvh) * .8));
    max-height: calc(var(--account-viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 32px);
  }
  .account-sheet .sheet-handle { display: none; }
}
@media (max-width: 359px) {
  .bottom-sheet.account-sheet { padding-inline: 16px; }
  .account-row { padding-inline: 12px; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .account-switch-track, .account-switch-track::after { transition: none; }
}

#subscriptionSheet .sheet-heading:has(#accountBillingBackButton:not([hidden])) { gap: 8px; }
#accountBillingBackButton { flex: none; width: 44px; height: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); }
#accountBillingBackButton:not([hidden]) + h2 { margin-right: auto; }


/* Export keeps a stable footer while long titles and formats scroll on short screens. */
#exportSheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  padding: 0 18px calc(var(--safe-bottom) + 14px);
  border: 0;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}
#exportSheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; background: #62696f; }
#exportSheet .sheet-heading { flex: none; min-height: 58px; margin: 0 -8px 0 0; }
#exportSheet .sheet-heading h2 { font-size: 17px; line-height: 1.4; font-weight: 500; }
#exportSheet .close-sheet { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
#exportSheet .close-sheet svg { width: 18px; height: 18px; stroke-width: 1.7; }
.export-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.export-context { display: grid; gap: 6px; padding: 4px 0 22px; overflow-wrap: anywhere; }
.export-context strong { font-size: 16px; line-height: 1.5; font-weight: 500; }
.export-context span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.export-group { overflow: clip; margin-bottom: 14px; border-radius: 12px; background: var(--surface-2); }
.export-option { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.export-option + .export-option::before { content: ""; position: absolute; top: 0; left: 44px; right: 14px; height: 1px; background: var(--line); }
.export-option > span { flex: 1; min-width: 0; }
.export-option strong { display: block; font-size: 14px; font-weight: 400; line-height: 1.5; }
.export-option small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.export-option > svg { flex: none; width: 18px; height: 18px; stroke-width: 1.7; color: var(--muted); }
.export-option > svg:last-child { width: 16px; height: 16px; }
.export-option:disabled { opacity: .55; }
.export-option:not(:disabled):active { background: var(--surface-3); }
.export-footer { flex: none; display: flex; flex-direction: column; justify-content: center; min-height: 58px; padding: 0 2px 4px; color: var(--muted); }
.export-idle-hint { margin: 0; font-size: 12px; line-height: 1.6; }
.export-status { display: flex; align-items: center; gap: 8px; min-height: 54px; }
.export-status-message { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.export-status-message p { margin: 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.export-status .spinner, .export-state-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.export-state-icon svg { display: block; width: 16px; height: 16px; stroke-width: 1.7; }
.export-status.is-error #exportErrorIcon { color: var(--danger); }
.export-status .text-button { flex: none; min-width: 48px; min-height: 44px; margin-right: -8px; padding: 8px; border: 0; border-radius: 8px; font-size: 13px; font-weight: 400; color: var(--accent); }
@media (min-width: 700px) {
  #exportSheet { top: 50%; bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px); padding: 0 22px 14px; border-radius: 18px; }
  #exportSheet .sheet-handle { display: none; }
}
@media (max-width: 359px) {
  #exportSheet { padding-inline: 16px; }
  .export-option { padding-inline: 12px; gap: 10px; }
}

/* Import uses the same compact surfaces as My Account and Export. */
.bottom-sheet.import-sheet {
  display: flex; flex-direction: column; left: 0; right: 0;
  bottom: var(--import-viewport-bottom, 0px);
  max-height: calc(var(--import-viewport-height, 100dvh) - var(--safe-top) - 24px);
  overflow: hidden; padding: 0 18px calc(var(--safe-bottom) + 18px);
  border: 0; border-radius: 20px 20px 0 0;
}
.import-sheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; background: #62696f; }
.import-sheet .import-heading { flex: none; min-height: 58px; gap: 4px; margin: 0 -8px 0 0; }
.import-heading h2 { flex: 1; font-size: 17px; line-height: 1.4; font-weight: 500; }
.import-heading .icon-button { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.import-heading .icon-button svg { width: 18px; height: 18px; stroke-width: 1.7; }
.import-heading .import-back { margin-left: -12px; }
.import-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-top: 4px; }
.import-lead { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-source-group { overflow: hidden; margin-bottom: 12px; border-radius: 12px; background: var(--surface-2); }
.import-source-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; }
.import-source-row + .import-source-row::before { content: ""; position: absolute; top: 0; left: 44px; right: 14px; height: 1px; background: var(--line); }
.import-source-row > span { flex: 1; min-width: 0; }
.import-source-row strong { display: block; font-size: 14px; font-weight: 400; line-height: 1.5; }
.import-source-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.import-source-row > svg { flex: none; width: 18px; height: 18px; color: var(--muted); stroke-width: 1.7; }
.import-source-row > svg:last-child { width: 16px; height: 16px; }
.import-source-row:active { background: var(--surface-3); }
.import-media-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface-2); border-radius: 12px; }
.import-media-card > svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--muted); stroke-width: 1.7; }
.import-media-copy { flex: 1; min-width: 0; }
.import-media-copy > strong { display: block; font-size: 16px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.import-media-copy > small, .file-import-metadata { display: block; margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.file-import-metadata { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.import-limits { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.import-footer { flex: none; padding-top: 18px; }
.import-hint { margin: 0 0 12px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.import-footer .primary-button { width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 500; }
.import-secondary { display: flex; justify-content: center; margin-top: 4px; }
.import-sheet .text-button { min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.import-cancel { width: 100%; min-height: 48px !important; }
.import-form { display: flex; flex-direction: column; min-height: 0; }
.import-input-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
#bilibiliUrl { display: block; width: 100%; min-height: 48px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
#bilibiliUrl[aria-invalid="true"] { border-color: var(--danger); }
.import-status { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.import-status .spinner, .import-status > svg { flex: none; width: 16px; height: 16px; }
.import-status.is-error { color: var(--danger); }
@media (min-width: 700px) {
  .bottom-sheet.import-sheet { top: calc(var(--import-viewport-top, 0px) + var(--import-viewport-height, 100dvh) / 2); bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(var(--import-viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 32px); padding: 0 22px 20px; border-radius: 18px; }
  .import-sheet .sheet-handle { display: none; }
}
@media (max-width: 359px) {
  .bottom-sheet.import-sheet { padding-inline: 16px; }
  .import-source-row { padding-inline: 12px; gap: 10px; }
}

/* Regeneration keeps its three settings visible and its action above the keyboard. */
#regenerateSheet {
  display: flex; flex-direction: column; left: 0; right: 0;
  bottom: var(--regenerate-viewport-bottom, 0px);
  max-height: calc(var(--regenerate-viewport-height, 100dvh) - var(--safe-top) - 24px);
  padding: 0; border: 0; border-radius: 20px 20px 0 0; overflow: hidden;
}
#regenerateSheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; }
#regenerateSheet .sheet-heading { flex: none; min-height: 58px; gap: 8px; margin: 0; padding: 0 12px 0 20px; }
#regenerateSheet .sheet-heading h2 { flex: 1; font-size: 17px; line-height: 24px; font-weight: 500; }
#regenerateSheet .close-sheet { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
#regenerateSheet .close-sheet svg { width: 18px; height: 18px; stroke-width: 1.7; }
#regenerateForm { display: flex; flex-direction: column; min-height: 0; }
#regenerateForm .operation-calibration { display: grid; gap: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
#regenerateCalibrationTitle { margin: 0; font-size: 14px; }
#versionListErrorText { flex: 1; }
#retryVersionListButton { flex: none; width: auto; min-height: 44px; }
#regenerateForm .operation-fields { min-height: 0; gap: 20px; padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
#regenerateForm fieldset { min-width: 0; }
#regenerateForm legend { padding: 0; margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 500; }
#regenerateForm .operation-choices { gap: 3px; padding: 2px; border-radius: 10px; background: var(--surface-2); }
#regenerateForm .operation-choices label { display: block; }
#regenerateForm .operation-choices span { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 44px; padding: 0 4px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 14px; line-height: 20px; white-space: nowrap; }
#regenerateForm .operation-choices input:checked + span { background: #3c3f42; color: var(--accent); font-weight: 500; }
#regenerateForm .operation-choices svg { display: none; width: 13px; height: 13px; stroke-width: 2; }
#regenerateForm .operation-choices input:checked + span svg { display: block; }
#regenerateForm .operation-choices input:focus-visible + span { outline-offset: -2px; }
#regenerateForm .operation-custom-field { margin-top: 12px; }
#regenerateForm .regenerate-field-label { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 6px; color: var(--muted); font-size: 12px; line-height: 19px; font-weight: 400; }
#regenerateForm .regenerate-number { display: flex; align-items: center; border-radius: 9px; background: var(--surface-2); }
#regenerateForm .regenerate-number:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
#regenerateForm .regenerate-number input { min-width: 0; width: 100%; min-height: 44px; height: 44px; margin: 0; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; box-shadow: none; font-size: 16px; line-height: 24px; appearance: textfield; }
#regenerateForm .regenerate-number input::-webkit-inner-spin-button { appearance: none; }
#regenerateForm .regenerate-number > span { flex: none; padding-right: 12px; color: var(--muted); font-size: 12px; }
#regenerateForm .regenerate-field-error { margin: 8px 0 0; color: var(--danger); font-size: 12px; line-height: 20px; }
#regenerateForm .start-candidates { gap: 6px; margin-top: 8px; }
#regenerateForm .start-candidates small { font-size: 12px; line-height: 18px; }
#regenerateForm .start-candidates button { min-width: 0; min-height: 44px; max-width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 20px; text-align: left; overflow-wrap: anywhere; }
#regenerateForm .operation-footer { flex: none; margin: 0; padding: 12px 20px calc(20px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
#regenerateForm .operation-consequence { margin: 0 0 10px; font-size: 12px; line-height: 20px; }
#regenerateForm .operation-footer > button { min-height: 46px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); box-shadow: none; font-size: 14px; font-weight: 500; }
@media (min-width: 700px) {
  #regenerateSheet { top: calc(var(--regenerate-viewport-top, 0px) + var(--regenerate-viewport-height, 100dvh) / 2); bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(var(--regenerate-viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 32px); border-radius: 18px; }
  #regenerateSheet .sheet-handle { display: none; }
  #regenerateForm .operation-footer { padding-bottom: 20px; }
}
#regenerateSheet.viewport-compact { max-height: calc(var(--regenerate-viewport-height, 100dvh) - var(--safe-top) - 12px); }
#regenerateSheet.viewport-compact .operation-footer { padding-bottom: 12px; }
@media (max-width: 359px) {
  #regenerateSheet .sheet-heading { padding-left: 16px; padding-right: 8px; }
  #regenerateForm .operation-fields, #regenerateForm .operation-footer { padding-left: 16px; padding-right: 16px; }
}

/* Fill settings and style choices share the compact score-operation surfaces. */
#measureFillSheet {
  display: flex; flex-direction: column; left: 0; right: 0;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  padding: 0; border: 0; border-radius: 20px 20px 0 0; overflow: hidden;
}
#measureFillSheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; }
#measureFillSettings, #measureFillPicker, #measureFillForm { display: flex; flex-direction: column; min-height: 0; gap: 0; }
#measureFillSheet .sheet-heading { flex: none; min-height: 58px; gap: 8px; margin: 0; padding: 0 12px 0 20px; }
#measureFillSheet .sheet-heading h2 { flex: 1; font-size: 17px; line-height: 24px; font-weight: 500; }
#measureFillSheet .icon-button { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
#measureFillSheet .icon-button svg { width: 18px; height: 18px; stroke-width: 1.7; }
#measureFillSheet .choice-list-heading { padding-left: 8px; gap: 4px; }
#measureFillSheet .fill-scroll { min-height: 0; padding: 8px 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
#measureFillPicker .fill-scroll { padding-bottom: calc(24px + var(--safe-bottom)); }
#measureFillStyleButton { min-height: 52px; gap: 10px; padding: 12px 14px; border: 0; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 22px; font-weight: 400; }
#measureFillSheet .operation-footer { flex: none; margin: 0; padding: 12px 20px calc(20px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
#measureFillSheet .operation-consequence { margin: 0 0 10px; font-size: 12px; line-height: 20px; }
#measureFillSheet .operation-footer > button { min-height: 46px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); box-shadow: none; font-size: 14px; line-height: 22px; font-weight: 500; }
#measureFillSheet .single-choice-list { border-radius: 10px; overflow: hidden; background: var(--surface-2); }
#measureFillSheet .single-choice-list label { min-height: 48px; gap: 10px; padding: 10px 14px; border: 0; font-size: 14px; line-height: 22px; font-weight: 400; }
#measureFillSheet .single-choice-list label + label::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: var(--line); }
#measureFillSheet .single-choice-list label > span { flex: 1; }
#measureFillSheet .single-choice-list svg { width: 16px; height: 16px; stroke-width: 1.8; }
@media (min-width: 700px) {
  #measureFillSheet { top: 50%; bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px); border-radius: 18px; }
  #measureFillSheet .sheet-handle { display: none; }
  #measureFillSheet .operation-footer { padding-bottom: 20px; }
  #measureFillPicker .fill-scroll { padding-bottom: 24px; }
}
@media (max-width: 359px) {
  #measureFillSheet .sheet-heading { padding-left: 16px; padding-right: 8px; }
  #measureFillSheet .choice-list-heading { padding-left: 4px; }
  #measureFillSheet .fill-scroll, #measureFillSheet .operation-footer { padding-left: 16px; padding-right: 16px; }
}

/* Feedback has a scrolling draft and stable heading/action above the keyboard. */
#feedbackSheet {
  display: flex; flex-direction: column; left: 0; right: 0;
  bottom: var(--feedback-viewport-bottom, 0px);
  max-height: calc(var(--feedback-viewport-height, 100dvh) - var(--safe-top) - 24px);
  padding: 0; border: 0; border-radius: 20px 20px 0 0; overflow: hidden;
}
#feedbackSheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; }
#feedbackSheet .sheet-heading { flex: none; min-height: 58px; gap: 8px; margin: 0; padding: 0 12px 0 20px; }
#feedbackSheet .sheet-heading h2 { flex: 1; font-size: 17px; line-height: 24px; font-weight: 500; }
#feedbackSheet .close-sheet { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
#feedbackSheet .close-sheet svg { width: 18px; height: 18px; stroke-width: 1.7; }
#feedbackForm { display: flex; flex-direction: column; min-height: 0; gap: 0; }
#feedbackForm .feedback-scroll { display: grid; gap: 20px; min-height: 0; padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
#feedbackForm fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
#feedbackForm legend, #feedbackForm .feedback-comment-field > label { width: 100%; padding: 0; margin: 0 0 8px; }
#feedbackForm .feedback-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--muted); }
#feedbackForm small { font-size: 12px; font-weight: 400; color: var(--muted); }
#feedbackForm .check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#feedbackForm .check-grid label { position: relative; display: block; min-width: 0; }
#feedbackForm .check-grid input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: auto; cursor: pointer; }
#feedbackForm .check-grid span { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 48px; padding: 10px 6px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 14px; line-height: 22px; font-weight: 400; }
#feedbackForm .check-grid svg { display: none; width: 13px; height: 13px; stroke-width: 2; }
#feedbackForm .check-grid input:checked + span { background: #3c3f42; color: var(--accent); font-weight: 500; }
#feedbackForm .check-grid input:checked + span svg { display: block; }
#feedbackForm .check-grid input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
#feedbackComment { display: block; width: 100%; height: 88px; min-height: 88px; margin: 0; padding: 10px 12px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 16px; line-height: 24px; resize: none; }
#feedbackComment::placeholder { color: var(--dim); }
#feedbackComment:focus { outline: 1px solid var(--accent); outline-offset: -1px; box-shadow: none; }
#feedbackForm .operation-footer { flex: none; margin: 0; padding: 12px 20px calc(20px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
#feedbackForm .operation-consequence { margin: 0 0 10px; font-size: 12px; line-height: 20px; }
#feedbackForm .feedback-error { margin: 8px 0 0; font-size: 12px; line-height: 20px; color: var(--danger); overflow-wrap: anywhere; }
#feedbackForm #feedbackSubmitError { margin: 0 0 10px; }
#feedbackForm .operation-footer > button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); box-shadow: none; font-size: 14px; line-height: 22px; font-weight: 500; }
#feedbackSubmitSpinner { flex: none; width: 16px; height: 16px; border-color: currentColor; border-right-color: transparent; }
@media (min-width: 700px) {
  #feedbackSheet { top: calc(var(--feedback-viewport-top, 0px) + var(--feedback-viewport-height, 100dvh) / 2); bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(var(--feedback-viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 32px); border-radius: 18px; }
  #feedbackSheet .sheet-handle { display: none; }
  #feedbackForm .operation-footer { padding-bottom: 20px; }
}
#feedbackSheet.viewport-compact { max-height: calc(var(--feedback-viewport-height, 100dvh) - var(--safe-top) - 12px); }
#feedbackSheet.viewport-compact .operation-footer { padding-bottom: 12px; }
@media (max-width: 359px) {
  #feedbackSheet .sheet-heading { padding-left: 16px; padding-right: 8px; }
  #feedbackForm .feedback-scroll, #feedbackForm .operation-footer { padding-left: 16px; padding-right: 16px; }
}

/* Delay settings remain compact while custom bars can use the numeric keyboard. */
.playback-delay-divider { height: 1px; margin: 4px 8px; background: rgb(255 255 255 / 14%); }
.playback-delay-label { margin: 6px 8px 2px; color: #c5cad0; font-size: 12px; }
.playback-delay-custom { padding: 8px; border-top: 1px solid rgb(255 255 255 / 14%); }
.playback-delay-custom label { display: block; margin-bottom: 6px; color: #c5cad0; font-size: 12px; }
.playback-delay-custom > div { display: flex; align-items: center; gap: 8px; }
.playback-delay-custom input { width: 0; flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 6px; background: var(--surface-2); color: #f4f5f7; font-size: 16px; }
.playback-delay-custom button { flex: none; min-width: 56px; justify-content: center; background: rgb(223 187 121 / 18%); color: #f1d097; }
#playbackDelayBarsError { margin: 6px 0 0; color: var(--danger); font-size: 12px; line-height: 1.4; }

.transport-delay-row .playback-delay-options.keyboard-open { position: fixed; left: auto; right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--delay-keyboard) + 8px); max-height: calc(var(--delay-visible-height) - 69px - var(--safe-top)); }

.playback-delay-presets { display: grid; }

.version-list-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; color: var(--danger); font-size: 13px; line-height: 1.5; }

/* Motion A: shared entry/exit, independent of each panel's positioning transform. */
button { transition: background-color var(--motion-feedback) ease, color var(--motion-feedback) ease, border-color var(--motion-feedback) ease, filter var(--motion-feedback) ease; }
button:not(:disabled):active { filter: brightness(.94); }
.choice-grid span, .check-grid span, .single-choice-list label { transition: background-color var(--motion-feedback) ease, color var(--motion-feedback) ease, border-color var(--motion-feedback) ease; }
.bottom-sheet, .modal-dialog, .transport-menu-options, .toast, .sheet-backdrop, .loading-overlay {
  --motion-shift: 0px;
  --motion-scale: 1;
  opacity: 1;
  translate: 0 0;
  scale: 1;
  transition: opacity var(--motion-enter) var(--motion-ease), translate var(--motion-enter) var(--motion-ease), scale var(--motion-enter) var(--motion-ease), display var(--motion-enter) allow-discrete;
}
.bottom-sheet { --motion-shift: 18px; }
.modal-dialog, .transport-menu-options, .toast { --motion-shift: 6px; }
.modal-dialog { --motion-scale: .985; }
@media (min-width: 640px) { .bottom-sheet { --motion-shift: 6px; --motion-scale: .985; } }
:is(.bottom-sheet, .modal-dialog, .transport-menu-options, .toast, .sheet-backdrop, .loading-overlay)[hidden] {
  opacity: 0;
  translate: 0 var(--motion-shift);
  scale: var(--motion-scale);
  transition-duration: var(--motion-exit);
  pointer-events: none;
}
@starting-style {
  :is(.bottom-sheet, .modal-dialog, .transport-menu-options, .toast, .sheet-backdrop, .loading-overlay):not([hidden]) {
    opacity: 0;
    translate: 0 var(--motion-shift);
    scale: var(--motion-scale);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* Destructive confirmations share the compact sheet hierarchy and keep actions in view. */
.bottom-sheet.deletion-sheet { display: flex; flex-direction: column; max-height: calc(100dvh - var(--safe-top) - 16px); padding: 0 22px calc(20px + var(--safe-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; background: var(--surface); }
.deletion-sheet .sheet-handle { flex: none; width: 32px; height: 4px; margin: 9px auto 3px; }
.deletion-sheet .sheet-heading { flex: none; min-height: 58px; margin: 0 -8px 0 0; }
.deletion-sheet .sheet-heading h2 { font-size: 17px; font-weight: 500; line-height: 24px; }
.deletion-sheet .icon-button { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.deletion-sheet .icon-button svg { width: 18px; height: 18px; stroke-width: 1.7; }
.deletion-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.deletion-object { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.deletion-object svg { flex: none; width: 20px; height: 20px; color: var(--muted); stroke-width: 1.7; }
.deletion-object strong { min-width: 0; font-size: 14px; font-weight: 500; line-height: 22px; overflow-wrap: anywhere; }
.deletion-sheet .deletion-copy, .deletion-sheet .version-deletion-warning { margin: 12px 0 0; font-size: 12px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.deletion-sheet #deleteVersionStatus { margin: 0 0 12px; }
.deletion-sheet .version-deletion-warning { color: var(--danger); }
.deletion-sheet .version-deletion-list { margin: 0; overflow: clip; border-radius: 12px; background: var(--surface-2); }
.deletion-sheet .version-deletion-list:empty { display: none; }
.deletion-sheet .version-deletion-list li { position: relative; padding: 12px 14px; border: 0; font-size: 14px; line-height: 22px; }
.deletion-sheet .version-deletion-list li + li::before { content: ""; position: absolute; top: 0; right: 14px; left: 14px; height: 1px; background: var(--line); }
.deletion-sheet .version-deletion-list small { margin-top: 3px; line-height: 19px; }
.deletion-sheet .version-current-badge { display: inline-block; font-size: 11px; font-weight: 500; }
.deletion-sheet .confirmation-actions, .deletion-sheet .version-deletion-actions { display: flex; flex: none; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.deletion-sheet :is(.confirmation-actions, .version-deletion-actions) button { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; font-size: 14px; font-weight: 500; line-height: 22px; }
.deletion-sheet button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -3px; }
@media (min-width: 640px) {
  .bottom-sheet.deletion-sheet { top: 50%; bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%); width: 430px; max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px); padding-bottom: 20px; border-bottom: 1px solid var(--line); border-radius: 18px; }
  .deletion-sheet .sheet-handle { display: none; }
}
@media (max-width: 350px) { .bottom-sheet.deletion-sheet { padding-inline: 16px; } }
.social-login-options { display: grid; gap: 10px; margin-top: 20px; }
.social-login-options[hidden], .apple-login-button-host[hidden] { display: none; }
.apple-login-button-host { height: 48px; min-width: 140px; }
.social-login-options small { color: var(--muted, #666); line-height: 1.5; }
#appleIdentityCopy { line-height: 1.7; margin-bottom: 18px; }
#deleteWithAppleButton { width: 100%; margin: 12px 0; }

/* Score replacement shares the player, but keeps its file workflow independent. */
.score-upload-sheet { padding: 0; display: flex; flex-direction: column; max-height: calc(100dvh - var(--safe-top) - 16px); overflow: hidden; border-radius: 24px 24px 0 0; }
.score-upload-sheet .sheet-handle { flex: none; margin: 9px auto 3px; }
.score-upload-sheet .sheet-heading { flex: none; min-height: 60px; margin: 0; padding: 0 12px 0 22px; }
.score-upload-sheet .sheet-heading h2 { font-size: 18px; }
#scoreImportForm { display: flex; flex-direction: column; min-height: 0; }
.score-upload-body { padding: 0 22px; overflow-y: auto; min-height: 0; }
.score-upload-song { display: flex; gap: 12px; align-items: center; padding: 12px 0 22px; }
.score-upload-song > div { min-width: 0; display: grid; gap: 5px; }
.score-upload-song strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.score-upload-sheet small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.score-upload-song-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-raised, #25292d); color: #d8b56a; }
.score-upload-song-icon svg { width: 20px; height: 20px; }
.score-upload-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.score-upload-label strong { font-size: 14px; }
.score-upload-label small { font-size: 10px; }
.score-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.score-upload-picker { width: 100%; min-height: 166px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px dashed #655942; border-radius: 16px; background: var(--surface-raised, #25292d); color: var(--text); }
.score-upload-picker strong { max-width: 100%; font-size: 14px; overflow-wrap: anywhere; }
.score-upload-picker > span:last-child { color: #d8b56a; font-size: 12px; }
.score-upload-file-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #d8b56a14; color: #d8b56a; }
.score-upload-file-icon svg { width: 24px; height: 24px; }
.score-upload-picker.has-file { border-style: solid; border-color: var(--line); }
.score-upload-pages { max-height: 100px; overflow: auto; font-size: 12px; padding-left: 24px; color: var(--muted); overflow-wrap: anywhere; }
.score-upload-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.score-upload-error { color: #ee9f8d; font-size: 12px; line-height: 1.5; }
.score-upload-alignment { margin-top: 20px; border-top: 1px solid var(--line); }
.score-upload-alignment summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.score-upload-alignment summary::-webkit-details-marker { display: none; }
.score-upload-alignment summary strong { font-size: 14px; font-weight: 500; }
.score-upload-alignment summary span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.score-upload-alignment svg { width: 14px; height: 14px; }
.score-upload-alignment label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.score-upload-alignment input { width: 100%; margin-bottom: 14px; }
.score-upload-footer { flex: none; display: grid; gap: 12px; padding: 14px 22px calc(22px + var(--safe-bottom)); border-top: 1px solid var(--line); text-align: center; }
.score-upload-footer .primary-button { width: 100%; min-height: 48px; border-radius: 14px; }
#importAlignmentButton { margin: 0; width: auto; flex: none; }
@media (min-width: 640px) { .score-upload-sheet { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 430px; border-radius: 24px; max-height: calc(100dvh - 40px); } }

.score-upload-sheet .sheet-heading .icon-button { border: 0; border-radius: 50%; background: transparent; color: var(--muted); }

.score-upload-sheet { bottom: var(--score-upload-viewport-bottom, 0px); max-height: calc(var(--score-upload-viewport-height, 100dvh) - var(--safe-top) - 16px); }
@media (min-width: 640px) { .score-upload-sheet { bottom: auto; top: calc(var(--score-upload-viewport-top, 0px) + var(--score-upload-viewport-height, 100dvh) / 2); max-height: calc(var(--score-upload-viewport-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 32px); } }

.score-upload-pages li { margin-bottom: 6px; }
.score-upload-pages img { width: 32px; height: 42px; object-fit: cover; vertical-align: middle; border-radius: 4px; margin-right: 8px; background: white; }

/* Account input panels retain their navigation and actions above the keyboard. */
#identitySheet, #deleteAccountSheet { display: flex; flex-direction: column; overflow: hidden; }
#identitySheet > .account-heading, #deleteAccountSheet > .account-heading,
#identitySheet > .sheet-handle, #deleteAccountSheet > .sheet-handle { flex: none; }
.account-form-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.account-form-body .sheet-form { margin-bottom: 0; padding-bottom: 2px; }
.account-form-actions { flex: none; padding-top: 14px; }
.account-form-actions > button { width: 100%; min-height: 44px; }
.account-sheet.viewport-compact {
  min-height: 0;
  max-height: calc(var(--account-viewport-height, 100dvh) - max(0px, var(--safe-top) - var(--account-viewport-top, 0px)) - 12px);
  padding-bottom: 18px;
}
.account-sheet.viewport-compact .account-form-actions { padding-top: 10px; }
.account-sheet.viewport-compact .account-form-body .sheet-subtitle { margin-top: 0; }
/* Session-scoped measure editor. Colors and transport follow approved transport-v4. */
#measureFillSheet { max-width: 1040px; top: calc(var(--safe-top) + 24px); bottom: auto; height: auto; background: #24262a; color: #f3f1ed; padding: 16px; }
#measureFillSheet .sheet-heading { margin-bottom: 0; }
#measureFillSheet .sheet-heading h2 { font-size: 20px; }
@media (min-width: 700px) { #measureFillSheet { padding: 24px; width: min(1040px,calc(100vw - 48px)); max-height: calc(100dvh - var(--safe-top) - 48px); transform: translateX(-50%); } }

/* Motion polish: visual feedback only; layout and action timing stay unchanged. */
.view.active, .song-item { animation: none; }
button:not(:disabled) { transition: background-color var(--motion-feedback) ease, color var(--motion-feedback) ease, border-color var(--motion-feedback) ease, filter var(--motion-feedback) ease, scale 110ms var(--motion-ease); }
button:not(:disabled):active { scale: .98; }
.song-item:not(:disabled):active, #continuePracticeButton:not(:disabled):active { scale: .99; }
.app-motion-title { position: fixed; z-index: 20; margin: 0; overflow: hidden; overflow-wrap: anywhere; white-space: normal; pointer-events: none; user-select: none; transform-origin: top left; }
#transportSpeedControls { --motion-enter: 160ms; --motion-exit: 110ms; --motion-shift: 4px; }
.song-progress > span { transition: width 220ms var(--motion-ease); }
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active, .song-item:not(:disabled):active, #continuePracticeButton:not(:disabled):active { scale: 1; }
  .song-progress > span, button:not(:disabled) { transition: none; }
}

/* First experience: additive layer; the ordinary player and sheets retain their geometry. */
.first-experience { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; align-items: center; overflow: auto; padding: calc(20px + env(safe-area-inset-top)) 28px calc(32px + env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 43%, #30291e55, transparent 56%), #121416; color: #f6f1e7; }
.first-experience[hidden], .experience-guide[hidden] { display: none; }
.experience-skip { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #aaa8a3; font-size: 13px; }
.experience-identity { flex: 1; display: flex; min-height: 300px; flex-direction: column; align-items: center; justify-content: center; padding-top: 32px; width: 100%; }
.experience-emblem { position: relative; width: 112px; height: 112px; border-radius: 25px; animation: experience-emblem-in 950ms cubic-bezier(.16,1,.3,1) both; }
.experience-emblem::before { content: ''; position: absolute; inset: -24px; z-index: -1; border-radius: 50%; background: #dfbe7238; filter: blur(35px); animation: experience-halo 1800ms ease-out both; }
.experience-emblem img { display: block; width: 100%; height: 100%; border-radius: inherit; box-shadow: 0 14px 44px #0006; }
.experience-emblem::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 25%, #fff2 47%, transparent 68%); background-size: 300% 100%; animation: experience-sheen 1600ms 120ms ease-out both; pointer-events: none; }
.experience-identity h1 { margin: 25px 0 7px; padding-left: .18em; font-size: 34px; line-height: 1.3; font-weight: 650; letter-spacing: .18em; animation: experience-word-in 700ms 160ms both; }
.experience-wordmark { font-size: 10px; letter-spacing: .3em; padding-left: .3em; color: #bfb7a8; animation: experience-word-in 700ms 260ms both; }
.experience-slogan { margin: 24px 0 30px; padding-left: .08em; font-size: 17px; line-height: 1.6; font-weight: 400; letter-spacing: .08em; color: #e0d9c9; animation: experience-word-in 800ms 380ms both; }
.experience-start-area { display: grid; justify-items: center; gap: 12px; width: min(100%, 296px); flex: 0 0 auto; padding: 20px 0 12px; }
.experience-start-area [role=status] { color: #9f9d95; font-size: 12px; line-height: 20px; margin: 0; }
.experience-primary { position: relative; width: 100%; display: grid; grid-template-columns: 32px minmax(0,1fr) 32px; align-items: center; min-height: 50px; padding: 0 16px; border: 1px solid #dec28c26; border-radius: 13px; background: #dfbb79; color: #29241d; font-size: 15px; font-weight: 650; }
.experience-primary span { grid-column: 2; text-align: center; line-height: 22px; }
.experience-primary svg { grid-column: 3; justify-self: center; width: 18px; height: 18px; }
.experience-primary:disabled { background: #282825; color: #73726c; opacity: 1; }
.experience-retry, .login-example-button { min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: #d8bc81; font-size: 13px; }
.login-example-button { display: block; margin: 4px auto 16px; }
.experience-guide { flex: 0 0 auto; padding: 12px max(16px, calc((100vw - 936px)/2)); background: #25231e; color: #f2eee6; border-bottom: 1px solid #d5b5742b; }
.experience-guide-heading { display: flex; align-items: center; justify-content: space-between; font-size: 11px; line-height: 22px; color: #c4ab7b; }
.experience-guide-heading button { min-height: 32px; padding: 0 4px; border: 0; color: #aeaaa1; background: transparent; font-size: 12px; }
.experience-guide h2 { font-size: 16px; line-height: 24px; margin: 0 0 4px; font-weight: 600; }
.experience-guide p { margin: 0; font-size: 13px; line-height: 21px; color: #bcb7ac; }
.experience-guide-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.experience-guide-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: #aaa69c; font-size: 13px; font-weight: 500; line-height: 20px; }
.experience-guide-actions [data-experience=next] { min-width: 72px; background: #dfbb79; color: #29241d; }
.experience-guide-actions [data-experience=next]:disabled { background: #36332b; color: #a39a87; }
.experience-guide-actions [hidden] { display: none; }
.bottom-sheet > .experience-guide { border: 1px solid #d5b5742b; border-radius: 12px; margin: 8px 0 12px; padding: 10px 14px; }
.experience-target { outline: 2px solid #c5a265 !important; outline-offset: 3px; }
@keyframes experience-emblem-in { from { opacity: 0; transform: translateY(12px) scale(.92); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes experience-word-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes experience-halo { from { opacity: 0; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
@keyframes experience-sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (min-width: 700px) { .experience-guide { display: grid; grid-template-columns: 1fr auto; column-gap: 28px; } .experience-guide-heading { grid-column: 1 / -1; } .experience-guide-actions { margin-top: 0; } .experience-start-area { padding-bottom: 24px; } }
@media (max-height: 500px) and (orientation: landscape) { .experience-identity { min-height: 200px; padding-top: 8px; } .experience-emblem { width: 64px; height: 64px; border-radius: 15px; } .experience-identity h1 { font-size: 24px; margin-top: 10px; } .experience-slogan { margin: 12px 0; } .experience-start-area { padding: 0; gap: 6px; } }
@media (prefers-reduced-motion: reduce) { .experience-emblem, .experience-emblem::before, .experience-emblem::after, .experience-identity h1, .experience-wordmark, .experience-slogan { animation: none; } }

/* Inside a tool the coach stays compact, leaving the original editing grid in focus. */
.bottom-sheet > .experience-guide .experience-guide-content h2,
.bottom-sheet > .experience-guide .experience-guide-actions { display: none; }
.bottom-sheet > .experience-guide { display: block; }

/* One visible deletion entry, separate from opening the song. */
.song-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px; align-items: center; min-width: 0; }
.song-row .song-item { grid-template-columns: 48px minmax(0, 1fr); }
.song-row.ready { border-bottom: 1px solid #ffffff12; }
.song-row .song-item.ready { grid-template-columns: 44px minmax(0, 1fr); border-bottom: 0; }
.song-delete { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; background: transparent; border: 0; border-radius: 8px; color: var(--muted); }
.song-delete svg { width: 18px; height: 18px; }
#subscriptionSheet #billingPracticeButton { justify-content: center; white-space: normal; overflow-wrap: anywhere; }

/* Fourth UX batch: compact labels and contextual information, existing surfaces. */
.player-header > .player-action { flex-direction: column; gap: 1px; padding: 3px 0; }
.player-action svg { width: 18px; height: 18px; }
.player-action > span { font-size: 10px; line-height: 14px; white-space: nowrap; }
.song-item.ready .status-pill.ready { padding: 0; background: transparent; color: var(--muted); }
#scoreImportNotice { flex-wrap: wrap; gap: 0 12px; padding-top: 4px; padding-bottom: 4px; }
#scoreImportNotice details { flex: 1; min-width: 140px; }
#scoreImportNotice summary { min-height: 44px; align-content: center; cursor: pointer; }
#scoreImportNotice details p { margin: 0 0 8px; }
.import-align-action { min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.import-limitation { flex-basis: 100%; margin: 0 0 6px; }
#bindPreferenceEmailButton { width: 100%; }

/* Keep selection recovery beside its version without replacing the list. */
.version-choice-status { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 10px; font-size: 13px; }
.version-choice-status > span { min-width: 0; overflow-wrap: anywhere; }
.version-choice-status .text-button { flex-shrink: 0; min-height: 44px; }

.auth-form-feedback { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.auth-form-feedback.is-error { color: var(--danger); }
.login-form input[aria-invalid="true"], #identityForm input[aria-invalid="true"] { border-color: var(--danger); }
.account-form-actions .auth-form-feedback { margin: 0 0 8px; }

/* Recovery actions stay beside the existing status, with a touch-sized target. */
.inline-recovery { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline-recovery[hidden] { display: none; }
.inline-recovery > span { min-width: 0; }
.inline-recovery > .text-button, #retryDrumlessButton, #retryPlaybackButton { min-width: 44px; min-height: 44px; flex-shrink: 0; }
.transport-tip:has(#retryDrumlessButton:not([hidden])), .transport-tip:has(#retryPlaybackButton:not([hidden])) { display: flex; align-items: center; justify-content: center; gap: 12px; }
.score-upload-footer > .score-upload-error { margin: 0; }
.inline-recovery > .text-button, #retryDrumlessButton, #retryPlaybackButton { color: inherit; font-weight: 600; }
#communicationPreferenceRecovery { margin: -3px 2px 22px; font-size: 12px; line-height: 1.65; color: var(--muted); }
