/* =====================================================================
   SHRED UP — design V3
   Slate, soft surfaces without borders, depth by shadow, one porcelain
   action per screen, ember accent for what is live.
   ===================================================================== */

@font-face {
  font-family: 'Conthrax';
  src: url('/static/fonts/Conthrax-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}

:root {
  --canvas: #1c1e23;
  --surface: #24262c;
  --surface-2: #2b2d33;
  --surface-3: #33363d;
  --well: #202227;
  --outline: rgba(255, 255, 255, 0.22);
  --text: #e8e9ec;
  --text-2: #9a9ea6;
  --text-3: #60646c;
  --text-4: #43464d;
  --ember: #ff7a2e;
  --ember-glow: rgba(255, 122, 46, 0.38);
  --ok: #7ad7a2;
  --warn: #f0b660;
  --bad: #ef6f69;
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 60px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-tile: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 8px 18px rgba(0, 0, 0, 0.22);
  --shadow-well: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  --ui: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --num: 'Conthrax', var(--ui);
  --r-panel: 26px;
  --r-tile: 14px;
  --gap: 18px;
  --side: 440px;

  /* kept for the iframes and older inline styles */
  --color-bg-primary: var(--canvas);
  --color-bg-secondary: var(--surface);
  --color-bg-tertiary: var(--surface-2);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text-primary: var(--text);
  --color-text-secondary: var(--text-2);
  --color-text-tertiary: var(--text-3);
}

body.light-theme {
  --canvas: #e6e8ec;
  --surface: #f3f4f6;
  --surface-2: #ffffff;
  --surface-3: #ffffff;
  --well: #eceef1;
  --outline: rgba(0, 0, 0, 0.2);
  --text: #1f2126;
  --text-2: #5d616a;
  --text-3: #8b8f97;
  --text-4: #b4b7bd;
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 24px 50px rgba(30, 34, 45, 0.1), 0 2px 6px rgba(30, 34, 45, 0.06);
  --shadow-tile: 0 6px 14px rgba(30, 34, 45, 0.08);
  --shadow-well: inset 0 2px 6px rgba(30, 34, 45, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea { font-family: inherit; }

svg.su-i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.su-num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.su-label { font: 500 12px var(--ui); color: var(--text-3); }

/* ---------------------------------------------------------------- shell */
.su-app {
  height: 100vh;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  gap: var(--gap);
  padding: 16px 24px 24px;
  background:
    radial-gradient(1300px 900px at 18% 10%, rgba(255, 255, 255, 0.035), transparent 65%),
    var(--canvas);
}

.su-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-panel);
  min-width: 0;
  min-height: 0;
}

.su-tile {
  background: var(--surface-2);
  border-radius: var(--r-tile);
  box-shadow: var(--shadow-tile);
}

.su-phead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 20px 24px 12px;
  flex-shrink: 0;
}
.su-ptitle { font: 600 17px var(--ui); letter-spacing: -0.01em; }
.su-psub { font: 400 13px var(--ui); color: var(--text-3); }

.su-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 6px 14px rgba(0, 0, 0, 0.22);
  font: 500 13px var(--ui);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, box-shadow 0.15s;
}
.su-btn:hover { color: var(--text); }
.su-btn:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35); }

/* the one primary action: porcelain */
.su-porcelain-rect {
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 14px;
  color: #24262b;
  background: radial-gradient(circle at 40% 30%, #ffffff, #eceef0 45%, #c9ccd1 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 4px rgba(0, 0, 0, 0.15), 0 10px 24px rgba(0, 0, 0, 0.4), 12px -10px 34px -6px var(--ember-glow);
  font: 600 14px var(--ui);
  cursor: pointer;
}
.su-porcelain-rect.saved { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 2px var(--ok), 0 10px 24px rgba(0, 0, 0, 0.4); }

/* ---------------------------------------------------------------- header */
.su-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.su-brand { display: flex; align-items: center; gap: 18px; }
.su-brand-icon { height: 54px; }
.su-brand-word { height: 20px; }

.su-modes {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}
body.light-theme .su-modes { background: rgba(0, 0, 0, 0.06); }
.su-modes button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-3);
  font: 500 14px var(--ui);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.su-modes button:hover { color: var(--text-2); }
.su-modes button.on {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--outline), 0 10px 22px rgba(0, 0, 0, 0.3);
}

