:root {
  --deep: #095C60;
  --teal: #63ADAE;
  --white: #ffffff;
  --ink: #000000;
  --bg: #070a0a;
  --panel: #0d1414;
  --card: rgba(13, 20, 20, 0.7);
  --line: rgba(99, 173, 174, 0.18);
  --muted: rgba(255, 255, 255, 0.55);
  --faint: rgba(255, 255, 255, 0.08);
  --amber: #e9b15a;
  --danger: #f66;
  --fraktur: 'UnifrakturMaguntia', 'Old English Text MT', serif;
  --ui: 'Space Grotesk', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ctrl: 250px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(9, 92, 96, 0.32), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(99, 173, 174, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
header.top { display: flex; align-items: center; gap: 14px; padding: 22px clamp(18px, 4vw, 48px); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand svg { width: 34px; height: 34px; transition: transform 1.2s var(--ease); }
.brand:hover svg { transform: rotate(200deg); }
.brand .word { font-family: var(--fraktur); font-size: 34px; line-height: 1; letter-spacing: .5px; }
.brand .sub { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--teal); border-left: 1px solid var(--line); padding-left: 12px; margin-left: 2px; }
.me-chip {
  display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: transparent;
  border-radius: 999px; padding: 5px 14px 5px 6px; font-size: 13px; transition: border-color .15s;
}
.me-chip:hover { border-color: var(--teal); }
.me-chip .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--deep); display: grid; place-items: center; color: var(--white); }
.me-chip .ic svg { width: 15px; height: 15px; }
.me-chip small { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.btn {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 9px 18px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--teal); }
.btn.solid { background: var(--white); color: var(--deep); border-color: var(--white); font-weight: 700; }
.btn.solid:hover { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.btn.sm { padding: 6px 12px; font-size: 11px; }

main { padding: 0 clamp(18px, 4vw, 48px) 60px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 22px; margin-top: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; padding: 3px 8px; border-radius: 8px; }
.crumbs a:hover { color: var(--white); }
.crumbs span { opacity: .5; }

.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 6px 0 26px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-family: var(--fraktur); font-weight: 400; font-size: clamp(44px, 7vw, 84px); line-height: 1; word-break: break-word; }
.page-title p { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 56ch; line-height: 1.5; }
.page-title .meta-line { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.title-tools { display: flex; gap: 6px; margin-top: 12px; }
.title-tools button, .mini {
  background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 5px 12px;
}
.title-tools button:hover, .mini:hover { color: var(--white); border-color: var(--teal); }
.title-tools button.danger:hover, .mini.danger:hover { border-color: #c44; color: var(--danger); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- gigs grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  position: relative; text-align: left; border: 1px solid var(--line); background: var(--card);
  border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 18px; min-height: 270px;
  transition: border-color .2s, transform .25s var(--ease), background .2s; text-decoration: none; color: inherit;
  animation: rise .7s var(--ease) both;
}
.card:hover { border-color: var(--teal); transform: translateY(-3px); background: rgba(13, 26, 26, 0.9); }
.card h3 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.15; word-break: break-word; }
.card .when { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; display: block; }
.card .meta { margin-top: auto; display: flex; gap: 14px; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; flex-wrap: wrap; }
.card .stack { position: relative; width: 150px; height: 110px; }
.card .stack svg { position: absolute; top: 0; width: 110px; height: 110px; transition: transform .4s var(--ease); }
.card .stack svg:nth-child(1) { left: 0; }
.card .stack svg:nth-child(2) { left: 15px; opacity: .55; color: var(--teal); }
.card .stack svg:nth-child(3) { left: 30px; opacity: .3; }
.card:hover .stack svg:nth-child(2) { transform: translateX(10px); }
.card:hover .stack svg:nth-child(3) { transform: translateX(20px); }
.card.new { align-items: center; justify-content: center; border-style: dashed; color: var(--teal); gap: 8px; }
.card.new .plus { font-size: 40px; line-height: 1; font-weight: 300; }
.card.new span:last-child { letter-spacing: .2em; text-transform: uppercase; font-size: 12px; }
.card.past { opacity: .62; }
.card.past:hover { opacity: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.section-label { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin: 34px 0 14px; }

/* ---------- setlist ---------- */
.setlist { display: flex; flex-direction: column; gap: 8px; }
.song-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto auto; align-items: center; gap: 18px;
  border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 18px;
  text-decoration: none; color: inherit; transition: border-color .15s, background .15s, transform .2s var(--ease);
}
.song-row:hover { border-color: var(--teal); background: rgba(13, 26, 26, 0.9); }
.song-row.dragging { opacity: .35; }
.song-row.drop-before { box-shadow: 0 -3px 0 var(--teal); }
.song-row.drop-after { box-shadow: 0 3px 0 var(--teal); }
.song-row .num { font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 300; color: var(--teal); text-align: center; cursor: grab; }
.song-row .ttl { font-size: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row .stems { display: flex; gap: 4px; margin-top: 6px; color: var(--muted); }
.song-row .stems svg { width: 15px; height: 15px; }
.song-row .tags { display: flex; gap: 6px; }
.song-row .dur { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 42px; text-align: right; }
.song-row .row-tools { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.song-row:hover .row-tools, .song-row:focus-within .row-tools { opacity: 1; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--muted); display: grid; place-items: center; padding: 0; font-size: 13px; }
.icon-btn:hover { border-color: var(--line); color: var(--white); }
.icon-btn.danger:hover { border-color: #c44; color: var(--danger); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.add-row {
  display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px dashed var(--line); border-radius: 16px;
  padding: 18px; color: var(--teal); background: transparent; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; width: 100%;
}
.add-row:hover { border-color: var(--teal); background: rgba(99,173,174,.05); }
.empty { color: var(--muted); font-size: 14px; margin: 10px 0 18px; }

.tag {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; letter-spacing: .08em;
  color: var(--teal); background: transparent; font-variant-numeric: tabular-nums; white-space: nowrap;
}
button.tag:hover { border-color: var(--teal); }
.tag.ncount { color: var(--white); }
.tag.ncount b { color: var(--teal); font-weight: 500; }

/* ---------- song / study view ---------- */
.study-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; flex-wrap: wrap; }
.study-head h1 { margin: 0 8px 0 0; font-size: clamp(26px, 3.6vw, 44px); font-weight: 500; line-height: 1.05; }
.study-head .setnum { font-family: var(--fraktur); font-size: clamp(30px, 4vw, 50px); color: var(--teal); line-height: 1; margin-right: 4px; }
.study-head .nav { margin-left: auto; display: flex; gap: 6px; }

