:root {
  color-scheme: light;
  --bg-main: #f7fbff;
  --bg-soft: #edf9ff;
  --bg-milk: #fffdfb;
  --blue-primary: #8fd7f7;
  --blue-light: #beebfa;
  --blue-pale: #e9f8fe;
  --blue-deep: #4a8fac;
  --blue-ink: #4a6c8c;
  --pink-soft: #f7c6d5;
  --pink-pale: #fff0f5;
  --pink-deep: #c97893;
  --text-main: #445a68;
  --text-secondary: #8196a3;
  --text-faint: #a6b7c1;
  --card-bg: rgba(255, 255, 255, 0.9);
  --border-soft: #d8eff8;
  --border-strong: #bfe5f5;
  --danger: #bd6075;
  --warning: #a17125;
  --shadow-soft: 0 10px 30px rgba(90, 170, 210, 0.1);
  --shadow-card: 0 18px 48px rgba(90, 170, 210, 0.12);
  --radius-card: 28px;
  --radius-small-card: 18px;
  --radius-button: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-main);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 255, 255, 0.98) 0 8%, transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(190, 235, 250, 0.38) 0 10%, transparent 31%),
    linear-gradient(180deg, var(--bg-main) 0%, #f1fbff 46%, var(--bg-milk) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(143, 215, 247, 0.42);
  outline-offset: 3px;
}

svg {
  display: block;
}