.su-head-right { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.su-session {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}
body.light-theme .su-session { background: rgba(0, 0, 0, 0.06); }
.su-session-wrap { position: relative; }
.su-gear { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.15s, background 0.15s; }
.su-gear:hover { color: var(--text); background: rgba(0, 0, 0, 0.18); }
body.light-theme .su-gear:hover { background: rgba(0, 0, 0, 0.06); }
.su-gear svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* settings panel */
.st-card { width: min(760px, 94vw); max-height: 88vh; padding: 0; gap: 0; overflow: hidden; }
.st-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 14px; }
.st-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 11px; background: var(--surface-2); color: var(--text-2); font-size: 20px; cursor: pointer; box-shadow: var(--shadow-tile); }
.st-close:hover { color: var(--text); }
.st-body { overflow-y: auto; padding: 0 26px 26px; display: flex; flex-direction: column; gap: 22px; }
.st-body section { display: flex; flex-direction: column; gap: 10px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-field { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--shadow-tile); }
.st-field.st-wide { grid-column: span 1; }
.st-field > span { font: 600 13px var(--ui); color: var(--text); }
.st-field small { font: 400 12px/1.45 var(--ui); color: var(--text-3); }
.st-field select { height: 38px; padding: 0 10px; border: 0; border-radius: 11px; background: var(--well); box-shadow: var(--shadow-well); color: var(--text); font: 500 13px var(--ui); outline: none; min-width: 0; }
.st-field select option, .st-field select optgroup { background: var(--surface-2); color: var(--text); }
.st-row { display: flex; align-items: center; gap: 8px; }
.st-row select { flex: 1; }
.st-test { flex-shrink: 0; }
.st-meter { height: 6px; border-radius: 3px; background: var(--well); box-shadow: var(--shadow-well); overflow: hidden; }
.st-meter i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--ok), var(--warn) 80%, var(--bad)); background-size: 260px 100%; transition: width 0.05s linear; }
.st-meter i.hot { box-shadow: 0 0 8px var(--bad); }
.st-stepper { display: flex; align-items: center; gap: 10px; }
.st-stepper button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 11px; background: var(--well); box-shadow: var(--shadow-well); color: var(--text-2); font: 400 18px var(--ui); cursor: pointer; }
.st-stepper button:hover { color: var(--text); }
.st-stepper b { flex: 1; text-align: center; font: 600 15px var(--num); letter-spacing: 0.02em; }
.st-seg { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--well); box-shadow: var(--shadow-well); }
.st-seg button { flex: 1; height: 32px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); font: 500 12px var(--ui); cursor: pointer; white-space: nowrap; }
.st-seg button:hover { color: var(--text); }
.st-seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-tile); }
.st-note { margin: 0; font: 400 13px/1.5 var(--ui); color: var(--text-2); }
@media (max-width: 700px) { .st-grid { grid-template-columns: 1fr; } }
button.su-session { border: 0; color: var(--text); font-family: var(--ui); cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
button.su-session:hover, button.su-session[aria-expanded="true"] { background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px var(--outline); }
body.light-theme button.su-session:hover, body.light-theme button.su-session[aria-expanded="true"] { background: rgba(0, 0, 0, 0.1); }
.su-session-chev { width: 14px; height: 14px; margin-left: -4px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button.su-session.flash { box-shadow: inset 0 0 0 1px var(--ok); }
button.su-session.flash::after { content: attr(data-flash); position: absolute; top: calc(100% + 8px); right: 0; padding: 6px 10px; border-radius: 9px; background: var(--surface-3); color: var(--ok); font: 500 12px var(--ui); white-space: nowrap; box-shadow: var(--shadow-tile); z-index: 60; }
.su-session-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 300px; padding: 6px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 50px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; gap: 2px; }
.su-session-menu[hidden] { display: none; }
.su-session-menu button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font-family: var(--ui); }
.su-session-menu button:hover { background: var(--surface-3); }
.su-session-menu svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--text-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.su-session-menu b { display: block; font: 600 13px var(--ui); }
.su-session-menu small { display: block; margin-top: 2px; font: 400 12px var(--ui); color: var(--text-3); }
.su-confirm-card { width: min(540px, 92vw); }
.su-btn.su-danger { color: var(--bad); }
.su-session .su-num { font-size: 16px; letter-spacing: 0.04em; }
.su-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px var(--ember); }

.su-theme-slot { display: flex; }
.su-theme-slot .theme-toggle-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-2);
  font-size: 17px;
  cursor: pointer;
}
body.light-theme .su-theme-slot .theme-toggle-btn { background: rgba(0, 0, 0, 0.06); }

.su-avatar {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-3);
  color: var(--text-2);
  font: 600 16px var(--ui);
  box-shadow: 0 0 0 3px var(--canvas), 0 0 0 4px rgba(255, 255, 255, 0.12);
}
.su-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------------------------------------------------------- screens */
.su-screen { display: none; min-height: 0; gap: var(--gap); }
.su-screen.on { display: grid; }

#screen-pratique {
  grid-template-columns: minmax(0, 1fr) var(--side);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "tab side" "ex side";
}

/* ---------------------------------------------------------------- tab reader */
.zone-tab { grid-area: tab; display: flex; flex-direction: column; overflow: hidden; }

.zone-tab.file-drag-over,
.zone-practice.file-drag-over,
.exercise-list.file-drag-over { box-shadow: var(--shadow-panel), inset 0 0 0 2px var(--ember); }

.tab-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}
.tab-title {
  flex: 1;
  min-width: 0;
  font: 600 17px var(--ui);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-tool-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 6px 14px rgba(0, 0, 0, 0.22);
  font: 600 12px var(--ui);
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab-tool-btn:hover { color: var(--text); }
.tab-tool-btn:disabled { opacity: 0.4; cursor: default; }
.tab-tool-btn.active { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--outline), 0 6px 14px rgba(0, 0, 0, 0.22); }