.study { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--card); }

.mixer-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mixer-tools .label { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--teal); margin-right: 6px; }
.mixer-tools .spacer { flex: 1; }
.pill {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 13px; font-size: 12px; letter-spacing: .06em;
  color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s, border-color .15s;
}
.pill svg { width: 14px; height: 14px; }
.pill:hover { color: var(--white); border-color: var(--teal); }
.pill.on { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.pill:disabled { opacity: .35; pointer-events: none; }

.board { position: relative; padding: 6px 16px 14px; user-select: none; -webkit-user-select: none; }
.brow { display: grid; grid-template-columns: var(--ctrl) minmax(0, 1fr); gap: 16px; align-items: center; }
.brow + .brow { margin-top: 6px; }
.lane { position: relative; height: 100%; cursor: text; touch-action: none; }
.lane canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ruler-row { height: 44px; }
.ruler { height: 44px; cursor: pointer; }
.ruler .tick { position: absolute; bottom: 2px; font-size: 10px; color: var(--muted); transform: translateX(-50%); font-variant-numeric: tabular-nums; pointer-events: none; }
.ruler .tick::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 4px; background: rgba(255,255,255,.25); }
.ruler .sec {
  position: absolute; top: 0; transform: translateX(0); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--deep); color: var(--white); border-radius: 0 6px 6px 0; padding: 2px 7px 2px 6px; border-left: 2px solid var(--teal);
  white-space: nowrap; pointer-events: auto; cursor: pointer; max-width: 140px; overflow: hidden; text-overflow: ellipsis; z-index: 2;
}
.ruler .sec:hover { background: var(--teal); color: var(--ink); }
.ruler .pin {
  position: absolute; top: 19px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--white); border: 2px solid var(--bg); pointer-events: auto; cursor: pointer; z-index: 3; transition: transform .15s;
}
.ruler .pin.mine { background: var(--teal); }
.ruler .pin:hover { transform: rotate(-45deg) scale(1.35); }
.ruler .pin.active { box-shadow: 0 0 0 4px rgba(99,173,174,.35); }