button svg,
.eyebrow svg,
.mascot-greeting svg,
.ambient-note,
.share-symbol svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient-sky {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-cloud {
  position: absolute;
  width: 118px;
  height: 34px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(216, 239, 248, 0.7);
  border-radius: 999px;
  filter: blur(0.2px);
}

.ambient-cloud::before,
.ambient-cloud::after {
  position: absolute;
  content: "";
  background: inherit;
  border: inherit;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.ambient-cloud::before {
  width: 44px;
  height: 40px;
  left: 20px;
  bottom: 12px;
}

.ambient-cloud::after {
  width: 58px;
  height: 52px;
  right: 16px;
  bottom: 11px;
}

.ambient-cloud-one {
  top: 13%;
  left: -42px;
  transform: scale(1.2);
  opacity: 0.42;
}

.ambient-cloud-two {
  right: -44px;
  bottom: 18%;
  transform: scale(0.86);
  opacity: 0.34;
}

.ambient-bubble {
  position: absolute;
  border: 1px solid rgba(143, 215, 247, 0.22);
  border-radius: 50%;
}

.ambient-bubble-one {
  top: 36%;
  right: 5%;
  width: 74px;
  height: 74px;
}

.ambient-bubble-two {
  bottom: 9%;
  left: 7%;
  width: 42px;
  height: 42px;
  box-shadow: 22px -20px 0 -13px rgba(247, 198, 213, 0.15);
}

.ambient-note {
  position: absolute;
  width: 26px;
  height: 26px;
  color: rgba(74, 143, 172, 0.13);
}

.ambient-note-one {
  top: 24%;
  right: 9%;
  transform: rotate(8deg);
}

.ambient-note-two {
  left: 8%;
  bottom: 28%;
  width: 21px;
  height: 21px;
  color: rgba(247, 198, 213, 0.25);
  transform: rotate(-11deg);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  padding-top: var(--safe-top);
}

.topbar {
  position: sticky;
  z-index: 40;
  top: calc(8px + var(--safe-top));
  display: flex;
  min-height: 62px;
  margin: 8px 16px 0;
  padding: 9px 10px;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(216, 239, 248, 0.92);
  border-radius: 24px;
  box-shadow: 0 8px 26px rgba(90, 170, 210, 0.08);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.brand {
  display: inline-flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  color: var(--blue-ink);
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 760;
  letter-spacing: 0.05em;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(216, 239, 248, 0.96);
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(90, 170, 210, 0.09);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.quiet-button,
.icon-button,
.chip-button,
.text-button,
.danger-text-button,
.add-note-button,
.stepper-button,
.note-kind-group button,
.duration-group button,
.recent-item {
  appearance: none;
  -webkit-appearance: none;
}

.quiet-button {
  display: inline-flex;
  min-height: 40px;
  padding: 8px 13px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--blue-deep);
  background: rgba(237, 249, 255, 0.82);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 680;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.quiet-button svg {
  width: 17px;
  height: 17px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--blue-ink);
  background: rgba(237, 249, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  transition: transform 180ms ease, background 180ms ease;
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.view {
  width: 100%;
  padding: 30px 18px calc(42px + var(--safe-bottom));
  animation: view-in 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(126px, 156px);
  gap: 8px;
  align-items: center;
}

.intro-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.eyebrow,
.step-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  color: var(--blue-deep);
  background: linear-gradient(110deg, rgba(255, 240, 245, 0.96), rgba(233, 248, 254, 0.96));
  border: 1px solid rgba(216, 239, 248, 0.9);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow {
  min-height: 30px;
  padding: 5px 11px;
}

.eyebrow svg {
  width: 16px;
  height: 16px;
  color: #72c5e9;
}

.step-label {
  min-height: 27px;
  padding: 4px 10px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  color: var(--text-main);
}

.intro-copy h1 {
  max-width: 5.6em;
  margin: 14px 0 12px;
  font-size: clamp(2.35rem, 11vw, 3.65rem);
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.intro-copy h1 span {
  display: block;
  margin-top: 4px;
  color: var(--blue-deep);
}

.intro-block p,
.page-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.72;
}

.mascot-welcome {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 184px;
  margin: 0;
  place-items: center;
  isolation: isolate;
}

.character-halo {
  position: absolute;
  z-index: -1;
  inset: 2px -3px 3px;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.94) 0 8%, transparent 9%),
    radial-gradient(circle at 22% 76%, rgba(247, 198, 213, 0.38) 0 7%, transparent 8%),
    linear-gradient(145deg, #64bde4, #8fd7f7);
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 48% 52% 46% 54% / 53% 47% 55% 45%;
  box-shadow: 0 14px 36px rgba(90, 170, 210, 0.09);
}

.hero-mascot {
  display: block;
  width: min(100%, 156px);
  height: auto;
  object-fit: contain;
  clip-path: ellipse(49% 49% at 50% 50%);
  mix-blend-mode: screen;
  filter: saturate(1.18) contrast(1.06);
  animation: character-float 5.6s ease-in-out infinite;
}

.mascot-greeting {
  position: absolute;
  right: 2px;
  bottom: -2px;
  display: inline-flex;
  min-height: 30px;
  padding: 6px 10px;
  align-items: center;
  gap: 5px;
  color: var(--blue-deep);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(90, 170, 210, 0.08);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.mascot-greeting svg {
  width: 14px;
  height: 14px;
}

.mascot-sparkle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--pink-soft);
  border-radius: 2px;
  transform: rotate(45deg);
  animation: sparkle-pulse 3.8s ease-in-out infinite;
}

.mascot-sparkle::after {
  position: absolute;
  inset: 3px;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.sparkle-one {
  top: 17px;
  right: 5px;
}

.sparkle-two {
  bottom: 34px;
  left: 5px;
  width: 7px;
  height: 7px;
  background: var(--blue-primary);
  animation-delay: -1.8s;
}

@keyframes character-float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-5px) rotate(0.4deg); }
}

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.48; transform: rotate(45deg) scale(0.85); }
  50% { opacity: 0.95; transform: rotate(45deg) scale(1.14); }
}

.capture-card {
  position: relative;
  margin-top: 24px;
  padding: 23px 19px 18px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid rgba(191, 229, 245, 0.92);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.capture-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 118px;
  height: 76px;
  content: "";
  background:
    radial-gradient(circle at 30% 50%, rgba(190, 235, 250, 0.54) 0 30%, transparent 31%),
    radial-gradient(circle at 64% 54%, rgba(247, 198, 213, 0.25) 0 28%, transparent 29%);
  opacity: 0.62;
  transform: rotate(-12deg);
  pointer-events: none;
}

.capture-card > * {
  position: relative;
  z-index: 1;
}

