:root {
  --paper: #fffdf7;
  --cream: #fff5e4;
  --cream-deep: #f9e8cc;
  --ink: #363442;
  --ink-soft: #756f80;
  --line: #e9ddc9;
  --coral: #ff7e68;
  --coral-deep: #e85f4b;
  --coral-soft: #ffe0d8;
  --mint: #55c7a8;
  --mint-deep: #2f9d82;
  --mint-soft: #d9f5ec;
  --sun: #ffc857;
  --sun-soft: #fff0c9;
  --sky: #77b9e7;
  --sky-soft: #def0fc;
  --lav: #b79cf0;
  --lav-soft: #efe7ff;
  --shadow-lg: 0 26px 60px rgba(78, 59, 84, 0.14);
  --shadow-md: 0 14px 34px rgba(78, 59, 84, 0.12);
  --shadow-sm: 0 6px 16px rgba(78, 59, 84, 0.1);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --font-body: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-fun: "MusicLab-CN", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-num: "MusicLab-Num", "Nunito", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 8% -6%, #ffe9d2 0%, transparent 60%),
    radial-gradient(900px 600px at 98% 8%, #e2f4ff 0%, transparent 55%),
    radial-gradient(900px 700px at 50% 110%, #ffe8ef 0%, transparent 60%),
    var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(120, 95, 70, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 60%);
}

button, input { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---------- background decor ---------- */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(6px); opacity: .55; }
.b1 { width: 230px; height: 230px; background: #ffe1a8; top: 12%; left: -80px; }
.b2 { width: 320px; height: 320px; background: #d8f2ea; bottom: -120px; right: -80px; }
.b3 { width: 180px; height: 180px; background: #ffe1e6; top: 45%; right: 6%; opacity: .45; }
.float-note { position: absolute; font-size: 30px; color: rgba(120, 100, 140, .18); animation: float 7s ease-in-out infinite; }
.n1 { top: 18%; left: 6%; transform: rotate(-12deg); }
.n2 { top: 34%; right: 8%; animation-delay: -2s; font-size: 42px; }
.n3 { bottom: 18%; left: 10%; animation-delay: -4s; font-size: 36px; }
.n4 { top: 66%; right: 22%; animation-delay: -1s; font-size: 24px; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-18px) rotate(6deg); }
}

/* ---------- shell ---------- */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(145deg, #fff, #ffe9d9);
  color: var(--coral);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}
.brand-icon svg { width: 26px; height: 26px; }
.brand-text { font-family: var(--font-fun); font-size: 21px; letter-spacing: .5px; }
.ghost-btn {
  border: 2px solid rgba(54, 52, 66, .1);
  background: rgba(255, 255, 255, .6);
  color: var(--ink-soft);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  transition: .2s;
  backdrop-filter: blur(6px);
}
.ghost-btn:hover { background: #fff; color: var(--ink); border-color: rgba(54,52,66,.2); }

.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 10px 28px 40px; }
.footer {
  position: relative; z-index: 0;
  text-align: center; color: #9c94a0; font-size: 12px; padding: 12px 20px 40px;
}
.footer-dot { margin: 0 8px; }

/* ---------- welcome ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 42px;
  align-items: center;
  padding: 34px 0 18px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px; padding: 8px 15px;
  background: rgba(255, 255, 255, .7);
  border: 1.5px solid rgba(255, 126, 104, .25);
  border-radius: 999px;
  color: var(--coral-deep);
  font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.eyebrow span { font-size: 16px; }
.hero h1 {
  font-family: var(--font-fun);
  font-size: clamp(40px, 5.1vw, 62px);
  line-height: 1.16;
  margin: 0 0 20px;
  letter-spacing: .5px;
  font-weight: 400;
}
.hero h1 em {
  position: relative;
  font-style: normal;
  color: var(--coral-deep);
  white-space: nowrap;
}
.hero h1 em::after {
  content: "";
  position: absolute; left: -4px; right: -4px; bottom: 2px; height: 14px;
  background: rgba(255, 200, 87, .55);
  border-radius: 8px;
  z-index: -1;
  transform: rotate(-1deg);
}
.lede { font-size: 17px; line-height: 1.85; color: var(--ink-soft); margin: 0 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; }
.btn {
  border: 0;
  border-radius: 18px;
  padding: 16px 26px;
  font-size: 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s;
  white-space: nowrap;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:active { transform: translateY(2px) scale(.99); }
.btn-primary {
  background: linear-gradient(160deg, #ff927d, var(--coral));
  color: #fff;
  box-shadow: 0 12px 26px rgba(232, 95, 75, .32), inset 0 -3px 0 rgba(160, 50, 35, .18);
}
.btn-primary:hover { background: linear-gradient(160deg, #ffa08d, #ff715a); box-shadow: 0 16px 32px rgba(232, 95, 75, .38); transform: translateY(-2px); }
.btn-mint {
  background: #fff;
  color: var(--mint-deep);
  box-shadow: var(--shadow-sm), inset 0 0 0 2px rgba(85, 199, 168, .35);
}
.btn-mint:hover { background: #f4fffb; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-danger {
  background: #fff3f1;
  color: #cd4d3c;
  box-shadow: inset 0 0 0 2px rgba(232, 95, 75, .22);
}
.btn-danger:hover { background: #ffe7e2; }
.btn-wide { width: 100%; padding: 18px; font-size: 19px; border-radius: 20px; }
.text-link {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 20px;
  background: none; border: 0; padding: 4px 2px;
  color: var(--ink-soft); font-size: 15px; font-weight: 700;
  border-bottom: 2px dashed rgba(117, 111, 128, .35);
}
.text-link span { transition: transform .2s; color: var(--coral); }
.text-link:hover { color: var(--ink); }
.text-link:hover span { transform: translateX(4px); }
.privacy {
  display: flex; align-items: center; gap: 7px;
  margin: 22px 0 0; color: #9a929f; font-size: 13px;
}
.privacy svg { width: 16px; height: 16px; flex: none; }

/* hero art */
.hero-art { position: relative; min-height: 470px; display: flex; align-items: center; justify-content: center; }
.paper-stack { position: relative; transform: rotate(-4deg); z-index: 2; animation: paperBob 6s ease-in-out infinite; }
.paper-card {
  position: relative;
  width: 350px; min-height: 300px;
  background: var(--paper);
  border-radius: 18px;
  padding: 30px 26px 26px;
  box-shadow: 0 30px 60px rgba(92, 70, 84, .18), 0 4px 0 #eadfce;
  border: 1px solid #f0e5d2;
  overflow: hidden;
}
.paper-pin {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(3deg);
  width: 90px; height: 28px; background: rgba(255, 200, 87, .7); border-radius: 4px;
}
.paper-title { font-family: var(--font-fun); font-size: 20px; color: #9a8e7a; margin: 0 0 20px; text-align: center; letter-spacing: 2px; }
.paper-line { display: flex; align-items: center; gap: 14px; height: 74px; position: relative; }
.paper-line.faded { opacity: .55; }
.mini-glyph {
  position: relative;
  font-family: var(--font-num);
  font-size: 40px; line-height: 1; color: #4b4855;
  min-width: 26px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
}
.mini-glyph b { font-weight: 600; }
.mini-glyph .dot {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: #4b4855; top: -8px; left: 50%; transform: translateX(-50%);
}
.mini-glyph .dot.low { top: auto; bottom: -4px; }
.mini-glyph .aug {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #4b4855; right: -12px; top: 50%; transform: translateY(-50%);
}
.mini-glyph .under {
  position: absolute; left: 2px; right: 2px; bottom: 4px; height: 3px;
  background: #4b4855; border-radius: 2px;
}
.mini-glyph .dash {
  position: absolute; left: 34px; top: 50%; width: 26px; height: 3px;
  background: #4b4855; border-radius: 2px;
}
.mini-bar { width: 3px; height: 50px; background: #4b4855; border-radius: 2px; margin: 0 2px; opacity: .7; }
.paper-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0 47px, rgba(160, 190, 220, .18) 47px 48px);
}
.mascot { position: absolute; width: 260px; right: -28px; bottom: -18px; z-index: 3; filter: drop-shadow(0 18px 22px rgba(80, 60, 70, .16)); }
.mascot-bob { animation: mascotBob 4.5s ease-in-out infinite; transform-origin: 130px 300px; }
.mascot-sparkle { animation: sparkle 3s ease-in-out infinite; transform-origin: 210px 100px; }
.tape {
  position: absolute; width: 92px; height: 26px; background: rgba(119, 185, 231, .35);
  top: 46px; right: -18px; transform: rotate(38deg); border-radius: 3px; z-index: 4;
}
.sparkle { position: absolute; color: var(--sun); font-size: 26px; z-index: 1; animation: sparkle 3.4s ease-in-out infinite; }
.sp1 { top: 20px; left: 18px; }
.sp2 { top: 130px; right: 6px; color: var(--lav); animation-delay: -1.2s; font-size: 20px; }
.sp3 { bottom: 40px; left: 36px; color: var(--sky); animation-delay: -2.1s; font-size: 18px; }
@keyframes paperBob { 0%,100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-8px); } }
@keyframes mascotBob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(1.5deg); } }
@keyframes sparkle { 0%,100% { opacity: .55; transform: scale(.9) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(12deg); } }