.ov-row { height: 74px; }
.clock { display: flex; flex-direction: column; gap: 2px; }
.clock > b { font-size: 30px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1; }
.clock > b small { font-size: 16px; color: var(--muted); }
.clock > span { font-size: 12px; color: var(--muted); letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.overview { border-radius: 12px; background: rgba(0,0,0,.35); overflow: hidden; }
.overview .played { clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0); }

.track { height: 58px; }
.tctrl { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 5px; align-items: center; }
.tctrl .tic {
  grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--deep); color: var(--white);
  display: grid; place-items: center; padding: 0; transition: background .15s, color .15s, opacity .15s, border-color .15s; position: relative;
}
.tctrl .tic svg { width: 19px; height: 19px; }
.tctrl .tic .lvl { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; pointer-events: none; }
.track.off .tic { background: transparent; color: var(--muted); }
.track.mine .tic { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(99,173,174,.25); }
.tctrl .tname { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tctrl .tname small { color: var(--teal); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin-left: 6px; }
.track.off .tname { color: var(--muted); }
.tctrl .ms { display: flex; gap: 4px; }
.ms button {
  width: 26px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: transparent; font-size: 11px; font-weight: 700;
  color: var(--muted); padding: 0; transition: background .12s, color .12s, border-color .12s;
}
.ms button:hover { border-color: var(--teal); color: var(--white); }
.ms button.m.on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.ms button.s.on { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.tctrl .vol { grid-column: 2 / 4; }
.track .lane { border-radius: 10px; background: rgba(0,0,0,.22); overflow: hidden; }
.track.off .lane canvas { opacity: .25; }

input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; margin: 0; cursor: pointer; }
input[type=range].slider::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--teal) 0 var(--v, 66%), rgba(255,255,255,.14) var(--v, 66%)); }
input[type=range].slider::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255,255,255,.14); }
input[type=range].slider::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--teal); }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--white); margin-top: -5px; border: none; box-shadow: 0 2px 6px rgba(0,0,0,.6); }
input[type=range].slider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--white); border: none; }
input[type=range].slider:focus-visible { outline: 1px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* overlay across the lanes: playhead, loop, note lines */
.ov { position: absolute; top: 6px; bottom: 14px; right: 16px; left: calc(16px + var(--ctrl) + 16px); pointer-events: none; }
.ov .ph { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--white); left: calc(var(--p, 0) * 100%); box-shadow: 0 0 10px rgba(255,255,255,.4); z-index: 4; }
.ov .ph::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--white); border-bottom: 0; }
.ov .loop { position: absolute; top: 44px; bottom: 0; background: rgba(99,173,174,.13); border-left: 1px solid var(--teal); border-right: 1px solid var(--teal); z-index: 1; }
.ov .loop.off { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.3); border-style: dashed; }
.ov .loop .h { position: absolute; top: 0; width: 14px; height: 22px; background: var(--teal); border-radius: 0 0 4px 4px; pointer-events: auto; cursor: ew-resize; font-size: 10px; font-weight: 700; color: var(--ink); display: grid; place-items: center; }
.ov .loop .h.a { left: -7px; }
.ov .loop .h.b { right: -7px; }
.ov .loop.off .h { background: rgba(255,255,255,.4); }
.ov .nline { position: absolute; top: 44px; bottom: 0; width: 1px; background: rgba(255,255,255,.13); }
.ov .nline.sec { background: rgba(99,173,174,.45); }