.staff-paper::before {
  position: absolute;
  z-index: 0;
  top: 19px;
  right: 18px;
  width: 82px;
  height: 29px;
  content: "";
  background: repeating-linear-gradient(to bottom, rgba(143, 215, 247, 0.18) 0 1px, transparent 1px 7px);
  mask-image: linear-gradient(to left, #000, transparent);
  -webkit-mask-image: linear-gradient(to left, #000, transparent);
  pointer-events: none;
}

.capture-card-intro {
  display: flex;
  margin-bottom: 19px;
  align-items: center;
  gap: 12px;
}

.capture-card-intro > div:last-child {
  min-width: 0;
}

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

.capture-card-intro strong {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 760;
}

.capture-card-intro span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.capture-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--blue-deep);
  background: linear-gradient(145deg, #fff, var(--blue-pale));
  border: 1px solid var(--border-soft);
  border-radius: 17px;
  box-shadow: 0 6px 18px rgba(90, 170, 210, 0.08);
}

.capture-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  padding: 12px 18px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-button);
  font-size: 0.98rem;
  font-weight: 720;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.musicxml-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  padding: 11px 16px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--blue-deep);
  background: rgba(247, 252, 255, 0.84);
  border: 1px dashed #9bd7ee;
  border-radius: var(--radius-button);
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.musicxml-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.musicxml-button span,
.musicxml-button strong,
.musicxml-button small {
  display: block;
}

.musicxml-button strong {
  font-size: 0.93rem;
}

.musicxml-button small {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
}

.primary-button svg,
.secondary-button svg,
.result-actions svg,
.add-note-button svg {
  width: 21px;
  height: 21px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #9cdef8 0%, #79c9ef 58%, #70bee6 100%);
  border: 1px solid rgba(91, 178, 220, 0.25);
  box-shadow: 0 10px 24px rgba(93, 185, 227, 0.2);
  text-shadow: 0 1px 1px rgba(74, 143, 172, 0.12);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary-button {
  color: var(--blue-ink);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-strong);
  box-shadow: 0 7px 20px rgba(90, 170, 210, 0.06);
}

.large-button {
  width: 100%;
  min-height: 66px;
}

.capture-card .large-button + .large-button {
  margin-top: 14px;
}

.text-button {
  display: inline-flex;
  min-height: 42px;
  padding: 8px 10px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--blue-deep);
  background: transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 680;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.sample-button {
  width: fit-content;
  margin: 10px auto 2px;
}

.sample-button svg {
  width: 16px;
  height: 16px;
  color: #e9a6bf;
}

.text-button.compact {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 0.8rem;
}

.privacy-note {
  display: flex;
  margin: 4px 0 0;
  padding: 11px 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #668b9c;
  background: rgba(237, 249, 255, 0.7);
  border: 1px solid rgba(216, 239, 248, 0.9);
  border-radius: 16px;
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: left;
}

.privacy-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: #62bad9;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recent-section {
  margin-top: 30px;
}

.section-heading {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

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

.recent-item {
  display: flex;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small-card);
  box-shadow: 0 7px 22px rgba(90, 170, 210, 0.06);
  transition: transform 180ms ease, border-color 180ms ease;
}

.recent-item .mini-score {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--blue-deep);
  background: linear-gradient(145deg, var(--blue-pale), var(--pink-pale));
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  font-family: "Arial Rounded MT Bold", "PingFang SC", sans-serif;
  font-size: 1.18rem;
}

.recent-item-copy {
  min-width: 0;
  flex: 1;
}

.recent-item strong,
.recent-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.recent-arrow {
  color: var(--text-faint);
  font-size: 1.2rem;
}

.site-footer {
  display: flex;
  margin-top: 32px;
  padding: 16px 4px 2px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
}

.footer-mark {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
}

.footer-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: var(--blue-ink);
  font-size: 0.8rem;
}

.site-footer div > span {
  margin-top: 2px;
  font-size: 0.7rem;
  line-height: 1.45;
}

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

