/* ============================================================
   HumTrack landing — embedded app-screen styles
   Editor chrome + per-screen styles, lifted from the store-shot kit.
   .app is laid out at a fixed 1180px logical width and CSS-scaled into
   responsive containers on the page (see .screen-scaler in index.html).
   Tokens (--bg, --lime, --shadow-lime, …) come from the page :root.
   ============================================================ */

.app {
  position: relative;
  width: 1180px;
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.app .ulabel { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }

/* shared editor chrome */
.ed-top { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.rbtn { width: 38px; height: 38px; flex: none; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-primary); }
.ed-title { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-weight: 700; font-size: 16px; }
.ed-title svg { color: var(--text-tertiary); }
.app .spacer { flex: 1; }
.app .pill { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 13px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); white-space: nowrap; }
.app .pill--lime { background: var(--lime); color: var(--bg); border-color: transparent; box-shadow: var(--shadow-lime); }
.app .pill--key { color: var(--text-secondary); }
.app .pill--key b { color: var(--lime); font-weight: 800; }

.ed-song { height: 46px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); background: rgba(22,22,22,0.5); }
.app .chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.app .chip--active { background: var(--active-lane); border-color: var(--lime); color: var(--lime); }
.app .chip--active .xn { color: var(--lime); }
.app .chip .xn { color: var(--text-tertiary); font-weight: 800; }
.app .chip--add { border-style: dashed; color: var(--text-tertiary); width: 30px; padding: 0; justify-content: center; }