.tab-countin-btn { gap: 5px; }
.tab-countin-btn .ci-n { font: 600 12px var(--ui); }
.tab-countin-btn .ci-n:empty { display: none; }
.tab-countin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  box-shadow: var(--shadow-panel), 0 0 0 1px var(--outline);
  pointer-events: none;
}
.tab-countin[hidden] { display: none; }
.tab-countin span { font: 600 64px var(--num); line-height: 1; color: var(--text); }
.tab-countin span.accent { color: var(--ember); }
.tab-countin small { margin-top: 8px; font: 500 11px var(--ui); letter-spacing: 0.16em; color: var(--text-3); }
.tab-player { display: flex; align-items: center; gap: 12px; padding: 0 20px 18px; flex-shrink: 0; }
.tab-player[hidden] { display: none; }
.zone-tab.collapsed .tab-player { display: none; }
.tab-play {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #24262b;
  font-size: 15px;
  background: radial-gradient(circle at 40% 30%, #ffffff, #eceef0 45%, #c9ccd1 100%);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.15), 0 8px 18px rgba(0, 0, 0, 0.4), 10px -8px 26px -6px var(--ember-glow);
}
.tab-play:disabled { opacity: 0.5; cursor: default; }
.tab-scrub { position: relative; flex: 1; height: 40px; cursor: pointer; }
.tab-scrub .rail { position: absolute; left: 0; right: 0; top: 14px; height: 4px; border-radius: 2px; background: var(--well); box-shadow: var(--shadow-well); }
.tab-scrub .fill { position: absolute; left: 0; top: 14px; height: 4px; width: 0; border-radius: 2px; background: var(--text); }
.tab-scrub .knob { position: absolute; left: 0; top: 8px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 16px var(--ember-glow); }
.tab-scrub .ticks { position: absolute; left: 0; right: 0; top: 26px; display: flex; justify-content: space-between; font: 500 10px var(--ui); color: var(--text-4); pointer-events: none; }
.tab-volume { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.tab-volume input[type=range] { width: 84px; accent-color: var(--text); }
.tab-readout { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; }
.tab-readout .su-num { font-size: 22px; }

.tab-viewport {
  height: clamp(180px, 31vh, 360px);
  min-height: 140px;
  max-height: 70vh;
  margin: 0 16px 16px;
  padding: 8px 20px;
  border-radius: 18px;
  background: var(--well);
  box-shadow: var(--shadow-well);
  overflow-y: auto;
  overflow-x: hidden;
  resize: vertical;
}
.zone-tab.collapsed .tab-viewport { display: none; }

/* PDF and images */
.zone-tab.doc-shown #tab-zoom-out-btn, .zone-tab.doc-shown #tab-zoom-in-btn { display: inline-flex; }
.tab-doc { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 0 20px; }
.tab-doc-page { display: block; max-width: none; border-radius: 6px; background: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3); }
.tab-doc.dark-paper .tab-doc-page { filter: invert(0.9) hue-rotate(180deg) contrast(0.95); }
.tab-doc-num { margin-top: -6px; font: 500 11px var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.tab-doc-note { padding: 40px 0; font: 500 13px var(--ui); color: var(--text-3); }

/* ---------------------------------------------------------------- backing track */
.zone-tab.bk-only .tab-viewport,
.zone-tab.bk-only .tab-player,
.zone-tab.bk-only #tab-view-btn,
.zone-tab.bk-only #tab-zoom-out-btn,
.zone-tab.bk-only #tab-zoom-in-btn,
.zone-tab.bk-only #tab-popup-btn { display: none; }
.zone-tab.collapsed .bk { display: none; }
.bk { display: flex; flex-direction: column; }
.bk-full {
  height: clamp(180px, 31vh, 360px);
  min-height: 170px;
  margin: 0 16px 16px;
  padding: 16px 20px 16px;
  gap: 12px;
  border-radius: 18px;
  background: var(--well);
  box-shadow: var(--shadow-well);
}
.bk-strip { gap: 8px; padding: 0 20px 16px; }
.bk-head { display: flex; align-items: center; gap: 12px; }
.bk-name { flex: 1; min-width: 0; font: 600 15px var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-wave-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bk-strip .bk-wave-wrap { flex: none; height: 46px; padding: 4px 10px; border-radius: 12px; background: var(--well); box-shadow: var(--shadow-well); }
.bk-wave { flex: 1; width: 100%; min-height: 0; cursor: pointer; touch-action: none; }
.bk-times { display: flex; justify-content: space-between; margin-top: 6px; font: 500 11px var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.bk-times #bk-hint { color: var(--text-4); }
.bk-count {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  box-shadow: var(--shadow-panel), 0 0 0 1px var(--outline);
  font: 600 44px var(--num);
  color: var(--text);
  pointer-events: none;
}
.bk-strip .bk-count { width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: 18px; }
.bk-count[hidden] { display: none; }
.bk-transport { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.bk-strip .bk-play { width: 40px; height: 40px; font-size: 12px; }
.bk-countin { gap: 5px; }
.bk-countin .ci-n { font: 600 12px var(--ui); }
.bk-countin .ci-n:empty { display: none; }
.bk-tempo { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.bk-follow { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--text-2); font: 500 12px var(--ui); cursor: pointer; white-space: nowrap; }
.bk-switch { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--surface-3); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35); transition: background 0.15s; }
.bk-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.15s, background 0.15s; }
.bk-follow.on { color: var(--text); }
.bk-follow.on .bk-switch { background: var(--ember); }
.bk-follow.on .bk-switch::after { transform: translateX(12px); background: #fff; }
.bk-speed { display: flex; align-items: center; gap: 8px; font: 600 12px var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.bk-speed[hidden] { display: none; }
.bk-speed input { width: 96px; accent-color: var(--text); }
.bk-readout { display: flex; flex-direction: column; align-items: flex-end; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; white-space: nowrap; }
.bk-readout b { font: 600 15px var(--num); letter-spacing: 0.02em; }
.bk-readout small { font: 500 10px var(--ui); color: var(--text-3); }
.bk-vol input[type=range] { width: 70px; }
.exercise-row.has-backing .gp-upload-btn { position: relative; color: var(--text); }
.exercise-row.has-backing .gp-upload-btn::after { content: ''; position: absolute; right: 2px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 6px var(--ember-glow); }

.bk-body { flex: 1; min-height: 0; display: flex; gap: 18px; }
.bk-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.bk-strip .bk-main { gap: 8px; }

/* YouTube: the official player framed like the other V3 tiles */
.bk-full.bk-is-yt { height: clamp(272px, 34vh, 380px); }
.bk-yt { position: relative; flex-shrink: 0; border-radius: 14px; overflow: visible; }
.bk-yt.in-full { height: 100%; min-height: 200px; aspect-ratio: 16 / 9; }
.bk-yt-frame { width: 100%; height: 100%; border-radius: 14px; overflow: hidden; background: #0d0e10; box-shadow: 0 0 0 1px var(--outline), 0 14px 30px rgba(0, 0, 0, 0.35); }
.bk-yt-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.bk-yt-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; border-radius: 14px; background: var(--surface); color: var(--text-2); font: 500 13px/1.5 var(--ui); text-align: center; }
.bk-yt-msg[hidden] { display: none; }
.bk-yt.floating { position: fixed; z-index: 900; width: 356px; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 18px; background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 50px rgba(0, 0, 0, 0.45); }
.bk-yt.floating[hidden] { display: none; }
.bk-yt.floating .bk-yt-frame { height: 200px; flex-shrink: 0; border-radius: 12px; box-shadow: none; }
.bk-yt.floating .bk-yt-msg { inset: 36px 6px 6px; border-radius: 12px; }
.zone-tab.collapsed .bk-yt.floating { display: none; }
.bk-yt-bar { display: flex; align-items: center; justify-content: space-between; height: 24px; padding: 0 2px 0 4px; }
.bk-yt-grip { display: flex; align-items: center; gap: 6px; height: 100%; padding-right: 10px; font: 500 11px var(--ui); color: var(--text-3); cursor: grab; touch-action: none; user-select: none; }
.bk-yt-grip:hover { color: var(--text); }
.bk-yt.dragging .bk-yt-grip { cursor: grabbing; color: var(--text); }
.bk-yt-grip svg { width: 14px; height: 14px; fill: currentColor; }
.bk-yt-close { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); font-size: 17px; line-height: 1; cursor: pointer; }
.bk-yt-close:hover { color: var(--text); background: var(--surface-3); }
.bk-yt-shield { display: none; position: absolute; inset: 36px 6px 6px; }
.bk-yt.dragging .bk-yt-shield { display: block; cursor: grabbing; }
.bk-yt.dragging { box-shadow: inset 0 0 0 1px var(--outline), 0 30px 60px rgba(0, 0, 0, 0.55); }
.bk-transport { flex-wrap: wrap; row-gap: 10px; }
.bk-tempo { flex: 1 0 auto; min-width: max-content; }
.bk-full.bk-is-yt .bk-tempo { order: 5; flex-basis: 100%; justify-content: flex-start; }
.bk-link-input { height: 46px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--well); box-shadow: var(--shadow-well); color: var(--text); font: 400 15px var(--ui); outline: none; }
.bk-link-input:focus { box-shadow: var(--shadow-well), inset 0 0 0 1px var(--outline); }

.bk-menu { position: fixed; z-index: 1500; width: 270px; padding: 6px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 50px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; gap: 2px; }
.bk-menu[hidden] { display: none; }
.bk-menu button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font-family: var(--ui); }
.bk-menu button:hover:not(:disabled) { background: var(--surface-3); }
.bk-menu button:disabled { opacity: 0.45; cursor: default; }
.bk-menu svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--text-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bk-menu b { display: block; font: 600 13px var(--ui); }
.bk-menu small { display: block; margin-top: 2px; font: 400 12px var(--ui); color: var(--text-3); }

.tab-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 16px;
}
.tab-empty[hidden] { display: none; }