.page-heading h1,
.result-heading h1 {
  margin: 9px 0 5px;
  font-size: clamp(2rem, 8vw, 2.65rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.preview-card,
.title-card,
.notation-card,
.editor-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.preview-card {
  overflow: hidden;
}

.preview-frame {
  display: grid;
  min-height: 276px;
  max-height: 54vh;
  padding: 15px;
  place-items: center;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(216, 239, 248, 0.36) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(216, 239, 248, 0.36) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(216, 239, 248, 0.36) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(216, 239, 248, 0.36) 75%),
    #f9fdff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.preview-frame canvas {
  display: block;
  max-width: 100%;
  max-height: calc(54vh - 30px);
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 12px 34px rgba(68, 90, 104, 0.14);
}

.preview-meta {
  display: flex;
  padding: 15px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-meta > div:first-child {
  min-width: 0;
}

.preview-meta strong,
.preview-meta span {
  display: block;
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta strong {
  font-size: 0.9rem;
}

.preview-meta span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.inline-actions {
  display: flex;
  gap: 6px;
}

.chip-button {
  display: inline-flex;
  min-height: 40px;
  padding: 8px 11px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--blue-deep);
  background: var(--blue-pale);
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  font-size: 0.78rem;
  font-weight: 680;
  transition: transform 180ms ease, background 180ms ease;
}

.chip-button svg {
  width: 17px;
  height: 17px;
}

.recognition-settings {
  margin-top: 15px;
  padding: 17px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small-card);
  box-shadow: 0 8px 26px rgba(90, 170, 210, 0.07);
}

.settings-heading {
  display: flex;
  margin-bottom: 13px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.settings-heading strong {
  color: var(--text-main);
  font-size: 0.9rem;
}

.settings-heading span {
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-align: right;
}

.recognition-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.recognition-settings label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 680;
}

.recognition-settings select {
  width: 100%;
  min-height: 44px;
  padding: 8px 27px 8px 10px;
  color: var(--text-main);
  background-color: #f7fcff;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  font-size: 0.8rem;
  font-weight: 680;
}

.recognition-tip {
  display: flex;
  margin: 16px 0;
  padding: 13px 14px;
  align-items: center;
  gap: 12px;
  color: #58798a;
  background: linear-gradient(135deg, rgba(237, 249, 255, 0.9), rgba(255, 240, 245, 0.72));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small-card);
}

.tip-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(216, 239, 248, 0.96);
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(90, 170, 210, 0.08);
}

.tip-symbol img {
  display: block;
  width: 100%;
  height: 100%;
}

.recognition-tip p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.56;
}

.sticky-action {
  position: sticky;
  z-index: 12;
  bottom: calc(12px + var(--safe-bottom));
  width: 100%;
  min-height: 60px;
}

.progress-card {
  position: relative;
  margin-top: 16px;
  padding: 20px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(237, 249, 255, 0.88));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.progress-mascot {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 11px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
}

.progress-card p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.scan-animation {
  position: relative;
  width: 100%;
  height: 5px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--blue-pale);
  border-radius: 999px;
}

.scan-animation span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, #73c8ec, transparent);
  animation: scan 1.2s ease-in-out infinite;
}

@keyframes scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(365%); }
}

.result-view {
  padding-bottom: calc(126px + var(--safe-bottom));
}

.result-heading {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.result-heading .step-label {
  margin-bottom: 1px;
}

.more-button {
  color: var(--blue-deep);
  background: var(--blue-pale);
}

.title-card {
  padding: 18px;
}

.title-card > label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 680;
}

