/* REPERTOIRE — Shared Stylesheet (Local & Drive Editions) */
:root, [data-theme="dark"] {
  --bg: #090a0c;
  --bg-header: rgba(9, 10, 12, 0.94);
  --card: #121417;
  --surface: #171a20;
  --surface-deep: #0d0f13;
  --card-border: #23272f;
  --border-hover: #3b4252;
  --text-main: #f3f4f6;
  --text-body: #cbd5e1;
  --text-muted: #9ca3af;
  --accent: #38bdf8;
  --accent-fg: #031520;
  --accent-muted: rgba(56, 189, 248, 0.14);
  --green: #4ade80;
  --amber: #fbbf24;
  --purple: #c084fc;
  --red: #f87171;
  --wave-bg: #333946;
  --wave-playhead: #ffffff;
}

[data-theme="warm"] {
  --bg: #12100e;
  --bg-header: rgba(18, 16, 14, 0.94);
  --card: #1b1714;
  --surface: #231e1a;
  --surface-deep: #15120f;
  --card-border: #312a24;
  --border-hover: #4d4238;
  --text-main: #f5efe6;
  --text-body: #d6ccc2;
  --text-muted: #a6988a;
  --accent: #f59e0b;
  --accent-fg: #1c1204;
  --accent-muted: rgba(245, 158, 11, 0.16);
  --green: #4ade80;
  --amber: #fbbf24;
  --purple: #d8b4fe;
  --red: #f87171;
  --wave-bg: #3f362e;
  --wave-playhead: #fff7ed;
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-header: rgba(244, 245, 247, 0.94);
  --card: #ffffff;
  --surface: #edf0f4;
  --surface-deep: #f8fafc;
  --card-border: #d8dde6;
  --border-hover: #a8b3c4;
  --text-main: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --accent: #0284c7;
  --accent-fg: #ffffff;
  --accent-muted: rgba(2, 132, 199, 0.12);
  --green: #16a34a;
  --amber: #d97706;
  --purple: #9333ea;
  --red: #dc2626;
  --wave-bg: #cbd5e1;
  --wave-playhead: #111827;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.mono { font-family: 'JetBrains Mono', monospace; }

/* HEADER */
header {
  border-bottom: 1px solid var(--card-border);
  background-color: var(--bg-header);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  padding: 0.5rem 0.75rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.brand-left { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  white-space: nowrap;
}
.badge-count {
  font-size: 0.68rem;
  padding: 0.1rem 0.42rem;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-weight: 700;
}

.header-pill {
  display: none;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent-muted);
  color: var(--accent);
  white-space: nowrap;
  touch-action: manipulation;
}
.header-pill.break {
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.16);
  color: var(--green);
}
.header-pill.rec {
  border-color: var(--red);
  background: rgba(248, 113, 113, 0.16);
  color: var(--red);
  animation: pulseRec 1.2s infinite;
}
@keyframes pulseRec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* DESKTOP & MOBILE NAV */
.nav-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.2rem;
  gap: 0.2rem;
}
.nav-tab {
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  touch-action: manipulation;
}
.nav-tab:hover { color: var(--text-main); }
.nav-tab.active {
  background: var(--accent-muted);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--card-border);
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px)) 0.4rem;
  justify-content: space-around;
  align-items: center;
  gap: 0.25rem;
}
.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.38rem 0.2rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.mob-tab .mob-ico { font-size: 1.15rem; line-height: 1; }
.mob-tab.active { background: var(--accent-muted); color: var(--accent); }