.tab-render .at-cursor-bar { background: rgba(255, 122, 46, 0.05); }
.tab-render .at-selection div { background: rgba(255, 122, 46, 0.12); }
.tab-render .at-cursor-beat { background: var(--ember); width: 2px; box-shadow: 0 0 8px var(--ember-glow); }

/* ---------------------------------------------------------------- programme (exercise list) */
.zone-practice { grid-area: ex; display: flex; flex-direction: column; overflow: hidden; }

.exercise-header,
.exercise-row {
  display: grid;
  grid-template-columns: 176px minmax(140px, 1fr) 96px 184px 76px 84px 34px;
  gap: 10px;
  align-items: center;
}

.exercise-header { padding: 0 108px 8px 58px; flex-shrink: 0; }
.zone-practice .su-phead { align-items: center; }
.su-prog-body { flex: 1; min-height: 0; display: flex; gap: 12px; padding-right: 16px; }
.su-prog-body .exercise-list { flex: 1; padding-right: 4px; }
.su-vnav {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.3);
}
.su-vnav button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.su-vnav button:hover { color: var(--text); }
.su-vnav button.mid { width: 26px; height: 26px; margin: 4px 0; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--text-2); }
.su-vnav button.mid:hover { box-shadow: inset 0 0 0 1.5px var(--text); }

/* row numbers, as in the design */
.exercise-list { counter-reset: su-row; }
.exercise-row { counter-increment: su-row; }
.exercise-row::before {
  content: counter(su-row, decimal-leading-zero);
  position: absolute;
  left: -2px;
  top: 29px;
  transform: translate(-100%, -50%);
  font: 500 11px var(--ui);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.exercise-row.exercise-selected::before { color: var(--text); }
.header-cell { font: 600 11px var(--ui); letter-spacing: 0.06em; color: var(--text-3); white-space: nowrap; }
.header-tempo { display: flex; align-items: center; gap: 6px; }
.exercise-header .header-cell:nth-child(2) { margin-left: -10px; }
.tempo-reduce-btn,
.tempo-subdivide-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.tempo-reduce-btn.min-subdivisions,
.tempo-subdivide-btn.max-subdivisions { opacity: 0.35; cursor: default; }

.exercise-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px 16px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.exercise-row {
  position: relative;
  flex-shrink: 0;
  min-height: 58px;
  padding: 8px 18px;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: var(--shadow-tile);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.exercise-row:hover { background: var(--surface-3); }
.exercise-row.exercise-selected {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--outline), 0 14px 30px rgba(0, 0, 0, 0.32);
}
.exercise-row.dragging { opacity: 0.4; }
.exercise-row.drag-over { box-shadow: inset 0 2px 0 var(--ember), var(--shadow-tile); }

.rec-reference-container { display: flex; align-items: center; gap: 6px; min-width: 0; }

.rec-button {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--text-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-button::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--text-4); transition: all 0.15s; }
.rec-button:hover::before { background: var(--bad); }
.rec-button.countdown { box-shadow: inset 0 0 0 1.5px var(--warn); animation: su-pulse 0.4s infinite; cursor: not-allowed; }
.rec-button.countdown::after {
  content: attr(data-countdown);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font: 600 11px var(--ui);
  color: var(--warn);
}
.rec-button.recording { box-shadow: inset 0 0 0 1.5px var(--bad), 0 0 14px rgba(239, 111, 105, 0.5); animation: su-pulse 1.4s infinite; }
.rec-button.recording::before { width: 9px; height: 9px; border-radius: 2px; background: var(--bad); }
@keyframes su-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* play a series without recording */
.series-btn {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--text-4);
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.series-btn svg { width: 14px; height: 14px; fill: currentColor; }
.series-btn .st { display: none; }
.series-btn:hover { color: var(--text); }
.series-btn.running { color: var(--ember); box-shadow: inset 0 0 0 1.5px var(--ember), 0 0 14px var(--ember-glow); }
.series-btn.running .pl { display: none; }
.series-btn.running .st { display: block; }
.series-btn.countdown { color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); animation: su-pulse 0.4s infinite; }
.series-btn.countdown::after {
  content: attr(data-countdown);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font: 600 11px var(--ui);
  color: var(--warn);
}