#scoreTitle {
  width: 100%;
  padding: 3px 0 11px;
  color: var(--text-main);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  font-size: 1.18rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.score-settings {
  display: flex;
  margin-top: 13px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.score-settings label,
.setting-pill {
  display: inline-flex;
  min-height: 35px;
  padding: 6px 11px;
  align-items: center;
  color: #587081;
  background: var(--blue-pale);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.78rem;
}

.score-settings label {
  gap: 5px;
}

.score-settings select {
  padding: 0;
  color: var(--text-main);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.confidence-banner {
  display: flex;
  margin: 14px 0;
  padding: 14px;
  align-items: center;
  gap: 13px;
  color: #58798a;
  background: linear-gradient(135deg, rgba(233, 248, 254, 0.92), rgba(255, 240, 245, 0.72));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small-card);
}

.confidence-banner.warning {
  color: #7b6030;
  background: #fff9eb;
  border-color: #f1e1ba;
}

.confidence-ring {
  --confidence: 0deg;
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(#72c7e4 var(--confidence), rgba(143, 215, 247, 0.18) 0);
  border-radius: 50%;
}

.confidence-ring::before {
  position: absolute;
  inset: 5px;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.confidence-ring span {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 800;
}

.confidence-banner p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.56;
}

.conversion-report {
  margin: 14px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small-card);
  box-shadow: 0 8px 26px rgba(90, 170, 210, 0.07);
}

.report-heading {
  margin-bottom: 12px;
  align-items: center;
}

.report-heading h2 {
  margin: 2px 0 0;
  color: var(--text-main);
  font-size: 1rem;
}

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

.report-item {
  min-width: 0;
  padding: 9px 10px;
  background: var(--blue-pale);
  border: 1px solid rgba(216, 239, 248, 0.9);
  border-radius: 13px;
}

.report-item span,
.report-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-item span {
  color: var(--text-secondary);
  font-size: 0.65rem;
}

.report-item strong {
  margin-top: 3px;
  color: var(--text-main);
  font-size: 0.8rem;
}

.report-warning-summary {
  margin: 11px 1px 0;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.55;
}

.notation-card {
  padding: 17px;
}

.notation-heading {
  margin-bottom: 11px;
}

.notation-heading span {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.notation-sheet {
  min-height: 166px;
  padding: 23px 10px;
  overflow-x: auto;
  background:
    repeating-linear-gradient(to bottom, transparent 0 28px, rgba(143, 215, 247, 0.08) 28px 29px),
    #fbfeff;
  border: 1px solid rgba(216, 239, 248, 0.86);
  border-radius: 16px;
}

.measure-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px 4px;
}

.measure {
  display: inline-flex;
  min-height: 70px;
  padding: 12px 8px;
  align-items: center;
  gap: 4px;
  border-right: 1px solid #aebcc6;
}

.measure:first-child {
  border-left: 1px solid #aebcc6;
}

.note-button {
  position: relative;
  display: inline-grid;
  min-width: 38px;
  min-height: 48px;
  padding: 7px 5px 9px;
  place-items: center;
  color: #334a59;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.note-button.selected {
  color: var(--blue-deep);
  background: linear-gradient(145deg, var(--blue-pale), var(--pink-pale));
  border-color: var(--border-strong);
}

.note-button.playing {
  color: #fff;
  background: #7ccbed;
  box-shadow: 0 6px 16px rgba(90, 170, 210, 0.2);
}

.note-symbol {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font-family: "SF Pro Rounded", "Arial Rounded MT Bold", "PingFang SC", sans-serif;
  font-size: 1.5rem;
  font-weight: 760;
  line-height: 1;
}

.note-accidental {
  margin-right: 1px;
  font-size: 0.7rem;
  font-weight: 700;
}

.octave-dots {
  position: absolute;
  left: 50%;
  display: flex;
  gap: 2px;
  transform: translateX(-50%);
  font-size: 0.6rem;
  letter-spacing: 0;
}

.octave-dots.high { top: -11px; }
.octave-dots.low { bottom: -13px; }

.duration-tail {
  margin-left: 3px;
  color: currentColor;
  font-size: 0.92rem;
  letter-spacing: -0.14em;
}

.note-button.half-beat::after {
  position: absolute;
  right: 9px;
  bottom: 8px;
  left: 9px;
  height: 1px;
  content: "";
  background: currentColor;
}

.note-button.sixteenth-beat::before,
.note-button.sixteenth-beat::after {
  position: absolute;
  right: 9px;
  left: 9px;
  height: 1px;
  content: "";
  background: currentColor;
}

.note-button.sixteenth-beat::before { bottom: 11px; }
.note-button.sixteenth-beat::after { bottom: 7px; }

.note-button.dotted .note-symbol::after {
  margin-left: 4px;
  content: "\00b7";
  font-size: 0.82rem;
  font-weight: 800;
}

.note-button.rest .note-symbol {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
}

.note-button.chord-note {
  min-width: 62px;
}

.note-button.chord-note .note-symbol {
  font-size: 1.04rem;
  white-space: nowrap;
}

.event-mark {
  position: absolute;
  top: 1px;
  right: 2px;
  color: var(--pink-deep);
  font-size: 0.56rem;
  font-weight: 800;
}

.tuplet-mark {
  position: absolute;
  top: -2px;
  left: 50%;
  color: var(--blue-deep);
  font-size: 0.55rem;
  font-weight: 750;
  transform: translateX(-50%);
}

.editor-card {
  margin-top: 14px;
  padding: 18px;
}

.editor-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-caption {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

#selectedNoteLabel {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
}

.danger-text-button {
  min-height: 40px;
  padding: 8px 10px;
  color: var(--danger);
  background: rgba(255, 240, 245, 0.72);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 680;
}

.pitch-control {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  margin-top: 15px;
  align-items: center;
  gap: 10px;
}

.stepper-button {
  height: 50px;
  color: var(--blue-deep);
  background: var(--blue-pale);
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  font-size: 1.45rem;
  transition: transform 150ms ease, background 150ms ease;
}

.pitch-display {
  display: grid;
  height: 50px;
  place-items: center;
  color: var(--text-main);
  background: #fbfeff;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  font-family: "SF Pro Rounded", "Arial Rounded MT Bold", sans-serif;
  font-size: 1.5rem;
  font-weight: 760;
}

.pitch-control.disabled {
  opacity: 0.42;
}

.note-kind-group,
.duration-group {
  display: grid;
  margin-top: 13px;
  gap: 7px;
}

.note-kind-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.duration-group {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.note-kind-group button,
.duration-group button {
  min-height: 42px;
  padding: 7px 4px;
  color: #5e7380;
  background: #f8fcfe;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  font-size: 0.78rem;
  font-weight: 650;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease;
}

.note-kind-group button.active,
.duration-group button.active {
  color: var(--blue-deep);
  background: linear-gradient(145deg, var(--blue-pale), var(--pink-pale));
  border-color: var(--border-strong);
}

.add-note-button {
  display: inline-flex;
  min-height: 44px;
  margin-top: 9px;
  padding: 7px 5px;
  align-items: center;
  gap: 6px;
  color: var(--blue-deep);
  background: transparent;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 680;
}

.diagnostic-button {
  display: inline-flex;
  min-height: 42px;
  margin-top: 4px;
  padding: 7px 9px;
  align-items: center;
  gap: 6px;
  color: #5b7f91;
  background: transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 680;
}

.diagnostic-button svg {
  width: 18px;
  height: 18px;
}

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

.player-bar {
  position: fixed;
  z-index: 30;
  right: max(12px, calc((100vw - 760px) / 2 + 12px));
  bottom: calc(12px + var(--safe-bottom));
  left: max(12px, calc((100vw - 760px) / 2 + 12px));
  display: grid;
  grid-template-columns: 54px auto 1fr;
  min-height: 74px;
  padding: 9px 14px 9px 9px;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: rgba(74, 108, 140, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(74, 108, 140, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.play-button {
  display: grid;
  width: 54px;
  height: 54px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: #83d2f2;
  border-radius: 18px;
}

.play-button svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: currentColor;
}

.play-button .stop-icon,
.play-button.playing .play-icon {
  display: none;
}

.play-button.playing .stop-icon {
  display: block;
}

.player-copy {
  min-width: 82px;
}

.player-copy strong,
.player-copy span {
  display: block;
}

.player-copy strong {
  font-size: 0.84rem;
}

.player-copy span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
}

#tempoSlider {
  width: 100%;
  accent-color: var(--pink-soft);
}

dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 25px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 80px rgba(74, 108, 140, 0.22);
}

dialog::backdrop {
  background: rgba(68, 90, 104, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--text-secondary);
  background: var(--blue-pale);
  border-radius: 50%;
  font-size: 1.4rem;
}

.dialog-icon,
.message-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 17px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--blue-primary);
  border: 1px solid var(--border-soft);
  border-radius: 19px;
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.dialog-icon img {
  display: block;
  width: 100%;
  height: 100%;
}

