/* Chord Designer: Moon Clay Black Cherry theme (Claymorphism + Surrealism) from the Claude Design redesign, 2026-09-28, with grain textures. */
:root {
  --bg: #0f1117;
  --panel: #15171f;
  --raised: #1c1f29;
  --pop: #1c1f29;
  --sunk: #12141b;
  --on: #2c303d;
  --fg: #f2f1f7;
  --muted: #b2b3c6;
  --dim: #898aa0;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.1);
  --accent: #ff5070;
  --gold: #c7b0ff;
  --rec: #ff5a5a;
  --warn: #ffcd6b;
  --ink: #1e0409;
  --clay: inset -3px -4px 7px rgba(4, 5, 10, .5), inset 3px 3px 6px rgba(224, 227, 244, .1), 0 5px 12px rgba(4, 5, 10, .5);
  --well: inset 3px 4px 9px rgba(4, 5, 10, .7), inset -2px -2px 6px rgba(200, 204, 230, .07);
  --slab: inset -8px -10px 20px rgba(4, 5, 10, .55), inset 8px 8px 18px rgba(200, 204, 230, .08), 0 24px 50px rgba(4, 5, 10, .6);
  --cherry: inset -4px -6px 10px rgba(138, 20, 40, .45), inset 4px 5px 10px rgba(255, 255, 255, .35), 0 10px 22px rgba(255, 80, 112, .3);
  /* Grain textures: fine for wells and the page, medium for panels, coarse for the backdrop. */
  --grain-fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E");
  --grain-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  --grain-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
  --violet: inset -4px -6px 10px rgba(74, 42, 138, .45), inset 4px 5px 10px rgba(255, 255, 255, .35), 0 10px 22px rgba(199, 176, 255, .3);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grain-back), repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 7px), var(--bg); background-attachment: fixed; color: var(--fg); font: 400 14px Outfit, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#app { position: relative; z-index: 1; min-height: 100vh; }
.orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orbs i { position: absolute; border-radius: 50%; }
.orbs .moon { right: 8vw; top: 12vh; width: 30vmin; height: 30vmin; background: #e8e0cf; box-shadow: inset -18px -22px 40px rgba(90, 80, 60, .55), inset 12px 12px 30px rgba(255, 255, 255, .5), 0 0 90px rgba(232, 224, 207, .25); opacity: .35; }
.orbs .plum { left: 5vw; top: 55vh; width: 70px; height: 70px; background: #c7b0ff; box-shadow: inset -10px -12px 18px rgba(60, 20, 120, .5), inset 8px 8px 14px rgba(255, 255, 255, .4); opacity: .4; }
.orbs .cherry { right: 30vw; bottom: 10vh; width: 40px; height: 40px; background: #ff5070; box-shadow: inset -6px -8px 12px rgba(120, 60, 0, .5), inset 5px 5px 10px rgba(255, 255, 255, .4); opacity: .35; }
button, input { font-family: inherit; }
button { color: inherit; }
input[type=range] { accent-color: var(--accent); }
@keyframes cdpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.flex1 { flex: 1; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* header */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--grain-fine), rgba(15, 17, 23, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hdr-in { max-width: 1320px; margin: 0 auto; padding: 12px clamp(14px, 3vw, 28px); display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.brand { font-family: 'Bagel Fat One', sans-serif; font-size: 24px; white-space: nowrap; line-height: 1; }
.brand em { color: var(--accent); font-style: normal; }
.dd { position: relative; }
.dd-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 17px; border: 1px solid rgba(255, 255, 255, .12); background: var(--raised); box-shadow: var(--clay); cursor: pointer; font-size: 14px; white-space: nowrap; }
.dd-btn b { font-weight: 600; }
.chev { color: var(--muted); font-size: 9px; }
.scrim { position: fixed; inset: 0; z-index: 1; }
.pop { position: absolute; top: 48px; left: 0; z-index: 2; background: var(--pop); border: 1px solid var(--line2); border-radius: 24px; box-shadow: 0 24px 60px rgba(4, 5, 10, .55); display: flex; flex-direction: column; }
.pop.right { left: auto; right: 0; }
.keypop { width: 300px; padding: 14px; gap: 12px; }
.keygrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.keygrid button { height: 38px; border-radius: 14px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid rgba(255, 255, 255, .08); background: var(--raised); }
.keygrid button.on { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.instpop { width: 220px; padding: 6px; gap: 2px; border-radius: 20px; }
.instpop button { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }
.instpop button.on { background: var(--on); color: var(--fg); }
.instpop button span { color: var(--accent); }
.vol { display: flex; align-items: center; gap: 8px; }
.vol input { width: 96px; }

/* segmented control */
.seg { display: flex; padding: 3px; background: var(--grain-fine), var(--bg); box-shadow: var(--well); border: 1px solid var(--line); border-radius: 17px; gap: 2px; }
.seg button { flex: 1; border: 0; border-radius: 12px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--on); color: var(--fg); }
.seg button.off { opacity: .35; }
.seg.sm { border-radius: 15px; }
.seg.sm button { padding: 5px 10px; font-size: 12px; border-radius: 10px; }

/* layout */
main { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 28px) 80px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--grain-card), var(--panel); border: 0; border-radius: 34px; box-shadow: var(--slab); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.row.transport { column-gap: 10px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.chooser { position: relative; flex: 3 1 560px; min-width: 0; gap: 18px; }
.aside { flex: 1 1 320px; min-width: 0; position: sticky; top: 84px; gap: 14px; }
h1, h2, h3 { margin: 0; font-family: Outfit, sans-serif; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 21px; white-space: nowrap; }
h2 { font-size: 25px; }
.aside h2 { font-size: 21px; }
.sub { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* buttons */
.btn { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .08); background: var(--raised); box-shadow: var(--clay); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.icon { width: 36px; padding: 0; justify-content: center; font-size: 17px; }
.btn.play { height: 44px; min-width: 92px; padding: 0 20px 0 16px; border: 0; background: var(--accent); color: var(--ink); box-shadow: var(--cherry); font-size: 15px; font-weight: 600; justify-content: center; }
.btn.gold { border-color: rgba(199, 176, 255, .45); background: transparent; box-shadow: none; color: var(--gold); font-weight: 600; }
.btn.rec { border-color: rgba(255, 90, 90, .5); background: transparent; box-shadow: none; color: #ff9c9c; font-weight: 600; }
.btn.rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); }
.btn.rec.on { background: var(--rec); color: var(--ink); border-color: var(--rec); }
.btn.rec.on i { border-radius: 2px; width: 8px; height: 8px; background: var(--ink); }
.pill { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #3a3d4e; }
.pill.on { background: var(--on); border-color: rgba(255, 80, 112, .45); color: var(--fg); }
.pill.on i { background: var(--dotc, var(--accent)); }
.pill.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.tempo { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--grain-fine), var(--bg); box-shadow: var(--well); border: 1px solid var(--line); }
.tempo input { width: 110px; }
.tempo b { font-weight: 600; color: var(--accent); min-width: 62px; }

/* timeline */
.tl-scroll { overflow-x: auto; padding-bottom: 2px; }
.tl { position: relative; }
.ruler { display: flex; height: 22px; }
.ruler div { flex: 1; font-size: 11px; font-weight: 500; color: var(--dim); padding-left: 6px; }
.lane { position: relative; height: 88px; border-radius: 20px; background: var(--grain-fine), var(--bg); box-shadow: var(--well); border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; }
.bars { position: absolute; inset: 0; display: flex; }
.bars div { flex: 1; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgba(255, 255, 255, .035) calc(25% - 1px), rgba(255, 255, 255, .035) 25%); }
.bars div:first-child { border-left: 0; }
.blk { position: absolute; top: 7px; bottom: 7px; margin-left: 3px; border-radius: 15px; border: 1.5px solid; cursor: pointer; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-width: 0; }
.blk .nm { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .num { font-size: 12px; color: var(--muted); white-space: nowrap; }
.blk .len { font-size: 11px; color: var(--muted); white-space: nowrap; }
.blk .tools { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 3px; }
.blk .tools button { width: 22px; height: 20px; border-radius: 9px; border: 0; background: rgba(4, 5, 10, .45); font-size: 11px; cursor: pointer; padding: 0; }
.blk .tools button:hover { background: rgba(4, 5, 10, .7); color: var(--accent); }
.blk .len { padding-right: 76px; overflow: hidden; text-overflow: ellipsis; }
.blk.narrow { padding-right: 30px; }
.blk.narrow .len { padding-right: 0; }
.blk.narrow .tools { flex-direction: column; right: 4px; bottom: 5px; }
.blk .grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; touch-action: none; }
.blk .grip.l { left: 0; }
.blk .grip.r { right: 0; }
.blk .grip:hover { background: rgba(199, 176, 255, .35); }
.next { position: absolute; top: 7px; bottom: 7px; margin-left: 3px; border-radius: 15px; border: 1.5px dashed rgba(255, 255, 255, .15); background: transparent; color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.next.on { border-color: rgba(199, 176, 255, .8); background: rgba(199, 176, 255, .08); color: var(--gold); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); box-shadow: 0 0 12px var(--gold); pointer-events: none; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; background: rgba(255, 80, 112, .08); border: 1px solid rgba(255, 80, 112, .35); border-radius: 20px; }
.selbar > b { font-size: 14px; font-weight: 600; color: var(--accent); }
.selbar .btn2 { height: 32px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--raised); box-shadow: var(--clay); font-size: 13px; cursor: pointer; }
.selbar .done { height: 32px; padding: 0 14px; border-radius: 14px; border: 0; background: var(--accent); color: var(--ink); box-shadow: var(--cherry); font-size: 13px; font-weight: 600; cursor: pointer; }

/* inversion control */
.seg.inv button { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 10px; line-height: 1.2; }
.seg.inv button small { font-size: 10px; opacity: .7; min-height: 12px; }

/* start point */
.ruler { position: relative; cursor: pointer; }
.ruler:hover { background: rgba(255, 255, 255, .03); border-radius: 8px; }
.cue { position: absolute; bottom: 0; width: 0; height: 0; margin-left: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--accent); pointer-events: none; }
.cueline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed rgba(255, 80, 112, .7); pointer-events: none; z-index: 2; }