/* takes under the exercise */
.take-list { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; cursor: default; }
.take-list[hidden] { display: none; }
.take-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 6px 4px 4px; border-radius: 11px; background: var(--well); box-shadow: var(--shadow-well); }
.take-item.fresh { box-shadow: var(--shadow-well), inset 0 0 0 1px var(--ember); }
.take-listen { width: 30px; height: 30px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #ffffff, #eceef0 45%, #c9ccd1 100%); color: #24262b; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.take-listen svg { width: 13px; height: 13px; fill: currentColor; }
.take-listen.playing { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--ember); }
.take-label { font: 600 13px var(--ui); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.take-meta { font: 500 12px var(--ui); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.take-status { margin-left: auto; font: 500 11px var(--ui); color: var(--warn); white-space: nowrap; }
.take-item.kept .take-status { color: var(--ok); }
.take-act { height: 28px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font: 500 12px var(--ui); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-tile); }
.take-act:hover { color: var(--text); }
.take-keep { color: var(--ok); }
.take-delete:hover { color: var(--bad); }

.su-toast { position: fixed; left: 50%; bottom: 28px; z-index: 3000; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: var(--surface-3); color: var(--text); font: 500 13px var(--ui); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px var(--outline); transition: opacity 0.5s; }
.su-toast.out { opacity: 0; }

.take-play-btn,
.gp-remove-btn {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.take-play-btn[hidden],
.gp-remove-btn[hidden] { display: none; }
.take-play-btn:hover,
.take-play-btn.playing { color: var(--ember); }
.gp-remove-btn { width: 20px; height: 20px; font-size: 12px; background: transparent; color: var(--text-3); }
.gp-remove-btn:hover { color: var(--bad); }

.gp-upload-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gp-upload-btn:hover { color: var(--text); }
.gp-upload-btn .upload-icon { width: 17px; height: 17px; }
.exercise-row.has-tab .gp-upload-btn { color: var(--text); }

.exercise-name-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  margin-left: -10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: 500 15px var(--ui);
  outline: none;
  cursor: pointer;
}
.exercise-name-input::placeholder { color: var(--text-4); font-weight: 400; }
.exercise-name-input:focus { background: var(--well); box-shadow: var(--shadow-well); cursor: text; }

.sub-ryth-select,
.temps-passe-select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: var(--well);
  box-shadow: var(--shadow-well);
  color: var(--text-2);
  font: 500 13px var(--ui);
  outline: none;
  cursor: pointer;
}
.sub-ryth-select option,
.temps-passe-select option { background: var(--surface-2); color: var(--text); }

.tempo-columns-container { display: flex; gap: 6px; }
.tempo-column { width: 84px; }
.tempo-columns-container[data-columns="2"] .tempo-column { width: 64px; }
.tempo-columns-container[data-columns="3"] .tempo-column { width: 52px; }

.tempo-input,
.tempo-goal-input {
  width: 100%;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--well);
  box-shadow: var(--shadow-well);
  color: var(--text);
  text-align: center;
  font: 600 15px var(--ui);
  font-variant-numeric: tabular-nums;
  outline: none;
}
.tempo-input::placeholder,
.tempo-goal-input::placeholder { color: var(--text-4); }
.tempo-input:focus,
.tempo-goal-input:focus { box-shadow: var(--shadow-well), inset 0 0 0 1px var(--outline); }
.tempo-goal-container { display: flex; }
.tempo-goal-input { color: var(--text-2); }

.exercise-checkbox { display: flex; justify-content: center; }
.exercise-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 8px;
  background: var(--well);
  box-shadow: var(--shadow-well), inset 0 0 0 1.5px var(--text-4);
  cursor: pointer;
  display: grid;
  place-content: center;
}
.exercise-checkbox input[type="checkbox"]::before {
  content: '';
  width: 12px;
  height: 7px;
  border-left: 2.4px solid #24262b;
  border-bottom: 2.4px solid #24262b;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.exercise-checkbox input[type="checkbox"]:checked { background: var(--text); box-shadow: none; }
.exercise-checkbox input[type="checkbox"]:checked::before { opacity: 1; }

/* ---------------------------------------------------------------- sub-exercises */
.sub-toggle {
  min-width: 26px;
  height: 24px;
  flex-shrink: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-3);
  font: 600 12px var(--ui);
  cursor: pointer;
}
.sub-toggle:hover, .sub-toggle.has-subs { color: var(--text); }
.exercise-row.subs-open .sub-toggle { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--outline); color: var(--text); }

.sub-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 6px;
  margin: 6px 0 2px;
  cursor: default;
}
.sub-list[hidden] { display: none; }
.sub-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  min-height: 46px;
  padding: 6px 0;
  border-radius: 12px;
  background: var(--well);
  box-shadow: var(--shadow-well);
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}
.sub-row.sub-selected { background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline); }
.sub-row.sub-flash { background: rgba(255, 200, 80, 0.12); }
.sub-idx { justify-self: end; padding-right: 4px; font: 600 12px var(--ui); color: var(--text-3); }
.sub-row.sub-selected .sub-idx { color: var(--ember); }
.sub-name-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sub-name {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin-left: -10px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: 500 14px var(--ui);
  outline: none;
  cursor: pointer;
}
.sub-name::placeholder { color: var(--text-4); }
.sub-name:focus { background: var(--surface-2); color: var(--text); cursor: text; }
.sub-remove { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-4); font-size: 14px; cursor: pointer; opacity: 0; }
.sub-row:hover .sub-remove { opacity: 1; }
.sub-remove:hover { color: var(--bad); }
.sub-sessions-label { font: 500 11px var(--ui); color: var(--text-4); }
.sub-sessions { display: flex; gap: 6px; align-items: center; }
.sub-tempo, .sub-goal, .sub-time {
  width: 52px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  font: 600 13px var(--ui);
  font-variant-numeric: tabular-nums;
  outline: none;
}
.sub-goal { width: 100%; color: var(--text-2); }
.sub-time { width: 100%; color: var(--text-2); }
.sub-tempo::placeholder, .sub-goal::placeholder, .sub-time::placeholder { color: var(--text-4); }
.sub-tempo:focus, .sub-goal:focus, .sub-time:focus { box-shadow: inset 0 0 0 1px var(--outline); }
.sub-tempo.sub-flash { box-shadow: inset 0 0 0 1px var(--ok); }
.sub-add-session { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); font-size: 15px; cursor: pointer; }
.sub-add-session:hover { color: var(--text); }
.sub-add-session[hidden] { display: none; }
.sub-check { display: flex; justify-content: center; }
.sub-done {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--text-4);
  cursor: pointer;
  display: grid;
  place-content: center;
}
.sub-done::before { content: ''; width: 10px; height: 6px; border-left: 2.2px solid #24262b; border-bottom: 2.2px solid #24262b; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.sub-done:checked { background: var(--text); box-shadow: none; }
.sub-done:checked::before { opacity: 1; }
.sub-add {
  grid-column: 2 / -1;
  justify-self: start;
  height: 30px;
  margin-left: -10px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font: 500 13px var(--ui);
  cursor: pointer;
}
.sub-add:hover { color: var(--text); }

/* ---------------------------------------------------------------- mandatory feedback popup */
.su-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 13, 16, 0.55);
  backdrop-filter: blur(6px);
}
.su-modal[hidden] { display: none; }
.su-modal-card {
  width: min(620px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 30px 24px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 40px 90px rgba(0, 0, 0, 0.5);
}
.su-modal-card h3 { margin: 0; font: 600 24px var(--ui); letter-spacing: -0.02em; }
.su-fb-help { margin: 0; color: var(--text-2); font: 400 14px/1.55 var(--ui); }
.su-modal-card textarea {
  min-height: 160px;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--well);
  box-shadow: var(--shadow-well);
  color: var(--text);
  font: 400 15px/1.6 var(--ui);
  outline: none;
  resize: vertical;
}
.su-modal-card textarea::placeholder { color: var(--text-4); }
.su-fb-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.su-fb-count { flex: 1; font: 500 12px var(--ui); color: var(--text-3); }
.su-porcelain-rect:disabled { opacity: 0.45; cursor: default; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 14px rgba(0, 0, 0, 0.3); }