dialog h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.install-dialog ol {
  margin: 0 0 20px;
  padding-left: 24px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.install-dialog li + li {
  margin-top: 8px;
}

.install-dialog .primary-button {
  width: 100%;
}

.share-symbol {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-left: 3px;
  place-items: center;
  vertical-align: middle;
  color: var(--blue-deep);
  background: var(--blue-pale);
  border-radius: 8px;
}

.share-symbol svg {
  width: 15px;
  height: 15px;
}

.message-dialog p {
  color: var(--text-secondary);
  line-height: 1.65;
}

.diagnostic-lead,
.key-resolution-dialog > p {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.62;
}

.diagnostic-content {
  display: grid;
  max-height: min(54vh, 460px);
  margin: 16px 0;
  overflow: auto;
  gap: 8px;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  padding: 9px 10px;
  gap: 10px;
  background: var(--blue-pale);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  font-size: 0.76rem;
}

.diagnostic-row dt {
  color: var(--text-secondary);
}

.diagnostic-row dd {
  margin: 0;
  color: var(--text-main);
  font-weight: 700;
  word-break: break-word;
}

.diagnostic-icon {
  font-family: Georgia, serif;
}

.dialog-full-button {
  width: 100%;
}

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

.key-resolution-fields label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 680;
}

.key-resolution-fields select {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--text-main);
  background: var(--blue-pale);
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  font-weight: 700;
}