@media (max-width: 768px) {
  .nav-tabs { display: none; }
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

/* BUTTONS */
.btn-group { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.42rem 0.68rem;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-main);
  transition: all 0.15s ease;
  touch-action: manipulation;
  text-decoration: none;
  flex-shrink: 0;
}
.btn:hover { background: var(--surface); border-color: var(--border-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { opacity: 0.9; background: var(--accent); }
.btn-danger { background: rgba(248, 113, 113, 0.15); color: var(--red); border-color: rgba(248, 113, 113, 0.45); }
.btn-danger.recording { background: var(--red); color: #fff; border-color: var(--red); animation: pulseRec 1.2s infinite; }
.btn-pdf { background: rgba(248, 113, 113, 0.12); color: var(--red); border-color: rgba(248, 113, 113, 0.35); }
.btn-img { background: var(--accent-muted); color: var(--accent); border-color: rgba(56, 189, 248, 0.35); }
.btn-settings.dirty { border-color: var(--amber); color: var(--amber); }
.btn-drive { background: var(--surface); color: var(--accent); border-color: rgba(56, 189, 248, 0.4); }
.btn-drive.dirty { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 10px rgba(251, 191, 36, 0.2); }

.btn-coffee-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1c1204;
  font-weight: 800;
  font-size: 0.78rem;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-coffee-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4); }

/* STUDIO PANEL */
.studio-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
  padding: 0.85rem;
  display: none;
  min-height: calc(100dvh - 58px);
  flex-direction: column;
  justify-content: space-between;
}
.studio-inner {
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 780px) {
  .studio-bar { padding: 1.1rem; }
  .studio-inner { grid-template-columns: 1fr 1fr; align-items: stretch; gap: 0.9rem; }
}
.studio-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}
.studio-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.metro-controls { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; flex-wrap: wrap; }
.metro-btn-large { height: 46px; min-width: 40px; padding: 0 0.55rem; font-size: 0.85rem; font-weight: 800; border-radius: 9px; flex: 1; }
.bpm-display {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 68px;
  text-align: center;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  border: 1px dashed transparent;
}
.bpm-display:hover { border-color: var(--accent); background: var(--accent-muted); }

.beat-dots { display: flex; gap: 0.32rem; align-items: center; flex-wrap: wrap; }
.beat-dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.beat-dot.state-2 { border-color: var(--amber); color: var(--amber); background: rgba(251, 191, 36, 0.16); }
.beat-dot.state-0 { opacity: 0.32; color: var(--text-muted); border-style: dashed; }
.beat-dot.playing { background: var(--accent) !important; color: var(--accent-fg) !important; border-color: var(--accent) !important; opacity: 1 !important; }
.beat-dot.playing-accent { background: var(--amber) !important; color: #000 !important; border-color: var(--amber) !important; opacity: 1 !important; }
.beat-dot.playing-gap { border-color: var(--red) !important; opacity: 0.75 !important; }

.drone-notes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; flex: 1; }
@media (min-width: 480px) { .drone-notes { grid-template-columns: repeat(6, 1fr); } }
.note-btn {
  min-height: 44px;
  padding: 0.4rem 0.2rem;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}
.note-btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* POMODORO V2 */
.pomo-display {
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  color: var(--accent);
  letter-spacing: -0.02em;
  padding: 0.1rem 0.4rem;
}
.pomo-display.break { color: var(--green); }
.pomo-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; transition: opacity 0.15s ease; }
.pomo-inputs.locked { opacity: 0.42; pointer-events: none; }
.pomo-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  background: var(--surface-deep);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
}
.pomo-field label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.pomo-num {
  width: 54px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.28rem 0.2rem;
  font-size: 0.88rem;
  font-weight: 800;
  outline: none;
}
.pomo-num:focus { border-color: var(--accent); }
.pomo-progress-track { width: 100%; height: 5px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.pomo-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s linear, background-color 0.2s ease; }
.pomo-progress-fill.break { background: var(--green); }
.pomo-phase-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pomo-phase-pill.break { background: rgba(74, 222, 128, 0.16); color: var(--green); }
.pomo-phase-pill.done { background: rgba(251, 191, 36, 0.16); color: var(--amber); }

/* RECORDER */
.rec-timer { font-size: 1.75rem; font-weight: 800; text-align: center; color: var(--text-main); }
.rec-timer.active { color: var(--red); }
.rec-post-panel {
  background: var(--surface-deep);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.6rem;
  display: none;
  flex-direction: column;
  gap: 0.45rem;
}
.studio-close-bar { max-width: 1020px; width: 100%; margin: 0.75rem auto 0 auto; }

/* MAIN & TOOLBAR */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.toolbar { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; min-width: 0; }
.search-row { display: flex; gap: 0.35rem; align-items: center; width: 100%; min-width: 0; flex-wrap: nowrap; }
.input-text {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.48rem 0.68rem;
  border-radius: 7px;
  font-size: 0.83rem;
  outline: none;
  font-family: inherit;
}
.input-text:focus { border-color: var(--accent); }
textarea.input-text { resize: vertical; min-height: 75px; line-height: 1.45; }