/* steps */
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 46px 0 10px; }
.step-card {
  background: rgba(255, 255, 255, .68);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius-lg);
  padding: 24px 22px 22px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: transform .2s, box-shadow .2s;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 14px;
  transform: rotate(-3deg);
}
.step-icon svg { width: 27px; height: 27px; }
.pencil { background: var(--coral-soft); color: var(--coral-deep); }
.camera { background: var(--mint-soft); color: var(--mint-deep); }
.wand { background: var(--lav-soft); color: #815fd0; }
.step-card h3 { font-family: var(--font-fun); font-size: 20px; margin: 0 0 8px; font-weight: 400; }
.step-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }

/* ---------- preview ---------- */
.view { animation: viewIn .35s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.preview-panel {
  max-width: 780px; margin: 18px auto 0;
  background: rgba(255, 255, 255, .8);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid #fff;
  backdrop-filter: blur(10px);
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.kicker {
  display: inline-block; font-size: 12px; font-weight: 900; letter-spacing: 2px;
  color: var(--coral-deep); background: var(--coral-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.panel-head h2, .result-head h2 { font-family: var(--font-fun); font-weight: 400; margin: 0 0 6px; font-size: 30px; }
.panel-head p, .result-sub { color: var(--ink-soft); margin: 0; font-size: 14px; }
.photo-frame {
  position: relative;
  background: #e8dfd2;
  border-radius: 22px;
  padding: 12px;
  box-shadow: inset 0 2px 10px rgba(80, 60, 50, .08);
}
.photo-frame img {
  display: block; width: 100%; max-height: 62vh; object-fit: contain;
  border-radius: 14px; background: #fff;
  transition: transform .3s ease;
}
.photo-tools {
  position: absolute; right: 22px; top: 22px; display: flex; gap: 8px;
}
.photo-tools button {
  border: 0; background: rgba(255, 255, 255, .92); color: var(--ink);
  border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 5px; box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.photo-tools svg { width: 16px; height: 16px; }
.photo-tools button:hover { background: #fff; }
.preview-tips {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--sun-soft); border-radius: 18px; padding: 16px 18px; margin: 18px 0 22px;
  color: #8a6a20; font-size: 13px;
}
.preview-tips > span { font-weight: 900; white-space: nowrap; }
.preview-tips ul { margin: 0; padding-left: 18px; line-height: 1.8; color: #927534; }

/* ---------- result ---------- */
#view-result { padding-bottom: 120px; }
.result-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  margin: 18px 0 20px;
}
.result-head h2 { font-size: 36px; margin-bottom: 4px; }
.confetti { display: inline-block; font-size: 26px; animation: sparkle 2.4s ease-in-out infinite; }
.result-tools { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px;
  border: 1.5px solid rgba(54, 52, 66, .1);
  background: rgba(255,255,255,.7);
  color: var(--ink-soft);
  display: grid; place-items: center;
  transition: .18s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { background: #fff; color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.warning {
  display: flex; gap: 10px; align-items: center;
  background: #fff7df; border: 1.5px dashed #f0c96a;
  color: #8a6a20; border-radius: 16px;
  padding: 13px 18px; font-size: 14px; margin-bottom: 16px;
}
.warning::before { content: "✎"; font-size: 18px; }
.score-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-xl);
  padding: 26px 26px 18px;
  box-shadow: var(--shadow-lg), 0 5px 0 #efe3cf;
  border: 1px solid #f2e8d8;
  overflow: hidden;
}
.score-card::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 63px, rgba(160, 190, 220, .13) 63px 64px);
  pointer-events: none;
}
.score-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; position: relative; }
.score-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  background: var(--cream); border-radius: 999px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 800; color: #8d7b63;
  display: inline-flex; gap: 5px; align-items: center;
}
.stat-pill b { color: var(--ink); font-size: 14px; }
.score-legend { font-size: 12px; color: #a49a8c; display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(255,126,104,.18); }
.note-board {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  position: relative; padding: 4px 0 10px;
}
.score-row {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px;
  overflow: visible;
  padding: 10px 4px 8px;
}
.score-row .note-card { flex: none; }
.swipe-hint { display: none; }
.note-card {
  position: relative;
  min-width: calc(74px * var(--ns, 1)); min-height: calc(104px * var(--ns, 1));
  padding: 8px 8px 6px;
  border-radius: 18px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 4px 12px rgba(90, 70, 80, .07);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
  user-select: none;
}
.note-card:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 10px 22px rgba(90, 70, 80, .14); background: #fff; }
.note-card.selected { border-color: var(--coral); background: #fff8f5; box-shadow: 0 8px 20px rgba(255, 126, 104, .22); transform: translateY(-3px); }
.note-card.playing {
  background: linear-gradient(160deg, #fff6d9, #ffe6c2);
  border-color: var(--sun);
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 14px 26px rgba(255, 180, 60, .28);
}
.note-card.playing .glyph-num { color: var(--coral-deep); }
.note-card.low-conf::after {
  content: "?"; position: absolute; top: -7px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--sun); color: #6b4c00; font-size: 12px; font-weight: 900;
  display: grid; place-items: center; box-shadow: 0 3px 8px rgba(255, 180, 60, .4);
}
.glyph-box {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num);
}
.digit-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: calc(62px * var(--ns, 1)); padding: 10px 4px 8px;
}
.glyph-num { font-size: calc(40px * var(--ns, 1)); line-height: 1; font-weight: 600; color: var(--ink); padding: 0 2px; }
.octave-dots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 3px; }
.octave-dots.above { top: -2px; }
.octave-dots.below { bottom: -2px; flex-direction: column-reverse; }
.octave-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); display: block; }
.underlines { position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px; display: flex; flex-direction: column; gap: 3px; }
.underlines span { display: block; width: 30px; height: 3px; border-radius: 2px; background: var(--ink); }
.aug-dot { position: absolute; right: -2px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.dash-ext { display: inline-flex; align-items: center; gap: 4px; margin-left: 7px; }
.dash-ext i { width: 12px; height: 3px; border-radius: 2px; background: var(--ink); display: block; }
.note-beats {
  margin-top: auto; font-size: calc(10.5px * var(--ns, 1)); font-weight: 800; color: #a39687;
  background: var(--cream); border-radius: 999px; padding: 2px 8px; letter-spacing: .2px;
}
.note-card.playing .note-beats { background: rgba(255,255,255,.8); color: #9a6a00; }
.note-card.rest .glyph-num { color: #b3a898; }
.note-card.rest .note-beats { color: #b3a898; }
.measure-bar {
  width: 2px; align-self: stretch; margin: 12px 4px;
  background: repeating-linear-gradient(to bottom, #d9cbb6 0 7px, transparent 7px 12px);
  border-radius: 2px;
}
.row-break { flex-basis: 100%; height: 2px; }
body[data-view="result"] .footer { display: none; }
.add-note {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--mint-soft); color: var(--mint-deep);
  border: 2px dashed rgba(85, 199, 168, .45);
  border-radius: 16px; padding: 11px 17px;
  font-weight: 800; font-size: 14px;
  margin: 4px 0 10px;
  transition: .18s;
}
.add-note:hover { background: #cbefe4; transform: translateY(-2px); }
.edit-hint { text-align: center; color: #aca193; font-size: 12.5px; margin: 6px 0 0; position: relative; }

/* transport */
.transport {
  position: fixed; z-index: 20;
  left: 50%; bottom: 22px; transform: translateX(-50%);
  width: min(720px, calc(100% - 28px));
  display: flex; align-items: center; gap: 18px;
  background: rgba(255, 253, 247, .9);
  border: 1.5px solid #fff;
  border-radius: 28px;
  padding: 14px 20px;
  box-shadow: 0 24px 50px rgba(74, 55, 70, .2);
  backdrop-filter: blur(16px);
  animation: transportIn .4s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes transportIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.play-btn {
  width: 66px; height: 66px; flex: none; border-radius: 50%;
  border: 0; background: linear-gradient(150deg, #ff927d, var(--coral));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(232, 95, 75, .35), inset 0 -4px 0 rgba(160,50,35,.16);
  transition: transform .15s, background .15s;
}
.play-btn svg { width: 30px; height: 30px; }
.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(.97); }
.play-btn .icon-stop { display: none; }
.play-btn.playing { background: linear-gradient(150deg, #6fd4b6, var(--mint)); box-shadow: 0 10px 22px rgba(60,170,140,.32), inset 0 -4px 0 rgba(30,110,90,.15); }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-stop { display: block; }
.transport-info { flex: 1; min-width: 0; }
.tempo-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.tempo-head strong { font-family: var(--font-num); font-size: 19px; color: var(--ink); }
#tempo { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--sun) 0%, #f0e4cf 0%); margin: 8px 0 3px; outline: none; }
#tempo::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 4px solid var(--sun); box-shadow: 0 3px 8px rgba(180,130,20,.3);
  cursor: grab;
}
#tempo::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--sun); }
.tempo-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: #b3a89a; }
.mini-action {
  flex: none; border: 1.5px solid rgba(54,52,66,.1); background: #fff;
  color: var(--ink-soft); border-radius: 14px; padding: 9px 11px;
  font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px;
}
.mini-action svg { width: 15px; height: 15px; }
.mini-action:hover { color: var(--ink); background: var(--cream); }
.mini-action:disabled { opacity: .35; cursor: default; }

/* ---------- empty ---------- */
.empty-card {
  max-width: 560px; margin: 40px auto; text-align: center;
  background: rgba(255,255,255,.8); border-radius: var(--radius-xl);
  padding: 52px 34px; box-shadow: var(--shadow-lg); border: 1.5px solid #fff;
}
.empty-art { font-size: 58px; margin-bottom: 10px; }
.empty-card h2 { font-family: var(--font-fun); font-weight: 400; font-size: 28px; margin: 0 0 12px; }
.empty-card p { color: var(--ink-soft); line-height: 1.8; margin: 0 0 26px; }
.empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- scan overlay ---------- */
.scan-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(47, 40, 53, .55);
  display: grid; place-items: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}
.scan-card {
  width: min(420px, 100%);
  background: var(--paper);
  border-radius: 30px;
  padding: 20px 20px 24px;
  box-shadow: 0 30px 70px rgba(30, 20, 40, .35);
  animation: popIn .35s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(14px); } to { opacity: 1; transform: none; } }
.scan-photo { position: relative; border-radius: 18px; overflow: hidden; background: #eee5d6; aspect-ratio: 4 / 3; }
.scan-photo img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .82; }
.scan-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,.12), rgba(255,255,255,0)); }
.scan-line {
  position: absolute; left: 6%; right: 6%; height: 3px; top: 10%;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  box-shadow: 0 0 18px 4px rgba(85, 199, 168, .55);
  animation: scanMove 1.5s ease-in-out infinite;
  border-radius: 99px;
}
@keyframes scanMove { 0% { top: 8%; } 50% { top: 86%; } 100% { top: 8%; } }
.scan-corner { position: absolute; width: 22px; height: 22px; border: 3px solid var(--mint); }
.c1 { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.c2 { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.c3 { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.c4 { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.scan-status { text-align: center; padding: 20px 6px 14px; }
.scan-status h3 { font-family: var(--font-fun); font-weight: 400; font-size: 24px; margin: 12px 0 5px; }
.scan-status p { color: var(--ink-soft); font-size: 13px; margin: 0; }
.scan-spinner { display: flex; justify-content: center; gap: 7px; }
.scan-spinner span { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: bounceDot 1s infinite ease-in-out; }
.scan-spinner span:nth-child(2) { background: var(--sun); animation-delay: .15s; }
.scan-spinner span:nth-child(3) { background: var(--mint); animation-delay: .3s; }
@keyframes bounceDot { 0%,100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-7px); opacity: 1; } }
.scan-progress { height: 8px; background: #f2e8d7; border-radius: 99px; overflow: hidden; }
.scan-progress i { display: block; height: 100%; width: 8%; border-radius: 99px; background: linear-gradient(90deg, var(--sun), var(--coral), var(--mint)); transition: width .4s ease; }

/* ---------- editor sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(44, 38, 52, .42);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.editor-sheet, .help-sheet {
  width: min(680px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 32px 32px 26px 26px;
  padding: 12px 28px 26px;
  box-shadow: 0 30px 80px rgba(30, 20, 40, .35);
  animation: sheetUp .32s cubic-bezier(.2,.9,.3,1.08);
  border: 1.5px solid #fff;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .7; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 46px; height: 5px; border-radius: 99px; background: #e5dac9; margin: 2px auto 12px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.editor-head h3 { font-family: var(--font-fun); font-weight: 400; font-size: 22px; margin: 0; }
.editor-preview {
  display: flex; align-items: center; justify-content: center; gap: 30px;
  background: linear-gradient(160deg, #fff9ec, #fff3dd);
  border-radius: 22px; padding: 18px; margin: 12px 0 22px;
  border: 1.5px solid #f6e9d1;
}
.editor-note { min-width: 110px; display: flex; align-items: center; justify-content: center; }
.editor-note .digit-wrap { min-height: 88px; padding: 12px 6px 10px; }
.editor-note .glyph-num { font-size: 62px; }
.editor-note .octave-dots i { width: 8px; height: 8px; }
.editor-note .underlines span { width: 42px; height: 4px; }
.editor-meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.editor-beat { margin: 0; font-weight: 800; color: #8d7b63; font-size: 13px; background: #fff; padding: 6px 13px; border-radius: 999px; }
.listen-btn {
  border: 0; background: var(--mint); color: #fff; border-radius: 13px;
  padding: 9px 15px; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 6px 14px rgba(60, 170, 140, .25);
}
.listen-btn svg { width: 15px; height: 15px; }
.listen-btn:hover { background: var(--mint-deep); }
.editor-section { margin-bottom: 18px; }
.editor-section h4 {
  font-size: 13px; color: var(--ink-soft); margin: 0 0 9px;
  display: flex; align-items: baseline; gap: 8px;
}
.editor-section h4 small { font-weight: 400; color: #b2a898; font-size: 11.5px; }
.pitch-pad { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.pitch-pad button {
  border: 2px solid transparent; background: #fff; border-radius: 15px;
  padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  box-shadow: 0 3px 8px rgba(90,70,80,.06);
  transition: .15s;
}
.pitch-pad button b { font-family: var(--font-num); font-size: 26px; line-height: 1; font-weight: 600; color: var(--ink); }
.pitch-pad button span { font-size: 9.5px; color: #b0a496; font-weight: 700; letter-spacing: .3px; }
.pitch-pad button:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pitch-pad button.active { background: var(--coral); border-color: var(--coral); }
.pitch-pad button.active b, .pitch-pad button.active span { color: #fff; }
.pitch-pad button.rest-pad b { color: #b3a898; }
.pitch-pad button.rest-pad.active { background: #a89b8a; border-color: #a89b8a; }
.octave-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.octave-pad button {
  border: 2px solid transparent; background: #fff; border-radius: 15px;
  padding: 10px 6px; font-weight: 800; font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 3px 8px rgba(90,70,80,.06);
}
.octave-pad button:hover { transform: translateY(-2px); }
.octave-pad button.active { background: var(--mint-soft); border-color: var(--mint); color: var(--mint-deep); }
.oct-glyph { position: relative; font-family: var(--font-num); font-size: 22px; color: var(--ink); line-height: 1; }
.oct-glyph .dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); left: 50%; transform: translateX(-50%); }
.octave-pad button[data-octave="-1"] .dot { bottom: -6px; }
.octave-pad button[data-octave="1"] .dot { top: -6px; }
.rhythm-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.rhythm-pad button {
  border: 2px solid transparent; background: #fff; border-radius: 15px;
  padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 3px 8px rgba(90,70,80,.06);
  transition: .15s;
}
.rhythm-pad button:hover { transform: translateY(-2px); }
.rhythm-pad button.active { background: var(--sun-soft); border-color: var(--sun); }
.rhythm-pad em { font-style: normal; font-size: 10px; color: #b0a496; font-weight: 800; }
.rhythm-pad button.active em { color: #9a6a00; }
.rh-glyph {
  position: relative; font-family: var(--font-num); font-size: 23px; line-height: 1.25;
  color: var(--ink); display: inline-flex; align-items: center; gap: 4px;
  min-height: 30px; padding-bottom: 4px;
}
.rh-glyph i { font-style: normal; font-size: 14px; letter-spacing: 1px; color: #8b8290; }
.rh-glyph.underline1::after, .rh-glyph.underline2::after, .rh-glyph.underline2::before {
  content: ""; position: absolute; left: 0; right: 0; height: 2.5px; background: var(--ink); border-radius: 2px;
}
.rh-glyph.underline1::after { bottom: 0; }
.rh-glyph.underline2::after { bottom: 0; }
.rh-glyph.underline2::before { bottom: 4px; }
.rh-glyph.dotted { padding-right: 8px; }
.rh-glyph .aug { position: absolute; right: 0; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.editor-actions { display: flex; gap: 10px; margin-top: 22px; }
.editor-actions .btn { flex: 1; padding: 14px 12px; font-size: 15px; border-radius: 15px; }
.editor-tip { text-align: center; color: #b1a798; font-size: 12px; margin: 14px 0 0; }

/* help */
.help-sheet { max-width: 560px; }
.help-list { list-style: none; margin: 14px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.help-list li { display: flex; gap: 14px; }
.help-list li > span {
  flex: none; width: 34px; height: 34px; border-radius: 12px;
  background: var(--coral-soft); color: var(--coral-deep);
  display: grid; place-items: center; font-weight: 900; font-size: 15px;
}
.help-list li:nth-child(2) > span { background: var(--mint-soft); color: var(--mint-deep); }
.help-list li:nth-child(3) > span { background: var(--sun-soft); color: #a07400; }
.help-list li:nth-child(4) > span { background: var(--lav-soft); color: #7a58c9; }
.help-list b { font-size: 15px; }
.help-list p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; }
.help-note {
  background: var(--cream); border-radius: 15px; padding: 13px 16px;
  color: #91846f; font-size: 12.5px; line-height: 1.7; margin-bottom: 18px;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 118px; transform: translate(-50%, 16px);
  background: rgba(45, 39, 52, .92); color: #fff;
  padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 90;
  box-shadow: 0 12px 30px rgba(30,20,40,.3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* focus */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(119, 185, 231, .65);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 12px; padding-top: 18px; }
  .hero-copy { text-align: center; }
  .hero-actions { justify-content: center; }
  .privacy { justify-content: center; }
  .text-link { margin-left: auto; margin-right: auto; }
  .hero-art { min-height: 420px; margin-top: 6px; }
  .how-steps { grid-template-columns: 1fr; gap: 12px; margin-top: 26px; }
  .step-card { display: flex; align-items: flex-start; gap: 16px; padding: 18px; }
  .step-icon { margin-bottom: 0; flex: none; }
  .step-copy { min-width: 0; }
  .note-card { min-width: calc(66px * var(--ns, 1)); min-height: calc(96px * var(--ns, 1)); }
  .glyph-num { font-size: calc(34px * var(--ns, 1)); }
  .result-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .result-tools { align-self: stretch; justify-content: flex-end; }
  .transport { gap: 12px; padding: 12px 15px; bottom: 12px; }
  .mini-action { display: none; }
  .transport-info { min-width: 90px; }
}
@media (max-width: 640px) {
  .topbar { padding: 18px 18px 4px; }
  .brand-text { font-size: 18px; }
  .brand-icon { width: 36px; height: 36px; border-radius: 12px; }
  .brand-icon svg { width: 22px; height: 22px; }
  .app { padding: 6px 16px 30px; }
  .hero h1 { font-size: clamp(34px, 9.4vw, 46px); }
  .lede { font-size: 15px; margin-bottom: 24px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .text-link { margin-top: 16px; }
  .br-mobile { display: none; }
  .hero-art { min-height: 340px; transform: scale(.86); margin: -14px -10px 0; }
  .paper-card { width: 320px; min-height: 276px; padding: 26px 20px 20px; }
  .paper-line { gap: 8px; }
  .mini-glyph { font-size: 34px; min-width: 21px; }
  .mini-glyph .dash { left: 27px; width: 20px; }
  .mascot { width: 218px; right: -30px; bottom: -8px; }
  .preview-panel { padding: 22px 16px; border-radius: 26px; margin-top: 6px; }
  .panel-head { flex-direction: column; gap: 10px; }
  .panel-head h2 { font-size: 25px; }
  .photo-tools { right: 18px; top: 18px; }
  .photo-tools button { padding: 7px 10px; font-size: 12px; }
  .preview-tips { flex-direction: column; gap: 6px; }
  .result-head h2 { font-size: 29px; }
  .score-card { padding: 18px 14px 14px; border-radius: 26px; }
  .score-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .score-legend { display: none; }
  .note-board { gap: 7px; }
  .score-row { gap: 7px; padding: 8px 2px 10px; }
  .note-card { min-width: calc(61px * var(--ns, 1)); min-height: calc(92px * var(--ns, 1)); border-radius: 15px; padding: 6px 5px 5px; }
  .glyph-num { font-size: calc(31px * var(--ns, 1)); }
  .digit-wrap { min-height: calc(56px * var(--ns, 1)); padding: 8px 2px 6px; }
  .underlines span { width: 24px; }
  .dash-ext i { width: 9px; }
  .note-beats { font-size: calc(9.5px * var(--ns, 1)); padding: 2px 6px; }
  .transport { border-radius: 24px; bottom: 8px; width: calc(100% - 20px); }
  .play-btn { width: 58px; height: 58px; }
  .play-btn svg { width: 26px; height: 26px; }
  .tempo-head strong { font-size: 17px; }
  #view-result { padding-bottom: 108px; }
  .editor-sheet, .help-sheet { padding: 10px 16px 22px; border-radius: 26px 26px 20px 20px; }
  .pitch-pad { grid-template-columns: repeat(4, 1fr); }
  .pitch-pad button b { font-size: 24px; }
  .octave-pad button { font-size: 12px; padding: 10px 4px; }
  .rhythm-pad { grid-template-columns: repeat(3, 1fr); }
  .editor-preview { gap: 16px; padding: 14px; }
  .editor-note .glyph-num { font-size: 54px; }
  .footer { padding-bottom: 26px; font-size: 11px; }
  .toast { bottom: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- account & library ---------- */
.topbar-right { display: flex; align-items: center; gap: 10px; }
#btn-auth.logged { background: var(--mint-soft); color: var(--mint-deep); border-color: rgba(85,199,168,.35); }

.score-toolbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 0 0 8px;
}
.time-sig {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; color: #8d7b63;
}
.time-sig select {
  appearance: none;
  border: 2px solid rgba(54,52,66,.1);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit; font-size: 13px; font-weight: 800; color: var(--ink);
  cursor: pointer;
}
.time-sig select:focus { outline: none; border-color: var(--coral); }
.sig-help {
  border: 0; background: none; padding: 4px 2px;
  color: #b08b3e; font-family: inherit; font-size: 12.5px; font-weight: 800;
  border-bottom: 2px dotted rgba(176,139,62,.5);
}
.score-view-opts { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.font-size {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; color: #8d7b63;
}
.font-size select {
  appearance: none;
  border: 2px solid rgba(54,52,66,.1);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit; font-size: 13px; font-weight: 800; color: var(--ink);
  cursor: pointer;
}
.font-size select:focus { outline: none; border-color: var(--coral); }
.bpm-tag {
  font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: .5px;
  color: var(--coral-deep); background: var(--coral-soft);
  border-radius: 999px; padding: 1px 6px; margin-left: 2px;
}
.font-size-slider input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 92px; height: 6px; border-radius: 99px;
  background: #f0e4cf; outline: none; cursor: pointer;
}
.font-size-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; border: 3px solid var(--coral);
  box-shadow: 0 2px 6px rgba(180, 90, 70, .28);
}
.font-size-slider input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid var(--coral);
}
.font-size-slider em {
  font-style: normal; font-size: 11px; font-weight: 900;
  color: var(--coral-deep); min-width: 34px; text-align: right;
}
.score-title {
  margin: 4px 2px 10px;
  font-family: var(--font-fun); font-weight: 400; font-size: 22px;
  color: var(--ink); letter-spacing: .5px;
}
.edit-mode-btn {
  border: 2px solid rgba(54,52,66,.1);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer;
}
.edit-mode-btn:hover { color: var(--ink); border-color: rgba(54,52,66,.2); }
.edit-mode-btn.active { background: var(--mint); border-color: var(--mint); color: #fff; }

/* ---------- 编辑模式：底部悬浮「播放 + 编辑」工作台 ---------- */
.dock-transport-host:empty { display: none; }
.dock-hint { display: none; }
body.edit-mode #view-result { padding-bottom: min(66vh, 640px); }

#editor.dock {
  position: fixed; inset: auto 0 0 0; z-index: 45;
  display: block; padding: 0 10px 10px;
  background: none; backdrop-filter: none;
  animation: none;
}
#editor.dock .editor-sheet {
  width: min(940px, 100%);
  max-height: min(58vh, 540px);
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 26px;
  padding: 8px 20px 16px;
  border: 1.5px solid #fff;
  box-shadow: 0 -10px 40px rgba(74, 55, 70, .2);
  animation: sheetUp .28s ease;
}
#editor.dock .sheet-grab { display: block; }
#editor.dock #btn-editor-close { display: none; }
#editor.dock .dock-transport-host {
  position: sticky; top: -8px; z-index: 3;
  background: var(--paper); padding: 2px 0;
}
#editor.dock .editor-head { margin-bottom: 6px; }
#editor.dock .editor-head h3 { font-size: 18px; }
#editor.dock .dock-hint {
  display: none; margin: 4px 0 8px;
  text-align: center; color: #a89d8d; font-size: 13px; font-weight: 700;
}
#editor.dock:not(.has-note) .dock-hint { display: block; }
#editor.dock:not(.has-note) .dock-note-area { display: none; }

#editor.dock .editor-preview {
  margin: 0 0 10px; padding: 0; gap: 0;
  background: none; border: 0; justify-content: flex-start; min-height: 0;
}
#editor.dock .editor-note,
#editor.dock .editor-beat { display: none; }
#editor.dock .editor-meta { flex-direction: row; gap: 8px; }
#editor.dock .editor-meta .listen-btn { padding: 8px 14px; font-size: 12px; border-radius: 12px; }
#editor.dock .editor-section { margin-bottom: 10px; }
#editor.dock .editor-section h4 { margin-bottom: 6px; font-size: 12px; }
#editor.dock .pitch-pad button { padding: 5px 2px 4px; border-radius: 11px; }
#editor.dock .pitch-pad button b { font-size: 21px; }
#editor.dock .octave-pad button { padding: 7px 4px; font-size: 12px; border-radius: 12px; }
#editor.dock .rhythm-pad button { padding: 7px 2px 6px; border-radius: 12px; }
#editor.dock .rh-glyph { font-size: 19px; min-height: 24px; }
#editor.dock .rhythm-pad em { font-size: 9px; }
#editor.dock .editor-actions { margin-top: 10px; }
#editor.dock .editor-actions .btn { padding: 10px 8px; font-size: 13px; border-radius: 13px; }
#editor.dock .editor-tip { margin-top: 10px; font-size: 11.5px; }

/* 播放条放进工作台后改为普通流式布局 */
.transport.in-dock {
  position: static; left: auto; bottom: auto; transform: none;
  width: 100%; margin: 0 0 12px;
  padding: 8px 12px; gap: 12px;
  border-radius: 18px;
  background: var(--cream);
  border: 1.5px solid #f2e6d2;
  box-shadow: none; backdrop-filter: none;
  animation: none;
}
.transport.in-dock .mini-action { display: none; }
.transport.in-dock .play-btn { width: 48px; height: 48px; }
.transport.in-dock .play-btn svg { width: 24px; height: 24px; }
.transport.in-dock .tempo-head strong { font-size: 16px; }
.transport.in-dock #tempo { margin: 5px 0 2px; }
.transport.in-dock .tempo-scale { display: none; }

@media (min-width: 800px) {
  #editor.dock .dock-sections {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1.6fr;
    gap: 16px; align-items: start;
  }
  #editor.dock .editor-section { margin-bottom: 0; }
}
@media (max-width: 640px) {
  #editor.dock { padding: 0 8px 8px; }
  #editor.dock .editor-sheet { max-height: 64vh; padding: 6px 14px 14px; border-radius: 22px; }
  #editor.dock .editor-head h3 { font-size: 16px; }
  #editor.dock .pitch-pad { grid-template-columns: repeat(8, 1fr); gap: 5px; }
  #editor.dock .rhythm-pad { grid-template-columns: repeat(6, 1fr); gap: 5px; }
  #editor.dock .pitch-pad button span { display: none; }
  #editor.dock .rhythm-pad em { display: none; }
  #editor.dock .editor-preview { gap: 12px; }
  #editor.dock .editor-note .glyph-num { font-size: 32px; }
}
body.edit-mode .toast { bottom: auto; top: 18px; transform: translate(-50%, -14px); }
body.edit-mode .toast.show { transform: translate(-50%, 0); }

.line-actions .btn {
  background: rgba(255,255,255,.8);
  color: var(--ink-soft);
  border: 2px solid rgba(54,52,66,.1);
}
.line-actions #btn-line-break {
  color: #2b6f9e;
  border-color: rgba(119,185,231,.5);
  background: var(--sky-soft);
}
.line-actions #btn-line-merge {
  color: var(--mint-deep);
  border-color: rgba(85,199,168,.5);
  background: var(--mint-soft);
}
.line-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.playfrom-btn { background: var(--sky); box-shadow: 0 8px 18px rgba(70,150,210,.28); }
.playfrom-btn:hover { background: #4d9fd8; }

.score-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.score-item {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--paper); border: 1px solid #f2e8d8; border-radius: var(--radius-lg);
  padding: 20px 20px 16px; box-shadow: var(--shadow-sm);
}
.score-item h3 { margin: 0; font-family: var(--font-fun); font-weight: 400; font-size: 20px; line-height: 1.3; word-break: break-all; }
.score-item .score-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.score-item .score-meta span {
  background: var(--cream); color: #8d7b63; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 800;
}
.score-item .score-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 4px; }
.score-item .score-actions .ghost-btn { padding: 7px 14px; font-size: 13px; }
.score-item .score-actions .btn-danger { color: #c05a43; border-color: rgba(192,90,67,.25); background: rgba(255,255,255,.6); }
.library-empty { text-align: center; padding: 56px 20px; color: #9a929f; }
.library-empty b { display: block; font-size: 18px; color: var(--ink-soft); margin-bottom: 8px; }
.library-empty .btn { margin-top: 18px; }

#auth-modal, #save-modal { align-items: center; }
.auth-sheet {
  width: min(430px, 100%);
  background: var(--paper);
  border: 1.5px solid #fff;
  border-radius: 26px;
  padding: 20px 26px 26px;
  box-shadow: 0 30px 80px rgba(30,20,40,.35);
  animation: sheetUp .28s cubic-bezier(.2,.9,.3,1.08);
}
.auth-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.auth-form label { font-size: 13px; font-weight: 800; color: #8d7b63; margin-top: 8px; }
.auth-form input {
  border: 2px solid rgba(54,52,66,.1); background: #fff; border-radius: 14px;
  padding: 12px 14px; font-family: inherit; font-size: 15px; color: var(--ink);
}
.auth-form input:focus { outline: none; border-color: var(--coral); }
.auth-msg { min-height: 18px; margin: 6px 0; font-size: 13px; color: #b4543c; }
.auth-note { margin: 2px 0 4px; font-size: 13px; line-height: 1.6; color: #8d7b63; }
.auth-msg.ok { color: var(--mint-deep); }
.auth-form .text-link { margin-top: 2px; justify-content: center; font-size: 13px; }
.auth-form .btn-wide { padding: 14px; font-size: 16px; border-radius: 16px; margin-top: 2px; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 16px 16px 4px; }
  .topbar-right { gap: 6px; }
  .topbar-right .ghost-btn { padding: 7px 11px; font-size: 12.5px; }
  .score-toolbar { align-items: flex-start; flex-direction: column; gap: 6px; }
}