.message-icon {
  color: var(--warning);
  background: #fff9eb;
  border-color: #f1e1ba;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
  gap: 9px;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: calc(104px + var(--safe-bottom));
  left: 20px;
  width: max-content;
  max-width: calc(100% - 40px);
  margin: auto;
  padding: 11px 16px;
  color: #fff;
  background: rgba(74, 108, 140, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(74, 108, 140, 0.18);
  font-size: 0.84rem;
  font-weight: 650;
  animation: toast-in 180ms ease-out both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) {
  .primary-button:hover,
  .secondary-button:hover,
  .musicxml-button:hover,
  .quiet-button:hover,
  .icon-button:hover,
  .chip-button:hover,
  .text-button:hover,
  .recent-item:hover {
    transform: translateY(-2px);
  }

  .primary-button:hover {
    box-shadow: 0 13px 28px rgba(93, 185, 227, 0.24);
  }

  .secondary-button:hover,
  .recent-item:hover {
    border-color: #acdff3;
  }

  .musicxml-button:hover {
    background: #fff;
    border-color: #7ccbed;
  }

  .text-button:hover {
    color: #397f9d;
    background: rgba(237, 249, 255, 0.7);
  }
}

.primary-button:active,
.secondary-button:active,
.musicxml-button:active,
.quiet-button:active,
.icon-button:active,
.chip-button:active,
.text-button:active,
.recent-item:active,
.stepper-button:active,
.note-kind-group button:active,
.duration-group button:active {
  transform: scale(0.98);
}

@media (min-width: 700px) {
  .topbar {
    margin-right: 0;
    margin-left: 0;
  }

  .view {
    padding: 44px 0 calc(54px + var(--safe-bottom));
  }

  .intro-block {
    grid-template-columns: minmax(0, 1fr) 226px;
    gap: 34px;
    min-height: 262px;
  }

  .intro-copy h1 {
    max-width: none;
    margin-top: 17px;
    font-size: 4rem;
  }

  .mascot-welcome {
    min-height: 248px;
  }

  .hero-mascot {
    width: 226px;
  }

  .mascot-greeting {
    right: 12px;
    bottom: 4px;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.72rem;
  }

  .capture-card {
    margin-top: 26px;
    padding: 27px 28px 23px;
  }

  .capture-card-intro {
    margin-bottom: 21px;
  }

  .site-footer {
    margin-top: 40px;
  }

  .preview-meta strong,
  .preview-meta span {
    max-width: 460px;
  }

  .title-card,
  .notation-card,
  .editor-card {
    padding: 21px;
  }
}

@media (max-width: 430px) {
  .install-button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .view {
    padding-right: 16px;
    padding-left: 16px;
  }

  .intro-block {
    grid-template-columns: minmax(0, 1fr) minmax(122px, 148px);
  }

  .intro-copy h1 {
    font-size: clamp(2.2rem, 11.2vw, 2.85rem);
  }

  .hero-mascot {
    width: min(100%, 148px);
  }

  .capture-card {
    padding-right: 17px;
    padding-left: 17px;
  }
}

@media (max-width: 390px) {
  .topbar {
    margin-right: 12px;
    margin-left: 12px;
  }

  .install-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .install-button {
    width: 40px;
    padding: 0;
  }

  .intro-block {
    grid-template-columns: minmax(0, 1fr) 122px;
    gap: 3px;
  }

  .mascot-welcome {
    min-height: 156px;
  }

  .hero-mascot {
    width: 122px;
  }

  .mascot-greeting {
    display: none;
  }

  .eyebrow {
    padding: 5px 9px;
    font-size: 0.68rem;
  }

  .capture-card-intro span {
    font-size: 0.7rem;
  }

  .recognition-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-meta {
    align-items: flex-start;
  }

  .inline-actions {
    flex-direction: column;
  }

  .duration-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .player-bar {
    grid-template-columns: 52px 84px 1fr;
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 350px) {
  .intro-block {
    grid-template-columns: 1fr 106px;
  }

  .intro-copy h1 {
    font-size: 2rem;
  }

  .mascot-welcome {
    min-height: 142px;
  }

  .hero-mascot {
    width: 106px;
  }

  .privacy-note {
    align-items: flex-start;
  }

  .settings-heading {
    display: block;
  }

  .settings-heading span {
    display: block;
    margin-top: 3px;
    text-align: left;
  }

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

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