@media (max-width: 520px) {
  main { padding: 0.65rem 0.55rem; }
  header { padding: 0.45rem 0.55rem; }
  .btn { padding: 0.4rem 0.52rem; font-size: 0.74rem; }
  .hide-mobile { display: none; }
}

.filter-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.35rem;
  align-items: center;
  scrollbar-width: none;
  width: 100%;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 0.32rem 0.44rem 0.32rem 0.56rem;
  font-size: 0.73rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--card);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
}
.chip.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.chip-count {
  background: var(--surface);
  border: 1px solid var(--card-border);
  padding: 0.05rem 0.36rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-main);
}
.chip.active .chip-count { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.legend-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  padding: 0.4rem 0.65rem;
  font-size: 0.71rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* STANDARDS */
.standards-list { display: flex; flex-direction: column; gap: 0.32rem; width: 100%; }
.standard-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  padding: 0.46rem 0.58rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}
.standard-card:hover { border-color: var(--border-hover); }
.card-info { display: flex; align-items: center; gap: 0.3rem; flex: 1; min-width: 0; overflow: hidden; }
.card-title { font-size: 0.85rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 0.32rem; min-width: 0; width: 100%; }
.card-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: flex; align-items: center; gap: 0.2rem; flex-shrink: 0; }
.std-attach-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  padding: 0.12rem 0.32rem;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.std-attach-pill.pdf { background: rgba(248, 113, 113, 0.14); color: var(--red); border-color: rgba(248, 113, 113, 0.32); }
.std-attach-pill.img { background: var(--accent-muted); color: var(--accent); border-color: rgba(56, 189, 248, 0.35); }
.level-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  touch-action: manipulation;
  padding: 0;
}
.level-btn.active-0 { background: #374151; color: #fff; border-color: #6b7280; }
.level-btn.active-1 { background: #1d4ed8; color: #dbeafe; border-color: #3b82f6; }
.level-btn.active-2 { background: #6b21a8; color: #f3e8ff; border-color: #a855f7; }
.level-btn.active-3 { background: #a16207; color: #fef9c3; border-color: #eab308; }
.level-btn.active-4 { background: #047857; color: #d1fae5; border-color: #10b981; }

/* LAB GRID */
.workshop-grid { display: flex; gap: 0.75rem; align-items: flex-start; width: 100%; }
.wk-compact-col { width: 245px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.wk-compact-col.full-width { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.48rem; }
.wk-rich-col { flex: 1; column-count: 2; column-gap: 0.75rem; width: 100%; min-width: 0; }
@media (max-width: 820px) {
  .workshop-grid { flex-direction: column; }
  .wk-compact-col { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.4rem; }
  .wk-rich-col { column-count: 1; }
}
.wk-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.75rem;
  break-inside: avoid;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.wk-card.compact { padding: 0.44rem 0.58rem; margin-bottom: 0; border-radius: 7px; }
.wk-card:hover { border-color: var(--border-hover); }
.wk-card.dragging { opacity: 0.35; border-color: var(--accent); }
.wk-card.drag-over { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wk-header { display: flex; justify-content: space-between; align-items: center; gap: 0.35rem; }
.wk-ctrl-btn {
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 0.16rem 0.38rem;
  font-size: 0.68rem;
  cursor: pointer;
  line-height: 1.2;
  flex-shrink: 0;
}
.wk-ctrl-btn:hover { color: var(--accent); border-color: var(--accent); }
.wk-badge { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; padding: 0.14rem 0.42rem; border-radius: 5px; letter-spacing: 0.04em; cursor: grab; }
.wk-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.wk-tag { font-size: 0.65rem; background: var(--surface); color: var(--accent); padding: 0.08rem 0.38rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; }
.wk-body { font-size: 0.8rem; color: var(--text-body); white-space: pre-line; line-height: 1.45; }
.wk-img-wrap {
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.3rem;
  cursor: zoom-in;
  overflow: hidden;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 170px;
}
.wk-img-wrap img { width: auto; max-width: 100%; max-height: 156px; height: auto; object-fit: contain; display: block; border-radius: 3px; }

/* TRANSCRIPTION CONSOLE */
.tr-layout { display: flex; gap: 0.85rem; align-items: flex-start; width: 100%; min-width: 0; }
.tr-sidebar { width: 255px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.tr-track-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  padding: 0.55rem 0.68rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}
.tr-track-item.active { border-color: var(--accent); background: var(--accent-muted); }
.tr-workspace {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}
@media (max-width: 820px) {
  .tr-layout { flex-direction: column; }
  .tr-sidebar, .tr-workspace { width: 100%; }
}
.wave-container { position: relative; height: 104px; background: var(--surface-deep); border: 1px solid var(--card-border); border-radius: 8px; cursor: pointer; overflow: hidden; user-select: none; }
.wave-canvas { width: 100%; height: 100%; display: block; }
.wave-zoom-bar { display: flex; align-items: center; gap: 0.38rem; font-size: 0.74rem; color: var(--text-muted); padding-top: 0.25rem; }
.zoom-btn { min-width: 30px; height: 28px; border-radius: 6px; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-main); font-size: 0.78rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tr-console-section { border-top: 1px solid var(--card-border); padding-top: 0.7rem; display: flex; flex-direction: column; gap: 0.6rem; }
.tr-transport-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.55rem; }
.tr-time-cur { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.tr-time-dur { font-size: 0.84rem; font-weight: 600; color: var(--text-muted); }
.tr-transport-btns { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.tr-big-btn { height: 42px; min-width: 48px; padding: 0 0.65rem; border-radius: 8px; font-size: 0.82rem; font-weight: 700; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-main); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; }
.tr-play-main { min-width: 82px; background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-size: 1.15rem; }
.tr-loop-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; justify-content: space-between; }
.tr-ab-chip { display: inline-flex; align-items: center; gap: 0.25rem; background: var(--surface); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.22rem; }
.tr-ab-set-btn { height: 34px; padding: 0 0.55rem; border-radius: 6px; font-size: 0.78rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid transparent; touch-action: manipulation; }
.tr-ab-set-btn.point-a { background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.45); color: var(--green); }
.tr-ab-set-btn.point-b { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.45); color: var(--amber); }
.tr-nudge-btn { height: 34px; min-width: 34px; padding: 0 0.3rem; border-radius: 6px; border: 1px solid var(--card-border); background: var(--card); color: var(--text-muted); font-size: 0.7rem; font-weight: 700; cursor: pointer; }
.tr-action-btn { height: 40px; padding: 0 0.65rem; border-radius: 7px; font-size: 0.76rem; font-weight: 700; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-main); cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; }
.tr-action-btn.loop-active { background: rgba(251, 191, 36, 0.18); border-color: var(--amber); color: var(--amber); }
.tr-action-btn.save-loop { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.tr-speed-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.tr-speed-preset { height: 32px; min-width: 42px; padding: 0 0.45rem; border-radius: 6px; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-muted); font-size: 0.73rem; font-weight: 700; cursor: pointer; }
.tr-speed-preset.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.loop-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 7px; padding: 0.48rem 0.62rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; cursor: pointer; }
.loop-card.active { border-color: var(--amber); background: rgba(251, 191, 36, 0.1); }
.loop-card.done-loop { border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.06); }
.loop-check-btn { width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--card-border); background: var(--card); color: transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.loop-check-btn.done { background: rgba(74, 222, 128, 0.2); border-color: var(--green); color: var(--green); }

/* SESSION LOG */
.session-composer { background: var(--card); border: 1px solid var(--card-border); border-radius: 9px; padding: 0.78rem; display: flex; flex-direction: column; gap: 0.5rem; }
.session-list { display: flex; flex-direction: column; gap: 0.5rem; }
.session-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 9px; padding: 0.75rem 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; }
.ses-audio-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; background: var(--surface-deep); border: 1px solid var(--card-border); border-radius: 7px; padding: 0.4rem 0.55rem; margin-top: 0.15rem; }
.ses-audio-bar audio { height: 34px; flex: 1; min-width: 180px; }