/* ---------------------------------------------------------------- side: profile + metronome */
.su-side {
  grid-area: side;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--gap);
  min-height: 0;
}

.su-profile { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 18px 20px; overflow: hidden; }
.su-profile-top { display: flex; align-items: center; gap: 14px; }

.su-photo {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}
.su-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.su-photo img[hidden] { display: none; }
.su-photo img:not([hidden]) + .su-photo-initial { display: none; }
.su-photo-initial { font: 600 24px var(--ui); color: var(--text-2); }
.su-photo-edit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #ddd;
  font: 600 8px var(--ui);
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity 0.15s;
}
.su-photo:hover .su-photo-edit { opacity: 1; }

.su-identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.su-level-line { display: flex; align-items: center; gap: 2px; min-width: 0; }
.su-since { font: 500 12px var(--ui); color: var(--text-3); white-space: nowrap; }
.su-name {
  width: 100%;
  margin-left: -7px;
  padding: 3px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 600 18px var(--ui);
  letter-spacing: -0.01em;
  outline: none;
}
.su-name:hover,
.su-name:focus { background: var(--well); }
.su-level {
  align-self: flex-start;
  margin-left: -7px;
  padding: 3px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ember);
  font: 600 12px var(--ui);
  letter-spacing: 0.04em;
  outline: none;
  cursor: pointer;
}
.su-level option { background: var(--surface-2); color: var(--text); }

.su-stat { display: flex; flex-direction: column; align-items: flex-end; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); box-shadow: var(--shadow-tile); }
.su-stat .su-num { font: 600 13px var(--ui); color: var(--text); }
.su-stat .su-label { font: 500 11px var(--ui); color: var(--text-2); }

/* progress towards the next level */
.su-plevel { padding: 12px 14px; border-radius: 14px; background: var(--well); box-shadow: var(--shadow-well); }
.su-plevel-head { display: flex; justify-content: space-between; font: 500 12px var(--ui); color: var(--text-2); }
.su-plevel-head b { color: var(--text); font-weight: 600; }
.su-pbar { position: relative; height: 6px; margin: 9px 0 8px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.su-pbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, #c9ccd1, var(--ember)); box-shadow: 0 0 10px var(--ember-glow); transition: width 0.6s; }
body.light-theme .su-pbar { background: #e3e5e9; }
body.light-theme .su-pbar i { background: linear-gradient(90deg, #5d616a, var(--ember)); }
.su-pcrit { display: flex; gap: 14px; font: 500 11px var(--ui); color: var(--text-3); white-space: nowrap; }
.su-pcrit em { font-style: normal; color: var(--text-2); }
.su-pcrit em.ok { color: var(--ok); }

/* three figures */
.su-pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.su-pstat { min-width: 0; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); box-shadow: var(--shadow-tile); }
.su-pstat .n { font: 600 18px var(--num); letter-spacing: 0.02em; white-space: nowrap; }
.su-pstat .n small { margin-left: 2px; font: 500 11px var(--ui); color: var(--text-3); letter-spacing: 0; }
.su-pstat .n .d { margin-left: 4px; font: 500 10px var(--ui); color: var(--ok); letter-spacing: 0; }
.su-pstat .n .d.down { color: var(--bad); }
.su-pstat .l { margin-top: 3px; font: 500 11px var(--ui); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the week + today's goal */
.su-pweek { display: flex; align-items: center; gap: 12px; }
.su-pdays { flex: 1; display: flex; justify-content: space-between; }
.su-pday { display: flex; flex-direction: column; align-items: center; gap: 5px; font: 500 10px var(--ui); color: var(--text-3); }
.su-pdot { width: 26px; height: 26px; border-radius: 50%; background: var(--well); box-shadow: var(--shadow-well); }
.su-pdot.on { background: radial-gradient(circle at 40% 30%, #ffffff, #eceef0 45%, #c9ccd1 100%); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }
body.light-theme .su-pdot.on { background: #2b2d33; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2); }
.su-pday.today { color: var(--ember); }
.su-pday.today .su-pdot:not(.on) { box-shadow: var(--shadow-well), 0 0 0 1.5px var(--ember); }
.su-pday.today .su-pdot.on { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ember); }
.su-pgoal { position: relative; width: 64px; height: 64px; flex-shrink: 0; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; }
.su-pgoal svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.su-pgoal circle { fill: none; stroke-width: 6; }
.su-pgoal .trk { stroke: var(--well); }
.su-pgoal .val { stroke: var(--ember); stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; transition: stroke-dashoffset 0.6s; }
.su-pgoal.done .val { stroke: var(--ok); }
.su-pgoal .t { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 600 12px var(--num); }
.su-pgoal .t small { margin-top: 1px; font: 500 9px var(--ui); color: var(--text-3); }

.su-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.su-menu .su-btn { justify-content: center; height: 36px; padding: 0 6px; gap: 6px; font-size: 12px; }
.su-menu .su-btn svg.su-i { width: 14px; height: 14px; color: currentColor; }

.zone-metronome { overflow: hidden; height: 680px; }
.zone-metronome .metronome-iframe {
  position: absolute;
  left: 50%;
  top: 0;
  width: 400px;
  height: 800px;
  border: 0;
  transform-origin: 50% 0;
}

/* ---------------------------------------------------------------- accordeur */
#screen-accordeur { grid-template-columns: minmax(0, 1fr) 420px; }
.su-tuner { display: flex; align-items: center; justify-content: center; gap: 64px; padding: 30px; overflow: hidden; }
.su-wire { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.su-tring { position: relative; width: min(600px, 54vh, 46vw); aspect-ratio: 1; flex-shrink: 0; }
.su-tring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.su-tring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.su-tnote { font-family: var(--num); font-size: clamp(64px, 11vh, 130px); line-height: 1; }
.su-tnote sub { font-size: 0.3em; color: var(--text-3); vertical-align: baseline; margin-left: 4px; }
.su-tcents { margin-top: 16px; font: 600 22px var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.su-tcents.ok { color: var(--ok); } .su-tcents.lo { color: var(--warn); } .su-tcents.hi { color: var(--bad); }
.su-thz { margin-top: 6px; font: 500 13px var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 16px; }

.su-fan { position: relative; display: flex; flex-direction: column; gap: 10px; width: 320px; }
.su-card {
  display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 18px; border-radius: 16px;
  background: var(--surface-2); box-shadow: var(--shadow-tile); transition: transform 0.25s, opacity 0.25s;
}
.su-fan-empty { padding: 18px; border-radius: 16px; background: var(--well); box-shadow: var(--shadow-well); color: var(--text-3); font: 400 13px/1.5 var(--ui); }
.su-field[hidden] { display: none; }
.su-thz sub { font-size: 0.75em; }
.su-card.sel { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--outline), 0 14px 30px rgba(0, 0, 0, 0.32); }
.su-card .s { font: 600 16px var(--ui); width: 34px; }
.su-card .h { flex: 1; font: 400 13px var(--ui); color: var(--text-3); font-variant-numeric: tabular-nums; }
.su-card .c { font: 600 15px var(--ui); font-variant-numeric: tabular-nums; color: var(--text-4); }
.su-card.ok .c { color: var(--ok); } .su-card.lo .c { color: var(--warn); } .su-card.hi .c { color: var(--bad); }

.su-tside { display: flex; flex-direction: column; gap: 22px; padding: 26px; }
.su-field { display: flex; flex-direction: column; gap: 10px; }
.su-grow { flex: 1; }
.su-select {
  height: 52px; padding: 0 14px; border: 0; border-radius: 15px; background: var(--surface-2); box-shadow: var(--shadow-tile);
  color: var(--text); font: 500 14px var(--ui); outline: none; cursor: pointer;
}
.su-select option { background: var(--surface-2); color: var(--text); }
.su-value { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; font: 500 14px var(--ui); }
.su-btn.su-sq { width: 38px; padding: 0; font-size: 18px; }
.su-vu { height: 6px; border-radius: 3px; background: var(--well); box-shadow: var(--shadow-well); overflow: hidden; }
.su-vu i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--text-3), var(--text)); box-shadow: 0 0 12px var(--ember-glow); transition: width 0.08s; }
.su-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(0, 0, 0, 0.18); }
body.light-theme .su-seg { background: rgba(0, 0, 0, 0.06); }
.su-seg button { height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--text-3); font: 500 13px var(--ui); cursor: pointer; }
.su-seg button.on { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--outline), 0 6px 14px rgba(0, 0, 0, 0.25); }
.su-tactions { display: flex; flex-direction: column; gap: 12px; }
.su-tactions .su-psub { line-height: 1.5; }

/* ---------------------------------------------------------------- notes */
#screen-notes { grid-template-columns: minmax(0, 1fr) 480px; }
.notepad-block { display: flex; flex-direction: column; gap: 12px; padding: 30px 34px; }
.session-intention {
  height: 54px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--text);
  font: 600 26px var(--ui);
  letter-spacing: -0.02em;
  outline: none;
}
body.light-theme .session-intention { border-bottom-color: rgba(0, 0, 0, 0.08); }
.session-intention::placeholder { color: var(--text-4); font-weight: 500; }
.notepad-textarea {
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  padding: 20px 22px;
  border: 0;
  border-radius: 18px;
  background: var(--well);
  box-shadow: var(--shadow-well);
  color: var(--text-2);
  font: 400 16px/1.75 var(--ui);
  outline: none;
  resize: none;
}
.notepad-textarea::placeholder { color: var(--text-4); }
.su-actions { display: flex; align-items: center; gap: 14px; padding-top: 6px; }
.save-session-btn-neumorph { display: inline-flex; align-items: center; gap: 10px; }
.save-session-btn-neumorph .save-icon { display: none; }