/* transport */
.transport {
  position: sticky; bottom: 14px; z-index: 10; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 22px;
  background: rgba(10, 16, 16, .92); backdrop-filter: blur(10px); box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.tp-group { display: flex; align-items: center; gap: 6px; }
.tp-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; padding: 0; color: var(--white); transition: border-color .15s, background .15s; }
.tp-btn:hover { border-color: var(--teal); }
.tp-btn svg { width: 17px; height: 17px; fill: currentColor; }
.tp-btn.play { width: 54px; height: 54px; background: var(--white); color: var(--deep); border-color: var(--white); }
.tp-btn.play:hover { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.tp-btn.play svg { width: 22px; height: 22px; }
.tp-sep { width: 1px; height: 30px; background: var(--line); }
.tp-label { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.speed { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.speed .slider { width: 110px; }
.speed output { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 88px; }
.speed output small { color: var(--muted); }
.loop-info { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.tp-grow { flex: 1; }

/* notes */
.notes { position: sticky; top: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 28px); }
.notes-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.notes-head h2 { margin: 0; font-family: var(--fraktur); font-weight: 400; font-size: 34px; line-height: 1; }
.notes-head .count { color: var(--muted); font-size: 12px; letter-spacing: .14em; }
.composer { margin: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.3); padding: 10px 12px; transition: border-color .15s; }
.composer:focus-within { border-color: var(--teal); }
.composer-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.tchip {
  border: 1px solid var(--teal); border-radius: 999px; background: transparent; color: var(--teal); padding: 3px 10px; font-size: 12px;
  font-variant-numeric: tabular-nums; display: inline-flex; gap: 6px; align-items: center;
}
.tchip.live { border-style: dashed; color: var(--muted); border-color: var(--line); }
.tchip:hover { color: var(--white); }
.kind { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: auto; }
.kind button { background: none; border: none; padding: 3px 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kind button.on { background: var(--white); color: var(--deep); font-weight: 700; }
.composer textarea {
  width: 100%; resize: none; border: none; background: transparent; outline: none; font-size: 14px; line-height: 1.45; min-height: 44px; padding: 2px 0;
}
.composer textarea::placeholder { color: rgba(255,255,255,.35); }
.composer-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.composer-foot label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.composer-foot label input { accent-color: var(--teal); }
.composer-foot .hint { font-size: 11px; color: rgba(255,255,255,.35); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px 8px; }
.filters .pill { padding: 4px 10px; font-size: 11px; }
.note-list { list-style: none; margin: 0; padding: 4px 10px 14px; overflow: auto; flex: 1; min-height: 120px; }
.note {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 8px; border-radius: 12px;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.note + .note { margin-top: 2px; }
.note:hover { background: rgba(255,255,255,.035); }
.note.active { border-color: var(--teal); background: rgba(99,173,174,.08); }
.note .when {
  grid-row: 1 / 3; align-self: start; border: 1px solid var(--line); background: rgba(0,0,0,.35); border-radius: 8px; padding: 4px 7px;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--teal); min-width: 50px; text-align: center; line-height: 1.25;
}
.note .when:hover { border-color: var(--teal); color: var(--white); }
.note .when small { display: block; font-size: 10px; color: var(--muted); }
.note .who { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); letter-spacing: .04em; min-width: 0; }
.note .who svg { width: 13px; height: 13px; flex: none; color: var(--teal); }
.note .who b { color: var(--white); font-weight: 500; }
.note .who .ago { margin-left: auto; white-space: nowrap; }
.note .text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.note.section .text { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--white); font-weight: 700; }
.note.section .when { background: var(--deep); border-color: var(--teal); color: var(--white); }
.note .tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; opacity: 0; background: var(--panel); border-radius: 999px; }
.note:hover .tools, .note:focus-within .tools { opacity: 1; }
.note .tools .icon-btn { width: 26px; height: 26px; }
.note textarea.edit { grid-column: 2; width: 100%; background: rgba(0,0,0,.4); border: 1px solid var(--teal); border-radius: 10px; padding: 8px 10px; outline: none; resize: vertical; min-height: 60px; font-size: 14px; }
.notes-empty { color: var(--muted); font-size: 13px; padding: 18px 12px; line-height: 1.55; }
.notes-empty kbd, .kbd { font-family: var(--ui); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--white); }

.shortcuts { margin-top: 16px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }

.loading { padding: 60px 20px; text-align: center; color: var(--teal); letter-spacing: .2em; text-transform: uppercase; font-size: 12px; }
.loading .bar { width: 220px; height: 4px; margin: 14px auto 0; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.loading .bar i { display: block; height: 100%; background: var(--teal); width: 0; transition: width .2s; }
.warn { color: var(--amber); font-size: 13px; padding: 10px 16px; }

/* ---------- dialogs ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--white);
  width: min(660px, calc(100vw - 32px)); padding: 28px; max-height: calc(100vh - 40px);
}
dialog.narrow { width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 6px; font-family: var(--fraktur); font-weight: 400; font-size: 42px; }
dialog .lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--teal); white-space: nowrap; }
.field input, .field select {
  background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; width: 100%;
}
.field select option { background: var(--panel); }
.field input:focus, .field select:focus { border-color: var(--teal); }
.row { display: flex; gap: 12px; }
.row .field.grow { flex: 1; }
.row .field.bpm { width: 170px; }
.row .field.key { width: 140px; }
.bpm-input { display: flex; gap: 4px; }
.bpm-input input { flex: 1; min-width: 0; }
.hx { width: 34px; border: 1px solid var(--line); background: transparent; border-radius: 10px; color: var(--muted); font-size: 12px; padding: 0; flex: none; }
.hx:hover { border-color: var(--teal); color: var(--white); }
.status { color: var(--muted); letter-spacing: .06em; text-transform: none; font-size: 10px; margin-left: 4px; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.inst-grid button {
  border: 1px solid var(--line); background: transparent; border-radius: 14px; padding: 12px 6px 10px; display: flex; flex-direction: column;
  align-items: center; gap: 7px; font-size: 12px; color: var(--muted); transition: border-color .15s, background .15s, color .15s;
}
.inst-grid button svg { width: 22px; height: 22px; }
.inst-grid button:hover { border-color: var(--teal); color: var(--white); }
.inst-grid button.on { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.drop { border: 1.5px dashed var(--line); border-radius: 16px; padding: 24px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; font-size: 14px; line-height: 1.6; }
.drop.over, .drop:hover { border-color: var(--teal); background: rgba(99,173,174,.06); color: var(--white); }
.drop b { color: var(--teal); font-weight: 500; }
.files { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
.files li { display: flex; align-items: center; gap: 10px; }
.files li .ic { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.files li .ic svg { width: 17px; height: 17px; }
.files li select.type {
  width: 116px; background: transparent; color: var(--teal); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; outline: none;
}
.files li select.type option { background: var(--panel); color: var(--white); }
.files li input { flex: 1; min-width: 0; background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; outline: none; }
.files li input:focus { border-color: var(--teal); }
.files li small { color: var(--muted); font-size: 11px; width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li button { background: none; border: none; color: var(--muted); font-size: 18px; }
.files li button:hover { color: var(--danger); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.dialog-note { color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.5; }
.sep { margin-top: 14px; border: 1px solid var(--teal); border-radius: 16px; padding: 14px 16px; background: rgba(99,173,174,.07); }
.sep-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.sep-text { font-size: 13px; line-height: 1.45; }
.sep-text b { color: var(--teal); font-weight: 500; }
.sep-text small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.sep-run { margin-top: 12px; }
.sep-run .sep-row span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sep-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 8px; }
.sep-bar i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .3s; }
.sep-bar.indet i { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.glyph-svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.glyph-svg .f { fill: currentColor; stroke: none; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--white); color: #000;
  padding: 9px 16px; border-radius: 999px; font-size: 13px; z-index: 30; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  transition: opacity .3s; pointer-events: none;
}

@media (max-width: 1100px) {
  .study { grid-template-columns: 1fr; }
  .notes { position: static; max-height: none; }
  .note-list { max-height: 480px; }
}
@media (max-width: 700px) {
  :root { --ctrl: 132px; }
  .tctrl { grid-template-columns: 32px minmax(0, 1fr); }
  .tctrl .tic { width: 32px; height: 32px; }
  .tctrl .ms { grid-column: 2; grid-row: 2; }
  .tctrl .vol { display: none; }
  .clock > b { font-size: 22px; }
  .song-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .song-row .tags, .song-row .row-tools { display: none; }
  .row { flex-wrap: wrap; }
  .row .field.grow { flex-basis: 100%; }
  .speed { min-width: 0; }
  .tp-grow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- auth ---------- */
.auth { width: min(460px, 100%); margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-logo { width: 110px; height: 110px; animation: spin-in 1.4s var(--ease) both; }
@keyframes spin-in { from { transform: rotate(-200deg); opacity: 0; } to { transform: none; opacity: 1; } }
.auth h1 { font-family: var(--fraktur); font-weight: 400; font-size: clamp(48px, 8vw, 72px); margin: 18px 0 6px; line-height: 1; }
.auth .lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 22px; max-width: 40ch; }
.auth-tabs { margin: 0 0 18px; }
.auth-tabs button { padding: 7px 18px; font-size: 12px; }
.auth form { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 22px; padding: 22px; }
.auth form .btn { width: 100%; margin-top: 4px; padding: 12px; }
.auth:not(.register) .reg-only { display: none; }
.auth-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.sync { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.upload-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 12px; }
.upload-bar i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s; }