/* BOXES & MODALS */
.paste-zone { border: 1px dashed var(--border-hover); background: var(--surface-deep); border-radius: 7px; padding: 0.65rem; text-align: center; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }
.paste-preview { max-height: 140px; max-width: 100%; width: auto; object-fit: contain; border-radius: 5px; margin-top: 0.4rem; border: 1px solid var(--card-border); }
.attach-box { background: var(--surface-deep); border: 1px solid var(--card-border); border-radius: 7px; padding: 0.55rem; display: flex; flex-direction: column; gap: 0.42rem; }
.attach-header { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }
.cat-row, .bk-row { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; background: var(--surface-deep); border: 1px solid var(--card-border); border-radius: 7px; padding: 0.48rem 0.65rem; }
.bk-row label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; flex: 1; }
.bk-warn { background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.4); color: var(--amber); padding: 0.5rem 0.65rem; border-radius: 6px; font-size: 0.74rem; line-height: 1.35; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 60; padding: 0.85rem; overflow-y: auto; }
.modal-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 11px; max-width: 490px; width: 100%; padding: 1.05rem; display: flex; flex-direction: column; gap: 0.68rem; margin: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); }

/* FULL-SCREEN HD VIEWER */
.fullscreen-viewer { position: fixed; inset: 0; z-index: 80; background: #000; display: none; flex-direction: column; }
.fs-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.6rem 0.85rem; background: rgba(10, 10, 12, 0.9); border-bottom: 1px solid #222; color: #f3f4f6; }
.fs-scroll { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 0.5rem; -webkit-overflow-scrolling: touch; }
.fs-scroll.zoomed { align-items: flex-start; justify-content: flex-start; }
.fs-scroll img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; background: #fff; transition: width 0.2s ease; }
.fs-scroll.zoomed img { max-width: none; max-height: none; width: 170%; }

/* GUIDE & FOOTER */
.guide-item { background: var(--surface-deep); border: 1px solid var(--card-border); border-radius: 8px; padding: 0.65rem 0.75rem; }
.guide-item h4 { font-size: 0.82rem; color: var(--accent); margin-bottom: 0.25rem; }
.guide-item p { font-size: 0.76rem; color: var(--text-body); line-height: 1.45; }

footer {
  border-top: 1px solid var(--card-border);
  padding: 1rem 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
}
.vol-control { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--text-muted); }
.vol-control input[type="range"] { flex: 1; height: 8px; accent-color: var(--accent); cursor: pointer; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.segmented.two { grid-template-columns: repeat(2, 1fr); }
/* === MEJORAS UX: ESTUDIO EN BARRA ESCRITORIO, MINI-PESTAÑAS MÓVIL, MULTIPÁGINA Y AVISOS === */
.show-mobile-only { display: none; }
@media (max-width: 768px) {
  .show-mobile-only { display: inline-flex; }
}

/* Mini-pestañas dentro del panel Estudio en pantallas móviles */
.studio-mob-tabs {
  display: none;
  max-width: 1020px;
  width: 100%;
  margin: 0 auto 0.65rem auto;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 0.24rem;
}
.studio-mob-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 0.45rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  touch-action: manipulation;
}
.studio-mob-tab.active {
  background: var(--accent-muted);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
@media (max-width: 779px) {
  .studio-bar.has-mob-tabs .studio-mob-tabs { display: grid; }
  .studio-bar.has-mob-tabs .studio-box { display: none; }
  .studio-bar.has-mob-tabs .studio-box.mob-active { display: flex; }
}

/* Galería multipágina de fotos en Standards */
.std-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.std-photo-item {
  position: relative;
  width: 78px;
  height: 98px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #fff;
  cursor: zoom-in;
}
.std-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.std-photo-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.std-photo-num {
  position: absolute;
  bottom: 3px;
  left: 3px;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}

/* Navegación de páginas dentro del visor HD a pantalla completa */
.fs-page-controls {
  display: none;
  align-items: center;
  gap: 0.35rem;
}
.fs-page-controls.visible { display: inline-flex; }

/* Aviso discreto de backup / instalación en versión local */
.backup-nudge-bar {
  display: none;
  max-width: 1100px;
  width: calc(100% - 1.5rem);
  margin: 0.5rem auto 0 auto;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--amber);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.74rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