.su-recap-panel { display: flex; flex-direction: column; overflow: hidden; }
.su-recap { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px; }
.su-recap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 44px 52px 22px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: var(--shadow-tile);
  font: 500 14px var(--ui);
}
.su-recap-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-recap-row .b { font-family: var(--num); font-size: 14px; text-align: right; }
.su-recap-row .g { font-size: 12px; color: var(--text-3); text-align: right; }
.su-recap-row .ok { color: var(--ok); text-align: center; }
.su-recap-row .d { font: 600 13px var(--ui); text-align: right; color: var(--text-3); }
.su-recap-row .d.up { color: var(--ok); }
.su-recap-row .d.down { color: var(--bad); }
.su-recap-empty { color: var(--text-3); font-size: 13px; padding: 8px 4px; }

/* ---------------------------------------------------------------- progression */
#screen-progression { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 104px minmax(0, 1.5fr) minmax(0, 1fr); }
.pg-col { display: flex; flex-direction: column; overflow: hidden; }
.pg-span3 { grid-column: span 3; }
.pg-span2 { grid-column: span 2; }
.pg-empty { margin: auto; max-width: 420px; padding: 20px; text-align: center; color: var(--text-3); font: 400 13px/1.6 var(--ui); }

.pg-kpi { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.pg-kpi-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pg-kpi .su-num { font-size: 30px; line-height: 1.05; }
.pg-kpi .su-num small { font: 500 15px var(--ui); color: var(--text-3); }
.pg-ember { color: var(--ember); }
.pg-d { font: 500 12px var(--ui); color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-d.warn { color: var(--warn); }
.pg-spark { margin-left: auto; width: 120px; height: 52px; flex-shrink: 0; overflow: visible; }

.pg-legend { display: flex; gap: 16px; align-items: center; font: 500 12px var(--ui); color: var(--text-3); }
.pg-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }
.pg-legend i.bar { width: 10px; height: 8px; background: var(--text-4); }
.pg-legend i.pin { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px var(--ember-glow); }
.pg-chart { flex: 1; min-height: 0; display: flex; margin: 0 16px 16px; padding: 14px 18px 10px; border-radius: 18px; background: var(--well); box-shadow: var(--shadow-well); }
.pg-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }

.pg-themes { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.pg-theme { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 14px; }
.pg-theme .t { font: 600 13.5px var(--ui); }
.pg-theme .c { font: 600 12px var(--ui); text-align: right; }
.pg-theme .bar { grid-column: 1 / -1; display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.pg-theme .bar i { flex: 1; border-radius: 2px; background: var(--text-4); }
.pg-theme .q { grid-column: 1 / -1; font: 400 12px var(--ui); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-foot { padding: 10px 18px 16px; font: 400 11.5px var(--ui); color: var(--text-4); }

.pg-xt { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 16px 16px; }
.pg-xt-head, .pg-xt-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 96px 92px minmax(0, 1fr) 54px 64px minmax(0, 1.2fr) 108px; gap: 12px; align-items: center; padding: 0 14px; }
.pg-xt-head { height: 26px; font: 600 11px var(--ui); color: var(--text-3); letter-spacing: 0.04em; }
.pg-xt-head > :last-child { text-align: right; }
#pg-xt { display: flex; flex-direction: column; gap: 6px; }
.pg-xt-row { min-height: 52px; border-radius: 14px; }
.pg-xt-row.sel { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--outline), 0 14px 30px rgba(0, 0, 0, 0.3); }
.pg-xt-row .nm { font: 600 13.5px var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-xt-row svg { width: 96px; height: 30px; overflow: visible; }
.pg-xt-row .bpm { font: 400 12.5px var(--ui); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pg-xt-row .bpm b { color: var(--text); font-weight: 600; font-size: 14px; }
.pg-xt-row .goal { display: flex; flex-direction: column; gap: 5px; font: 500 11.5px var(--ui); color: var(--text-3); }
.pg-xt-row .goal .rail { height: 4px; border-radius: 2px; background: var(--well); position: relative; }
.pg-xt-row .goal .rail i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--text-2); }
.pg-xt-row .goal .rail i.full { background: var(--ok); }
.pg-xt-row .tr { font: 600 12.5px var(--ui); font-variant-numeric: tabular-nums; }
.pg-xt-row .tm { font: 500 12.5px var(--ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pg-xt-row .last { font: 400 12px var(--ui); color: var(--text-3); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-status { justify-self: end; font: 600 11px var(--ui); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.pg-status.up { color: var(--ok); background: rgba(122, 215, 162, 0.1); }
.pg-status.flat { color: var(--warn); background: rgba(240, 182, 96, 0.1); }
.pg-status.done { color: var(--surface); background: var(--text); }
.pg-status.new { color: var(--text-2); background: rgba(255, 255, 255, 0.06); }

.pg-journal { flex: 1; min-height: 0; overflow-y: auto; position: relative; padding: 0 16px 16px; }
.pg-journal::before { content: ''; position: absolute; left: 29px; top: 6px; bottom: 16px; width: 1px; background: var(--text-4); opacity: 0.4; }
.pg-entry { position: relative; padding: 0 0 12px 30px; }
.pg-entry::before { content: ''; position: absolute; left: 9px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1.5px var(--text-3); }
.pg-entry.key::before { background: #fff; box-shadow: 0 0 10px var(--ember-glow); }
.pg-entry .when { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font: 600 11.5px var(--ui); color: var(--text-3); }
.pg-entry .when .ex { color: var(--text-2); }
.pg-entry .txt { margin-top: 3px; font: 400 12.5px/1.45 var(--ui); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-tag { font: 600 10px var(--ui); padding: 2px 7px; border-radius: 999px; color: var(--text-2); background: rgba(255, 255, 255, 0.06); }
.pg-tag.bad { color: var(--warn); background: rgba(240, 182, 96, 0.1); }
.pg-tag.good { color: var(--ok); background: rgba(122, 215, 162, 0.1); }

.pg-heatwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.pg-heatwrap svg { flex: 1; min-height: 0; width: 100%; overflow: visible; }
.pg-heat-legend { display: flex; align-items: center; gap: 5px; font: 500 11px var(--ui); color: var(--text-3); }
.pg-heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pg-heat-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pg-heat-stats .su-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.pg-heat-stats .su-num { font-size: 15px; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1500px) {
  :root { --side: 400px; --gap: 14px; }
  .su-app { padding: 12px 16px 16px; }
  .exercise-header, .exercise-row { grid-template-columns: 168px minmax(120px, 1fr) 84px 176px 66px 76px 30px; gap: 8px; }
  .tempo-column { width: 72px; }
}
@media (max-width: 1280px) {
  :root { --side: 340px; }
  .su-brand-word { display: none; }
  .su-session .su-label { display: none; }
  .su-modes button { padding: 0 14px; }
  .su-profile .su-stat { display: none; }
  #screen-accordeur { grid-template-columns: minmax(0, 1fr) 340px; }
  .su-tuner { gap: 36px; }
  .su-fan { width: 260px; }
  .exercise-header, .exercise-row { grid-template-columns: 160px minmax(110px, 1fr) 76px 168px 60px 70px 28px; }
  .header-cell { font-size: 10px; }
  #screen-notes { grid-template-columns: minmax(0, 1fr) 360px; }
  #screen-progression { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 96px minmax(0, 1.3fr) minmax(0, 1fr); }
  #screen-progression > .pg-kpi:nth-child(n+3), #screen-progression > .pg-col:nth-child(6), #screen-progression > .pg-col:nth-child(8), #screen-progression > .pg-col:nth-child(9) { display: none; }
  .pg-span3, .pg-span2 { grid-column: span 2; }
  .pg-xt-head, .pg-xt-row { grid-template-columns: minmax(0, 1.2fr) 80px 88px minmax(0, 1fr) 54px 108px; }
  .pg-xt-head > :nth-child(6), .pg-xt-row > :nth-child(6), .pg-xt-head > :nth-child(7), .pg-xt-row > :nth-child(7) { display: none; }
}
/* short or narrow screens: the profile panel keeps its essentials so the metronome stays big */
@media (max-width: 1500px) {
  .su-pcrit { gap: 10px; }
}
@media (max-width: 1280px) {
  .su-pcrit { font-size: 10px; gap: 8px; }
  .su-pstat { padding: 8px 10px; }
  .su-pstat .n { font-size: 15px; }
}
@media (max-height: 940px) {
  .su-pweek { display: none; }
}
@media (max-height: 820px) {
  .su-pstats { display: none; }
}
@media (max-width: 1100px) {
  .su-modes button svg.su-i { display: none; }
  .su-profile { display: none; }
  .su-side { grid-template-rows: minmax(0, 1fr); }
}