.ed-arr { flex: none; padding: 10px 16px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--border); position: relative; }
.arr-row { display: flex; align-items: center; gap: 10px; height: 30px; }
.arr-label { width: 120px; flex: none; height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.arr-label .nm { flex: 1; }
.arr-label .vol { color: var(--text-tertiary); }
.arr-lane { flex: 1; height: 30px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.arr-note { position: absolute; top: 50%; transform: translateY(-50%); height: 8px; border-radius: 3px; }
.arr-dot { position: absolute; width: 5px; height: 5px; border-radius: 999px; }
.playhead { position: absolute; top: 8px; bottom: 8px; width: 2px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.6); z-index: 6; }

.ed-shead { height: 42px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.ed-shead .titles { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg b { font-size: 12px; font-weight: 700; color: var(--text-tertiary); padding: 4px 12px; border-radius: 7px; }
.seg b.on { background: var(--lime); color: var(--bg); }
.step { display: inline-flex; align-items: center; gap: 10px; height: 30px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.step .v { min-width: 54px; text-align: center; color: var(--text-secondary); }
.hint { color: var(--text-tertiary); font-size: 12px; font-weight: 600; }

.ed-surface { flex: 1; min-height: 0; position: relative; padding: 12px 16px 14px; display: flex; }

.ed-transport { height: 70px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--border); background: var(--surface); }
.tgrp { display: flex; align-items: center; gap: 8px; }
.tbtn { width: 40px; height: 40px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-secondary); }
.tbtn.on { background: var(--active-lane); border-color: var(--lime); color: var(--lime); }
.bpm { display: inline-flex; align-items: center; gap: 12px; height: 40px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.bpm .n { font-weight: 800; font-size: 14px; }
.bpm .n small { color: var(--text-tertiary); font-weight: 700; font-size: 11px; }
.t-rbtn { width: 44px; height: 44px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-primary); }
.t-play { width: 58px; height: 58px; border-radius: 999px; background: var(--lime); color: var(--bg); display: grid; place-items: center; box-shadow: var(--shadow-lime); }
.t-rec { width: 50px; height: 50px; border-radius: 999px; border: 3px solid var(--danger); display: grid; place-items: center; background: transparent; }
.t-rec .dot { width: 20px; height: 20px; border-radius: 6px; background: var(--danger); }
.swing { display: inline-flex; align-items: center; gap: 10px; }
.swing .track { width: 92px; height: 5px; border-radius: 999px; background: var(--surface-3); position: relative; }
.swing .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--lime); }
.swing .track b { position: absolute; top: 50%; width: 15px; height: 15px; border-radius: 999px; background: var(--lime); transform: translate(-50%, -50%); box-shadow: var(--shadow-lime); }
.barsT { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.barsT b { font-size: 12px; font-weight: 800; color: var(--text-tertiary); padding: 4px 11px; border-radius: 999px; }
.barsT b.on { background: var(--lime); color: var(--bg); }

/* ── Songs (home) ── */
.songs { width: 1180px; height: 100%; padding: 28px 32px; display: flex; flex-direction: column; gap: 22px; background: var(--bg); }
.songs-head { display: flex; align-items: center; gap: 14px; }
.songs .logo { width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--lime); display: grid; place-items: center; box-shadow: var(--shadow-lime); }
.songs .wm { display: flex; flex-direction: column; gap: 2px; }
.songs .wm .name { font-weight: 800; font-size: 22px; letter-spacing: -0.6px; line-height: 1; }
.songs .wm .name em { color: var(--lime); font-style: normal; }
.songs .wm .sub { font-size: 10px; font-weight: 800; letter-spacing: 1.4px; color: var(--text-tertiary); }
.songs-head .new { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; background: var(--lime); color: var(--bg); white-space: nowrap; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-lime); }
.songs-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 16px; flex: 1; min-height: 0; }
.scard { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 13px; box-shadow: var(--shadow-card); }
.thumb { height: 62px; display: flex; align-items: center; gap: 3px; }
.thumb i { flex: 1; border-radius: 2px; background: var(--surface-3); }
.thumb i.hot { background: var(--lime); box-shadow: var(--glow-note); }
.scard .ti { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.scard .meta { font-size: 12px; color: var(--text-tertiary); letter-spacing: 0.2px; }
.scard--add { border-style: dashed; align-items: center; justify-content: center; gap: 8px; color: var(--text-tertiary); box-shadow: none; }
.scard--add .big { font-size: 22px; font-weight: 800; }
.scard--add .t { font-size: 13px; font-weight: 700; white-space: nowrap; }

/* ── Drums ── */
.drums { width: 100%; display: flex; gap: 14px; align-items: stretch; }
.dcol { width: 184px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.dpad { flex: 1; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; gap: 14px; position: relative; overflow: hidden; }
.dpad .stack { display: flex; align-items: center; gap: 12px; width: 150px; justify-content: center; }
.dpad .g { font-family: var(--font-mono); font-size: 30px; font-weight: 900; width: 44px; text-align: right; line-height: 1; }
.dpad .lab { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.dpad.lit { background: var(--active-lane); }
.dpad.lit.hh { border-color: var(--blue); box-shadow: 0 0 38px rgba(96,165,250,0.55); }
.dpad.lit.sn { border-color: var(--lime); box-shadow: var(--glow-neon); }
.dpad.lit.kk { border-color: var(--amber); box-shadow: 0 0 38px rgba(245,158,11,0.5); }
.dgrid { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.drow { flex: 1; display: flex; align-items: center; gap: 9px; max-height: 64px; }
.drow .rl { width: 30px; flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-tertiary); }
.dcells { flex: 1; display: grid; grid-template-columns: repeat(16, 1fr); gap: 5px; height: 100%; }
.dcell { border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.dcell.beat { background: #131313; }
.dcell.cur { border-color: var(--text-tertiary); }
.dcell.on.hh { background: var(--blue); box-shadow: 0 0 10px rgba(96,165,250,0.5); border-color: transparent; }
.dcell.on.sn { background: var(--lime); box-shadow: var(--glow-note); border-color: transparent; }
.dcell.on.kk { background: var(--amber); box-shadow: 0 0 10px rgba(245,158,11,0.5); border-color: transparent; }

/* ── Melody — in-key lanes ── */
.lanes { width: 100%; display: flex; gap: 9px; }
.lane { flex: 1; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 0 10px; overflow: hidden; }
.lane.on { background: var(--active-lane); border-color: var(--lime); box-shadow: var(--glow-neon); }
.lane .col { flex: 1; width: 100%; position: relative; }
.lane .nb { position: absolute; left: 14%; right: 14%; border-radius: 5px; background: var(--lime); box-shadow: var(--glow-note); }
.lane .nm { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-top: 8px; }
.lane.on .nm { color: var(--lime); }
.lane .deg { font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--text-tertiary); margin-top: 3px; }

/* ── Hum-to-MIDI modal ── */
.overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(6,6,6,0.7); }
.hum { width: 540px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 22px; padding: 32px 34px 28px; text-align: center; box-shadow: 0 40px 120px rgba(0,0,0,0.7); }
.hum .mic { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 999px; background: var(--active-lane); border: 1.5px solid var(--lime); display: grid; place-items: center; box-shadow: var(--glow-neon); }
.hum .elabel { color: var(--lime); }
.hum h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; margin: 12px 0 6px; }
.hum p { color: var(--text-secondary); font-size: 14px; line-height: 1.45; margin-bottom: 22px; }
.hum .bars { display: flex; align-items: center; justify-content: center; gap: 5px; height: 66px; margin-bottom: 24px; }
.hum .bars i { width: 6px; border-radius: 3px; background: var(--lime); box-shadow: var(--glow-note); }
.hum .acts { display: flex; gap: 12px; }
.hum .acts button { flex: 1; height: 50px; border-radius: 14px; font-weight: 800; font-size: 15px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-primary); display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.hum .acts button.lime { background: var(--lime); color: var(--bg); border-color: transparent; box-shadow: var(--shadow-lime); flex: 1.6; }

/* ── Export drawer ── */
.exdim { position: absolute; inset: 0; z-index: 40; background: rgba(6,6,6,0.55); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 41; width: 452px; background: var(--surface); border-left: 1px solid var(--border); padding: 24px 24px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: -20px 0 60px rgba(0,0,0,0.5); }
.drawer .dh { display: flex; align-items: center; gap: 12px; }
.drawer .dh .t { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; flex: 1; }
.drawer .dmeta { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); letter-spacing: 0.3px; margin-bottom: 4px; }
.erow { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.erow .ei { width: 42px; height: 42px; flex: none; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-secondary); }
.erow.lime .ei { background: var(--lime); color: var(--bg); box-shadow: var(--shadow-lime); }
.erow .em { flex: 1; }
.erow .em .n { font-weight: 700; font-size: 15px; }
.erow .em .s { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.erow .done { display: inline-flex; align-items: center; gap: 6px; color: var(--lime); font-weight: 800; font-size: 12px; }
.erow.locked { opacity: 0.6; }
.drawer .dfoot { margin-top: auto; font-size: 11.5px; line-height: 1.5; color: var(--text-tertiary); }