/* ---------- header right ---------- */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.admin-link.on { border-color: var(--teal); color: var(--teal); }
.auth-foot { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.members-line { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.members-line .who-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 6px; color: var(--white); }
.members-line .who-chip svg { width: 13px; height: 13px; color: var(--teal); }
.mix-hint { font-size: 12px; color: var(--muted); }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 22px; align-items: start; }
.admin-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.admin-head h2 { margin: 0; font-family: var(--fraktur); font-weight: 400; font-size: 34px; }
.admin-list { padding: 0 10px 12px; }
.arow {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px;
  border: 1px solid transparent; background: none; width: 100%; text-align: left; transition: background .15s, border-color .15s;
}
.arow:hover { background: rgba(255,255,255,.035); border-color: var(--line); }
.arow .av { width: 36px; height: 36px; border-radius: 50%; background: var(--deep); display: grid; place-items: center; color: var(--white); }
.arow .av svg { width: 18px; height: 18px; }
.arow .av.gig { background: transparent; color: var(--teal); }
.arow .av.gig svg { width: 30px; height: 30px; }
.arow .t { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .t .badge { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(233,177,90,.4); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.arow .s { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .r { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-align: right; white-space: nowrap; }
.admin-empty { color: var(--muted); font-size: 13px; padding: 10px 12px 16px; line-height: 1.5; }
.check-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: rgba(0,0,0,.25); }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--white); white-space: normal; }
.check-list label:hover { background: rgba(255,255,255,.04); }
.check-list label input { accent-color: var(--teal); width: 16px; height: 16px; }
.check-list label small { color: var(--muted); font-size: 12px; margin-left: auto; }
.check-list label svg { width: 15px; height: 15px; color: var(--teal); }
.check-list .none { color: var(--muted); font-size: 13px; padding: 6px 8px; }
.danger-text:hover { border-color: #c44 !important; color: var(--danger); }

/* ---------- live notes on the board ---------- */
.next-note { margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.35; max-width: calc(var(--ctrl) - 8px); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.next-note b { color: var(--teal); font-weight: 500; font-variant-numeric: tabular-nums; }
.ov-row { height: 96px; }
.live-notes { position: absolute; top: 54px; left: 0; right: 0; height: 0; z-index: 6; }
.lcard {
  position: absolute; width: 290px; max-width: 70%; padding: 10px 12px 11px; border-radius: 14px;
  background: rgba(10, 18, 18, .94); border: 1px solid var(--teal); box-shadow: 0 10px 30px rgba(0,0,0,.55);
  backdrop-filter: blur(6px); animation: lpop .25s var(--ease) both; pointer-events: none;
}
.lcard.mine { border-color: var(--white); }
.lcard::before { content: ''; position: absolute; top: -6px; left: 10px; width: 10px; height: 10px; background: inherit; border-left: 1px solid var(--teal); border-top: 1px solid var(--teal); transform: rotate(45deg); }
.lcard.right::before { left: auto; right: 10px; }
.lcard.mine::before { border-color: var(--white); }
.lcard .lw { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.lcard .lw svg { width: 13px; height: 13px; color: var(--teal); }
.lcard .lw b { color: var(--white); font-weight: 500; }
.lcard .lw .lt { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--teal); }
.lcard .lx { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .lbar { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 1px; background: rgba(255,255,255,.08); overflow: hidden; }
.lcard .lbar i { display: block; height: 100%; background: var(--teal); width: 0; }
@keyframes lpop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { .lcard { width: 220px; } .admin-grid { grid-template-columns: 1fr; } }
.study-head .tag:disabled { opacity: 1; cursor: default; }

/* ---------- metronome & rehearsal-recording lanes ---------- */
.lane-chips { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; z-index: 2; cursor: default; max-width: calc(100% - 16px); }
.chip-sel, .chip-btn, .chip-name {
  height: 26px; border-radius: 999px; border: 1px solid var(--line); background: rgba(14,16,17,.82); color: var(--white);
  font: inherit; font-size: 12px; padding: 0 10px; backdrop-filter: blur(4px);
}
.chip-sel { padding-right: 6px; cursor: pointer; max-width: 200px; }
.chip-sel option { background: var(--panel); }
.chip-sel:hover, .chip-btn:hover { border-color: var(--teal); }
.chip-btn { cursor: pointer; color: var(--muted); }
.chip-btn:hover { color: var(--white); }
.chip-name { display: inline-flex; align-items: center; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-msg { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
.track.metro .lane canvas { opacity: .9; }
.track.metro.off .lane canvas { opacity: .35; }
.track.metro .tic, .track.take .tic { background: rgba(99,173,174,.18); }
.track.take .tic { color: var(--amber); }
.track.metro.off .tic, .track.take.off .tic { background: transparent; color: var(--muted); }
.track.take .lane { background: rgba(233,177,90,.05); }
.track.take .tctrl .tic .lvl { border-color: var(--amber); }
.track.metro.nobpm .lane-chips select { display: none; }
.beats { display: inline-flex; gap: 5px; margin-left: 4px; }
.beats i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.14); transition: background .05s, transform .05s; }
.beats i.one { background: rgba(99,173,174,.35); }
.beats i.on { background: var(--white); transform: scale(1.25); }
.beats i.one.on { background: var(--teal); }
.track.metro.off .beats { opacity: .4; }

/* ---------- inline edit panels (tempo, rehearsal recording) ---------- */
.edit-panel { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: rgba(99,173,174,.05); }
.edit-panel .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.edit-panel .field { margin-bottom: 10px; }
.edit-panel .field.bpm { width: 220px; }
.edit-panel .field.meter { width: 96px; }
.edit-panel .field.beat0 { width: 300px; }
.edit-panel .field.key { width: 120px; }
.edit-panel .field.grow { flex: 1; min-width: 180px; }
.hx.wide { width: auto; padding: 0 10px; }
.edit-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.edit-hint { flex: 1; min-width: 200px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.pill.danger:hover { border-color: #d9665b; color: #f09a90; }

/* ---------- upload dialogs ---------- */
.mp3-opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.mp3-opt label, .check-line { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.mp3-opt input, .check-line input { accent-color: var(--teal); width: 16px; height: 16px; }
.mp3-opt select { background: transparent; color: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font: inherit; font-size: 12px; }
.mp3-opt select option { background: var(--panel); }
.mp3-opt select:disabled { opacity: .4; }
.check-line { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.tk-file { font-size: 13px; margin-top: 10px; color: var(--muted); }
.tk-file b { color: var(--white); font-weight: 500; }
.tk-file .bad { color: var(--amber); }
@media (max-width: 700px) {
  .lane-chips .beats, .lane-chips .lane-msg { display: none; }
  .chip-sel { max-width: 110px; }
  .edit-panel .field.bpm, .edit-panel .field.beat0 { width: 100%; }
}

/* ---------- admin PIN ---------- */
.link-btn { margin-top: 16px; background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.25); }
.link-btn:hover { color: var(--teal); }
.pin-input {
  width: 100%; text-align: center; font-size: 34px; letter-spacing: .5em; padding: 14px 0 14px .5em; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 14px; color: var(--white); font-family: inherit; outline: none; margin: 6px 0 10px;
}
.pin-input:focus { border-color: var(--teal); }
.pin-dlg .auth-err { text-align: center; }