/* saved progressions */
.savepop { width: 320px; padding: 14px; gap: 8px; z-index: 20; }
.libpop { width: 360px; max-height: 60vh; overflow-y: auto; padding: 6px; gap: 2px; z-index: 20; }
.libitem { display: flex; align-items: center; gap: 4px; border-radius: 14px; }
.libitem:hover { background: var(--on); }
.libitem .star { width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; flex: none; }
.libitem .star.on { color: var(--gold); }
.libload { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 7px 4px; display: flex; flex-direction: column; gap: 1px; }
.libload b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.libload small { font-size: 11px; color: var(--muted); }
.libdel { flex: none; height: 28px; min-width: 28px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.libdel:hover, .libdel.on { color: var(--accent); background: rgba(255, 80, 112, .12); }
.dontask { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.dontask input { accent-color: var(--accent); width: 16px; height: 16px; }

/* moves and chords options */
.opts-btn { height: 38px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line2); background: var(--raised); box-shadow: var(--clay); white-space: nowrap; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.opts-btn.on, .dd-btn.on, .dd .btn.on { border-color: rgba(255, 80, 112, .6); }
.dots { display: flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.optspop { position: absolute; left: 16px; right: 16px; margin-top: 8px; margin-left: auto; z-index: 31; max-width: 600px; padding: 16px; background: var(--pop); border: 1px solid var(--line2); border-radius: 24px; box-shadow: 0 24px 60px rgba(4, 5, 10, .55); display: flex; flex-direction: column; gap: 16px; }
.optsscrim { position: fixed; inset: 0; z-index: 30; }
.grp { display: flex; flex-direction: column; gap: 8px; }
.grp-h { display: flex; align-items: center; gap: 10px; }
.link { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.link.muted { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; flex: none; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: #3a3d4e; }
.chip.on { color: var(--fg); }
.chip small { opacity: .6; font-size: 12px; }
.optsfoot { display: flex; flex-wrap: wrap; gap: 14px 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.typed { display: flex; gap: 6px; }
.typed input { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line2); background: var(--grain-fine), var(--bg); box-shadow: var(--well); color: var(--fg); font: 500 13px Outfit, sans-serif; outline: none; }
.typed button { height: 34px; padding: 0 14px; border-radius: 15px; border: 0; background: var(--gold); color: var(--ink); box-shadow: var(--violet); font-size: 13px; font-weight: 600; cursor: pointer; }

/* recording banner */
.recbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border-radius: 20px; background: rgba(255, 90, 90, .1); border: 1px solid rgba(255, 90, 90, .45); }
.recbar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: cdpulse 1.2s ease-in-out infinite; }
.recbar b { font-weight: 600; color: #ff9c9c; }
.recbar .stop { height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--rec); color: var(--ink); box-shadow: var(--cherry); font-size: 13px; font-weight: 600; cursor: pointer; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed rgba(255, 255, 255, .12); border-radius: 20px; }

/* recording pad */
.pad { display: flex; flex-direction: column; gap: 16px; }
.padrow { display: flex; flex-direction: column; gap: 8px; }
.padkeys { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.padkey { height: 72px; border-radius: 20px; border: 2px solid var(--col); background: color-mix(in oklch, var(--col) 18%, #1c1f29); box-shadow: var(--clay); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.padkey b { font-size: 18px; font-weight: 700; }
.padkey small { font-size: 11px; color: #d9d9e8; }
.padkey:active { background: color-mix(in oklch, var(--col) 45%, #1c1f29); box-shadow: var(--well); transform: translateY(1px); }

/* map */
.zoombtn { width: 32px; height: 32px; border-radius: 14px; border: 1px solid var(--line2); background: var(--raised); box-shadow: var(--clay); font-size: 16px; cursor: pointer; }
.zoombtn.fit { width: auto; padding: 0 12px; color: var(--accent); font-size: 12px; font-weight: 600; }
.map { overflow-x: auto; overflow-y: hidden; border-radius: 24px; background: var(--grain-fine), radial-gradient(circle, rgba(200, 204, 230, .1) 1.2px, transparent 1.6px) 0 0 / 22px 22px, radial-gradient(ellipse at 20% 50%, #21242f 0%, #12141b 70%); border: 1px solid rgba(255, 255, 255, .06); }
.map-in { position: relative; }
.map-sc { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.colhead { position: absolute; top: 16px; width: 120px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.mnode { position: absolute; width: 110px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.mnode .box { position: relative; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; }
.mnode .shape { border: 2px solid; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.mnode .shape > span { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; }
.mnode .shape b { font-weight: 700; white-space: nowrap; }
.mnode .shape small { font-size: 9px; color: #d9d9e8; white-space: nowrap; }
.mnode .add { position: absolute; top: -8px; right: -10px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--gold); color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(4, 5, 10, .5); }
.mnode .feel { font-size: 11px; font-weight: 500; text-align: center; line-height: 1.25; }
.pnode { position: absolute; width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pnode .pbtn { position: relative; border-radius: 24px; border: 2px solid; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; }
.pnode .pbtn b { font-size: 15px; font-weight: 700; }
.pnode .pbtn small { font-size: 10px; color: #d9d9e8; }
.pnode .idx { position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pnode .plab { font-size: 11px; font-weight: 500; color: var(--muted); text-align: center; }
.pnode .rep { height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255, 80, 112, .5); background: transparent; color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer; }
.pnode .rep.on { background: var(--accent); color: var(--ink); }

/* cards */
.gcards { display: flex; flex-direction: column; gap: 22px; }
.ghead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ghead i { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.ghead b { font-size: 15px; font-weight: 600; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.ocard { display: flex; align-items: stretch; background: var(--raised); border: 1px solid rgba(255, 255, 255, .06); border-radius: 20px; overflow: hidden; min-height: 76px; }
.ocard.hot { background: var(--on); border-color: var(--gold); }
.ocard .pv { flex: 1; min-width: 0; text-align: left; padding: 10px 12px; background: transparent; border: 0; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.ocard .pv .t { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.ocard .pv .t b { font-size: 17px; font-weight: 600; }
.ocard .pv .t span { font-size: 13px; color: var(--muted); font-weight: 500; }
.ocard .pv .n { font-size: 12px; color: var(--muted); }
.ocard .pv .f { font-size: 12px; font-weight: 500; }
.ocard .ad { width: 44px; flex: none; border: 0; border-left: 1px solid rgba(255, 255, 255, .06); background: rgba(199, 176, 255, .08); color: var(--gold); font-size: 20px; font-weight: 500; cursor: pointer; }
.ocard .ad:hover { background: rgba(199, 176, 255, .2); }
.feelcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feelcol { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 24px; background: var(--sunk); border: 1px solid rgba(255, 255, 255, .05); }
.feelcol > div:first-child { display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 6px; }
.feelcol > div:first-child b { font-size: 15px; font-weight: 600; }
.feelcol > div:first-child span { font-size: 12px; color: var(--muted); }
.frow { display: flex; align-items: stretch; background: var(--raised); border: 1px solid rgba(255, 255, 255, .06); border-radius: 19px; overflow: hidden; }
.frow.hot { background: var(--on); border-color: var(--gold); }
.frow .pv { flex: 1; min-width: 0; text-align: left; padding: 8px 10px; background: transparent; border: 0; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.frow .pv > i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.frow .pv > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.frow .pv .t { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.frow .pv .t b { font-size: 15px; font-weight: 600; }
.frow .pv .t span { font-size: 12px; color: var(--muted); }
.frow .pv small { font-size: 11px; color: var(--muted); }
.frow .ad { width: 40px; flex: none; border: 0; border-left: 1px solid rgba(255, 255, 255, .06); background: rgba(199, 176, 255, .08); color: var(--gold); font-size: 18px; cursor: pointer; }

/* finish the phrase */
.sugbox { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 20px; background: var(--sunk); border: 1px solid rgba(255, 255, 255, .05); }
.sugbox .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.sugbox .chip { height: 28px; padding: 0 10px; font-weight: 600; }
.sugbox .chip small { font-weight: 500; opacity: .55; }
.suglist { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 330px); min-height: 240px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.sug { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 20px; background: var(--raised); border: 1px solid rgba(255, 255, 255, .06); }
.sug.on { background: var(--on); border-color: rgba(255, 80, 112, .5); }
.sug .sp { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid rgba(255, 80, 112, .4); background: transparent; color: var(--accent); font-size: 12px; cursor: pointer; }
.sug .cs { flex: 1; min-width: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.sug .cs div { display: flex; flex-direction: column; gap: 1px; }
.sug .cs b { font-size: 16px; font-weight: 600; }
.sug .cs small { font-size: 11px; color: var(--muted); }
.sug .use { height: 34px; padding: 0 14px; flex: none; border-radius: 999px; border: 0; background: var(--gold); color: var(--ink); box-shadow: var(--violet); font-size: 13px; font-weight: 600; cursor: pointer; }
.more { flex: none; height: 38px; border-radius: 20px; border: 1px dashed rgba(255, 255, 255, .16); background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; }
.nomatch { padding: 16px; border-radius: 20px; border: 1px dashed rgba(255, 255, 255, .14); color: #d9d9e8; font-size: 13px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.softbtn { border: 0; background: var(--on); box-shadow: var(--clay); color: var(--gold); height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* modal and toast */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(4, 5, 10, .62); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal > div { width: min(460px, 100%); background: var(--pop); border: 1px solid rgba(255, 205, 107, .4); border-radius: 31px; box-shadow: 0 30px 80px rgba(4, 5, 10, .6); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal .warn { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); font-weight: 600; }
.modal h3 { font-size: 22px; line-height: 1.35; }
.modal p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.modal .opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 20px; border: 1px solid var(--line2); background: var(--on); box-shadow: var(--clay); cursor: pointer; }
.modal .opt b { font-size: 14px; font-weight: 600; }
.modal .opt span { font-size: 12px; color: var(--muted); }
.modal .opt.main { border: 0; background: var(--gold); color: var(--ink); box-shadow: var(--violet); }
.modal .opt.main span { color: var(--ink); opacity: .75; }
.modal .anyway { align-self: center; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--on); border: 1px solid rgba(255, 255, 255, .12); font-size: 13px; font-weight: 500; box-shadow: 0 12px 40px rgba(4, 5, 10, .5); max-width: 90vw; text-align: center; }

@media (max-width: 720px) {
  .aside { position: static; }
  .suglist { max-height: none; }
}

/* welcome guide */
.dd-btn.guide { font-weight: 600; }
.wiz { position: fixed; inset: 0; z-index: 90; background: rgba(4, 5, 10, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.wiz-card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--grain-card), var(--pop); border: 1px solid var(--line2); border-radius: 31px; box-shadow: 0 30px 80px rgba(4, 5, 10, .6); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.wiz-card h3 { font-size: 24px; padding-right: 36px; }
.wiz-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--raised); box-shadow: var(--clay); font-size: 14px; cursor: pointer; }
.wiz-dots { display: flex; gap: 6px; }
.wiz-dots i { width: 28px; height: 5px; border-radius: 3px; background: var(--on); }
.wiz-dots i.on { background: var(--accent); }
.wiz-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wiz-nav .btn { height: 44px; padding: 0 18px; font-size: 14px; }
.wiz-nav .btn:disabled { opacity: .4; }
.wiz .seg button { padding: 9px 12px; font-size: 14px; }
.wiz-keys button { height: 46px; font-size: 15px; }
.wiz-chords { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wiz-chord { height: 76px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .1); background: var(--raised); box-shadow: var(--clay); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: manipulation; }
.wiz-chord b { font-size: 20px; font-weight: 700; }
.wiz-chord small { font-size: 12px; color: var(--muted); }
.wiz-chord.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 22%, #1c1f29); }
.wiz-ends { display: flex; flex-direction: column; gap: 8px; }
.wiz-end-row { display: flex; align-items: center; gap: 8px; }
.wiz-use { flex: none; justify-content: center; height: 40px; padding: 0 14px; font-size: 13px; }
.wiz-end-row { flex-wrap: wrap; }
.wiz-end { display: flex; flex-direction: column; gap: 0; padding: 6px; border-radius: 20px; background: var(--raised); border: 2px solid rgba(255, 255, 255, .06); }
.wiz-end.on { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 16%, #1c1f29); }
.wiz-end .sp { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid rgba(255, 80, 112, .4); background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
.wiz-end-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; border: 0; background: transparent; cursor: pointer; padding: 6px 8px; text-align: left; min-height: 44px; }
.wiz-end-pick > span { display: flex; flex-direction: column; }
.wiz-end-pick b { font-size: 17px; font-weight: 700; }
.wiz-end-pick small { font-size: 11px; color: var(--muted); }
.wiz-end-pick .wiz-first { color: var(--muted); font-size: 17px; font-weight: 600; }
.wiz-prog { display: flex; gap: 10px; }
.wiz-prog span { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 6px; border-radius: 18px; background: var(--raised); box-shadow: var(--clay); }
.wiz-prog b { font-size: 20px; font-weight: 700; }
.wiz-prog small { font-size: 12px; color: var(--muted); }
.wiz-big { align-self: center; min-width: 160px; }
/* Room below the page during the tour, so the last part can scroll up above the tour card. */
body.touring main { padding-bottom: 70vh; }
/* The tour leaves the page usable: only the card takes clicks, and it sits at the bottom. */
.wiz.tour { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; align-items: flex-end; pointer-events: none; }
.wiz.tour .wiz-card { pointer-events: auto; width: min(460px, 100%); gap: 10px; padding: 20px; }
.wiz.tour .wiz-card h3 { font-size: 20px; }
.tour-hl { outline: 3px solid var(--accent) !important; outline-offset: 6px; border-radius: 24px; box-shadow: 0 0 0 9999px rgba(4, 5, 10, .45), 0 0 40px rgba(255, 80, 112, .45) !important; position: relative; z-index: 50; transition: outline-offset .2s; }
@media (max-width: 600px) {
  .wiz { align-items: flex-end; padding: 0; }
  .wiz-card { width: 100%; border-radius: 28px 28px 0 0; max-height: 88dvh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .wiz.tour .wiz-card { width: 100%; border-radius: 24px 24px 0 0; }
  .wiz-card h3 { font-size: 21px; }
  .wiz-nav .btn { flex: 1; justify-content: center; }
  .wiz-nav .btn.play:last-child { flex-basis: 100%; order: -1; }
  .wiz-nav .flex1 { display: none; }
  .wiz-end-pick { gap: 10px; }
  .wiz-use { flex-basis: 100%; height: 42px; }
}

/* ---------------- Interaction and motion ---------------- */
/* Hover lifts and brightens, press pushes in. Individual translate/scale properties are used so they combine with
   transforms set inline (the diamond map nodes are rotated). */
button, .blk, .sug, .ocard, .frow, .libitem, .wiz-end, .ruler, .next { transition: translate .14s ease, scale .14s ease, background-color .16s ease, border-color .16s ease, box-shadow .18s ease, color .16s ease, filter .16s ease, opacity .16s ease; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn:not(:disabled):hover, .dd-btn:hover, .opts-btn:hover, .zoombtn:hover, .softbtn:hover, .selbar .btn2:hover, .wiz-x:hover { translate: 0 -1px; border-color: rgba(255, 255, 255, .22); filter: brightness(1.12); }
.btn.play:not(:disabled):hover, .selbar .done:hover, .recbar .stop:hover { filter: brightness(1.08) saturate(1.1); box-shadow: var(--cherry), 0 0 26px rgba(255, 80, 112, .45); }
.btn.gold:hover { background: rgba(199, 176, 255, .1); border-color: rgba(199, 176, 255, .7); }
.btn.rec:not(.on):hover { background: rgba(255, 90, 90, .1); border-color: rgba(255, 90, 90, .8); }
.btn:not(:disabled):active, .dd-btn:active, .opts-btn:active, .zoombtn:active, .softbtn:active, .selbar .btn2:active, .selbar .done:active, .wiz-x:active, .recbar .stop:active { translate: 0 1px; scale: .97; box-shadow: var(--well); filter: brightness(.95); }

.pill:hover { border-color: rgba(255, 255, 255, .25); color: var(--fg); }
.pill:active, .chip:active, .seg button:active, .keygrid button:active, .instpop button:active { scale: .95; }
.chip:hover { border-color: rgba(255, 255, 255, .28); color: var(--fg); filter: brightness(1.15); }
.seg button:not(.on):hover { color: var(--fg); background: rgba(255, 255, 255, .05); }
.keygrid button:not(.on):hover { background: var(--on); border-color: rgba(255, 255, 255, .2); translate: 0 -1px; }
.instpop button:not(.on):hover { background: rgba(255, 255, 255, .05); color: var(--fg); }
.link:hover { filter: brightness(1.25); text-decoration: underline; }

/* Timeline */
.blk:hover { filter: brightness(1.15); translate: 0 -2px; box-shadow: 0 8px 20px rgba(4, 5, 10, .5); }
.blk:active { translate: 0 0; scale: .98; }
.blk .tools button:hover { scale: 1.12; }
.blk .tools button:active { scale: .9; }
.blk.playing { filter: brightness(1.25) saturate(1.2); box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(199, 176, 255, .5) !important; }
.next:hover { background: rgba(199, 176, 255, .14); border-style: solid; color: var(--gold); }
.next:active { scale: .97; }
.ruler:hover div { color: var(--fg); }
.playhead { transition: left .04s linear; }

/* Map */
.mnode .shape:hover { scale: 1.1; filter: brightness(1.2); }
.mnode .shape:active { scale: .94; }
.mnode .add:hover { scale: 1.2; box-shadow: 0 0 14px rgba(199, 176, 255, .8); }
.mnode .add:active { scale: .9; }
.pnode .pbtn:hover { scale: 1.06; filter: brightness(1.15); }
.pnode .pbtn:active { scale: .95; }
.pnode .rep:hover { background: rgba(255, 80, 112, .15); }
.map svg path { transition: opacity .15s ease, stroke-width .15s ease; }

/* Cards, By feel, endings, saved list */
.ocard:hover, .frow:hover { border-color: rgba(255, 255, 255, .18); translate: 0 -2px; box-shadow: 0 10px 22px rgba(4, 5, 10, .45); }
.ocard .pv:active, .frow .pv:active { scale: .98; }
.ocard .ad:active, .frow .ad:active { scale: .92; }
.sug:hover { border-color: rgba(255, 255, 255, .16); translate: 0 -1px; }
.sug .sp:hover { background: rgba(255, 80, 112, .14); scale: 1.08; }
.sug .sp:active { scale: .92; }
.sug .use:hover, .typed button:hover, .modal .opt.main:hover, .wiz-use:hover { filter: brightness(1.08); box-shadow: var(--violet), 0 0 22px rgba(199, 176, 255, .45); translate: 0 -1px; }
.sug .use:active, .typed button:active, .wiz-use:active { scale: .95; translate: 0 1px; }
.more:hover { border-style: solid; background: rgba(255, 255, 255, .04); }
.libitem .star:hover { scale: 1.2; color: var(--gold); }
.modal .opt:hover { translate: 0 -1px; filter: brightness(1.1); }
.modal .opt:active { scale: .98; }

/* Recording pad and guide */
.padkey:hover { filter: brightness(1.18); translate: 0 -2px; }
.padkey:active { scale: .94; translate: 0 1px; }
.wiz-chord:hover { translate: 0 -2px; filter: brightness(1.15); border-color: rgba(255, 255, 255, .22); }
.wiz-chord:active { scale: .95; }
.wiz-end:hover { border-color: rgba(255, 255, 255, .16); }
.wiz-end .sp:hover { background: rgba(255, 80, 112, .14); scale: 1.06; }

/* Entrances */
@keyframes cd-pop { from { opacity: 0; scale: .82; } 60% { opacity: 1; scale: 1.04; } to { opacity: 1; scale: 1; } }
@keyframes cd-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes cd-drop { from { opacity: 0; translate: 0 -6px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes cd-sheet { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
.blk.enter, .mnode.enter, .pnode.enter, .padkey.enter, .wiz-chord.enter { animation: cd-pop .36s cubic-bezier(.2, .8, .3, 1.2) backwards; }
.sug.enter, .ocard.enter, .frow.enter, .wiz-end.enter, .selbar.enter, .recbar.enter, .empty.enter, .nomatch.enter { animation: cd-rise .3s ease-out backwards; }
.pop.enter, .optspop.enter { animation: cd-drop .18s ease-out backwards; transform-origin: top; }
.modal > div.enter, .wiz-card.enter { animation: cd-sheet .26s cubic-bezier(.2, .8, .3, 1) backwards; }
.toast.enter { animation: cd-sheet .24s ease-out backwards; }

/* Live while playing */
@keyframes cd-pulse { 0%, 100% { box-shadow: var(--cherry); } 50% { box-shadow: var(--cherry), 0 0 30px rgba(255, 80, 112, .65); } }
.btn.play.is-playing { animation: cd-pulse 1.6s ease-in-out infinite; }
@keyframes cd-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
.orbs .moon { animation: cd-float 14s ease-in-out infinite; }
.orbs .plum { animation: cd-float 9s ease-in-out infinite reverse; }
.orbs .cherry { animation: cd-float 11s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Sliding highlight in segmented controls */
.seg { position: relative; }
.seg > button { position: relative; z-index: 1; }
.seg > button.on { background: transparent; }
.seg-thumb { position: absolute; z-index: 0; border-radius: 12px; background: var(--on); box-shadow: 0 2px 8px rgba(4, 5, 10, .35); pointer-events: none; }
.seg.sm .seg-thumb { border-radius: 10px; }
.seg-thumb.moving { transition: left .28s cubic-bezier(.2, .8, .3, 1.1), width .28s cubic-bezier(.2, .8, .3, 1.1); }

/* All / Default presets in Moves & chords: highlighted only when the choices match */
.presets { display: flex; gap: 4px; }
.preset { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.preset:hover { color: var(--fg); border-color: rgba(255, 255, 255, .25); }
.preset.on { background: var(--on); border-color: rgba(255, 80, 112, .5); color: var(--fg); font-weight: 600; }
.preset:active { scale: .95; }

/* Arpeggios in the timeline: a direction mark after the name, and one dot per note that lights as it plays */
.arpmark { margin-left: 5px; font-size: 13px; color: var(--gold); }
.arpdots { display: flex; gap: 3px; margin-top: 3px; }
.arpdots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(199, 176, 255, .28); transition: background .08s, scale .08s, box-shadow .08s; }
.arpdots i.lit { background: var(--gold); scale: 1.35; box-shadow: 0 0 8px var(--gold); }

/* Arpeggio button on each chord, and its menu */
.blk .tools .arpbtn { display: flex; align-items: center; justify-content: center; }
.blk .tools .arpbtn.on { color: var(--gold); }
.blk .tools .arpbtn.open { background: var(--gold); color: var(--ink); }
.arppop { position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px)); padding: 16px; gap: 10px; }
.arppop > b { font-size: 14px; font-weight: 700; }
.arppop .seg { flex-wrap: wrap; }
.arppop .chips { gap: 6px; }
.arppop .lbl { margin-top: 4px; }
