:root {
  --bg: #1f2a25;
  --bg-deep: #121816;
  --panel: rgba(27, 39, 34, 0.94);
  --panel-soft: rgba(37, 53, 46, 0.78);
  --paper: #f3f1e7;
  --paper-line: #d0cabd;
  --paper-shadow: rgba(0, 0, 0, 0.22);
  --ink: #1d221f;
  --muted: #728075;
  --accent: #7ecb87;
  --accent-strong: #57a864;
  --accent-warm: #d9b25f;
  --cursor: #31ad50;
  --cursor-dark: #1e7d38;
  --accent-glow: rgba(126, 203, 135, 0.18);
  --accent-glow-soft: rgba(126, 203, 135, 0.16);
  --accent-soft: rgba(126, 203, 135, 0.12);
  --accent-soft-alt: rgba(126, 203, 135, 0.1);
  --accent-soft-strong: rgba(126, 203, 135, 0.2);
  --accent-fill-strong: rgba(126, 203, 135, 0.25);
  --accent-border: rgba(126, 203, 135, 0.3);
  --accent-border-strong: rgba(126, 203, 135, 0.4);
  --warm-glow: rgba(217, 178, 95, 0.15);
  --warm-soft: rgba(217, 178, 95, 0.12);
  --warm-line: rgba(217, 178, 95, 0.6);
  --cursor-glow: rgba(49, 173, 80, 0.25);
  --danger: #d66565;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  --nav-height: 72px;
  --control-height: 112px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #f7f6f2;
  background:
    radial-gradient(circle at top left, var(--accent-glow), transparent 32%),
    radial-gradient(circle at 85% 10%, var(--warm-glow), transparent 25%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: "Segoe UI Variable Display", "Trebuchet MS", "Segoe UI", sans-serif;
}

body.is-loop-selecting,
body.is-loop-selecting * {
  -webkit-user-select: none !important;
  user-select: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

#app {
  width: min(1440px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 120px;
}

.shell-nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--nav-height);
  margin-bottom: 18px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(14, 21, 18, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-group-center {
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-group-right {
  justify-content: flex-end;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brandmark-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft-strong), var(--accent-strong));
}

.brandmark-icon svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: #f5fbf6;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brandmark-wording {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brandmark-wording strong {
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brandmark-wording small,
.nav-link,
.hero-kicker,
.hero-meta,
.track-copy span,
.tool-copy small,
.timeline-copy span,
.revision-card span {
  color: rgba(247, 246, 242, 0.7);
}

.nav-chip,
.nav-pill {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-chip:hover,
.nav-pill:hover,
.control-bar button:hover {
  transform: translateY(-1px);
}

.nav-chip {
  background: var(--warm-soft);
  color: #ffe4a0;
}

.nav-chip.is-accent {
  box-shadow: inset 0 0 0 1px rgba(255, 228, 160, 0.2);
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-pill {
  background: rgba(255, 255, 255, 0.07);
  color: #f7f6f2;
}

.nav-pill span {
  display: inline-flex;
  min-width: 1.45rem;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 101, 101, 0.18);
  color: #ffcfcb;
}

.hero-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(33, 48, 42, 0.94), rgba(19, 28, 24, 0.94));
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10;
}

.hero-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 28px;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: auto -12% 10% 40%;
  height: 180px;
  background: radial-gradient(circle, var(--accent-glow-soft), transparent 70%);
  pointer-events: none;
}

.hero-main,
.hero-rail,
.control-bar,
.track-switcher,
.transport-cluster,
.timeline-cluster {
  display: flex;
  align-items: center;
}

.hero-main {
  justify-content: space-between;
  gap: 24px;
}

.hero-copy h1 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.hero-copy h1 span {
  color: var(--accent);
  font-size: 0.58em;
  font-weight: 500;
}

.hero-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.hero-meta a {
  color: #fff;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.circle-action {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
}

.circle-action svg {
  fill: none;
  stroke: #f7f6f2;
  stroke-width: 1.6;
}

.revision-card {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.revision-card strong {
  display: block;
  margin-top: 4px;
}

.hero-rail {
  gap: 16px;
  margin-top: 24px;
  align-items: flex-start;
}

.hero-search-card {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
}

.hero-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-search-icon {
  color: rgba(247, 246, 242, 0.4);
  flex-shrink: 0;
}

.hero-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f7f6f2;
  font-size: 14px;
  min-width: 0;
}

.hero-search-bar input::placeholder {
  color: rgba(247, 246, 242, 0.35);
}

.hero-search-submit {
  padding: 6px 16px;
  border-radius: 10px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.hero-search-submit:hover {
  background: var(--accent-fill-strong);
}

.hero-search-results {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-search-results.hidden {
  display: none;
}

/* Songsterr search result rows */
.ss-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #f7f6f2;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ss-result:hover {
  background: rgba(126, 203, 135, 0.08);
  border-color: rgba(126, 203, 135, 0.28);
}

.ss-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ss-result-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-result-artist {
  font-size: 11px;
  color: rgba(247, 246, 242, 0.55);
}

.ss-result-tracks {
  font-size: 10px;
  color: rgba(247, 246, 242, 0.42);
  white-space: nowrap;
}

.ss-result-dl {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(126, 203, 135, 0.16);
  color: var(--accent);
  flex-shrink: 0;
}

.ss-result-inlib {
  border-color: rgba(126, 203, 135, 0.28);
  background: rgba(126, 203, 135, 0.06);
}

.ss-result-badge {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(126, 203, 135, 0.2);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ss-loading, .ss-empty {
  padding: 18px;
  text-align: center;
  color: rgba(247, 246, 242, 0.5);
  font-size: 12px;
}

/* ── Songsterr download progress overlay ── */
.ss-progress {
  position: fixed;
  inset: 0;
  z-index: 150000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(14, 20, 17, 0.88), rgba(0, 0, 0, 0.95));
  backdrop-filter: blur(8px);
  padding: 24px;
}

.ss-progress.hidden {
  display: none;
}

.ss-progress-card {
  background: linear-gradient(180deg, rgba(28, 40, 34, 0.98), rgba(16, 22, 19, 0.98));
  border: 1px solid rgba(126, 203, 135, 0.22);
  border-radius: 22px;
  padding: 32px 36px 28px;
  width: min(440px, 100%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.ss-progress-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.ss-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  transition: opacity 0.2s ease;
}

.ss-step[data-state="pending"] {
  opacity: 0.35;
}

.ss-step[data-state="active"] {
  opacity: 1;
}

.ss-step[data-state="done"] {
  opacity: 0.7;
}

.ss-step[data-state="error"] {
  opacity: 1;
}

.ss-step-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ss-step-spinner, .ss-step-check {
  display: none;
}

.ss-step[data-state="active"] .ss-step-spinner {
  display: block;
  color: var(--accent);
  animation: ss-spin 1s linear infinite;
}

.ss-step[data-state="done"] .ss-step-check {
  display: block;
  color: var(--accent);
}

.ss-step[data-state="error"] .ss-step-spinner {
  display: block;
  color: var(--danger);
  animation: none;
}

.ss-step[data-state="pending"] .ss-step-spinner {
  display: block;
  color: rgba(247, 246, 242, 0.25);
  animation: none;
}

@keyframes ss-spin {
  to { transform: rotate(360deg); }
}

.ss-step-label {
  font-size: 13.5px;
  color: rgba(247, 246, 242, 0.8);
  font-weight: 500;
}

.ss-step[data-state="active"] .ss-step-label {
  color: #fff;
  font-weight: 600;
}

.ss-step[data-state="done"] .ss-step-label {
  text-decoration: line-through;
  text-decoration-color: rgba(126, 203, 135, 0.5);
}

.ss-step[data-state="error"] .ss-step-label {
  color: var(--danger);
}

.ss-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.ss-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.hero-sr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}

.hero-sr-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hero-sr-info {
  min-width: 0;
  flex: 1;
}

.hero-sr-title {
  font-size: 13px;
  font-weight: 600;
  color: #f7f6f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-sr-artist {
  font-size: 12px;
  color: rgba(247, 246, 242, 0.5);
}

.hero-sr-dl {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 246, 242, 0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-left: 8px;
  transition: all 0.15s;
}

.hero-sr-dl:hover {
  background: var(--accent-soft-strong);
  color: var(--accent);
  border-color: var(--accent-border-strong);
}

.hero-sr-status {
  padding: 10px;
  font-size: 13px;
  color: rgba(247, 246, 242, 0.5);
  text-align: center;
}

.hero-actions-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
}

/* Recent songs card — fills the gap left by the removed Songsterr
   search bar with a quick-access list of the user's most recent
   uploads. Three rows max, each loads the song on click. */
.hero-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #f7f6f2;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.hero-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.hero-action-btn svg {
  color: var(--accent);
  flex-shrink: 0;
}

.sponsor-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #db61a2, #ea4aaa);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.sponsor-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(219, 97, 162, 0.4);
}

.sponsor-btn svg {
  color: #fff;
  flex-shrink: 0;
}

.control-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  gap: 18px;
  justify-content: space-between;
  margin: 0;
  padding: 12px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  /* Background is effectively opaque (98%), so backdrop-filter blur
     produced no visible effect but cost a full-screen GPU pass on
     every paint. Removed. */
  background: rgb(14, 20, 18);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.track-switcher-wrap {
  /* Anchor for the #mixer-popover, which positions itself absolutely
     relative to this wrapper. */
  position: relative;
  display: flex;
  align-items: center;
}

.track-switcher {
  gap: 14px;
  min-width: 250px;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  border-radius: 14px;
  transition: background 0.16s ease;
}

.track-switcher:hover {
  background: rgba(255, 255, 255, 0.04);
}

.track-switcher[aria-expanded="true"] {
  background: rgba(126, 203, 135, 0.08);
}

.track-chevron {
  margin-left: auto;
  margin-right: 12px;
  color: rgba(247, 246, 242, 0.55);
  display: grid;
  place-items: center;
  transition: transform 0.18s ease;
}

.track-switcher[aria-expanded="true"] .track-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.track-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.track-icon svg {
  fill: var(--accent);
}

.track-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 200px;
}

.track-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-dropdown {
  background: rgba(255, 255, 255, 0.08);
  color: #f7f6f2;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  max-width: 180px;
}

.track-dropdown option {
  background: var(--bg-deep);
  color: #fff;
}

.icon-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f7f6f2;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 6px;
  transition: background 0.2s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Mixer Modal Styles */
.mixer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: grid;
  place-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mixer-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mixer-modal {
  background: var(--bg-deep);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.mixer-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mixer-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
}

.mixer-tracks {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ───── Mixer popover (anchored to track-switcher) ───── */
.mixer-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  width: 420px;
  max-height: calc(100vh - var(--control-height, 112px) - 60px);
  background: rgb(14, 20, 17); /* opaque — blur was a no-op */
  border: 1px solid rgba(126, 203, 135, 0.22);
  border-radius: 18px;
  box-shadow: 0 -22px 60px rgba(0, 0, 0, 0.55),
              0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  z-index: 10001;
  transform-origin: bottom left;
  transform: translateY(8px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0.85, 0.25, 1),
              opacity 0.18s ease,
              visibility 0.18s ease;
}

.mixer-popover:not(.hidden) {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.mixer-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
}

.mixer-popover-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mixer-popover-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 246, 242, 0.55);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.16s ease, color 0.16s ease;
}

.mixer-popover-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f7f6f2;
}

.mixer-popover .mixer-tracks {
  flex: 1;
  min-height: 0;
  padding: 6px 12px 14px;
}

.mixer-popover .mixer-tracks::-webkit-scrollbar {
  width: 8px;
}
.mixer-popover .mixer-tracks::-webkit-scrollbar-thumb {
  background: rgba(126, 203, 135, 0.22);
  border-radius: 4px;
}

/* ── Practice mode (inside control bar, right side) ───────────── */
.practice-section {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.practice-section.is-hidden {
  display: none !important;
}


.practice-divider {
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, transparent, rgba(126, 203, 135, 0.3), transparent);
  flex-shrink: 0;
}

.practice-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.06);
  border: 1px solid rgba(126, 203, 135, 0.22);
}

.practice-head {
  display: flex;
  align-items: center;
  gap: 5px;
}

.practice-icon {
  font-size: 14px;
}

.practice-head strong {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.practice-x {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 246, 242, 0.55);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.practice-x:hover {
  background: rgba(214, 101, 101, 0.18);
  color: #ffb0b0;
}

.practice-body {
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.practice-field label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(247, 246, 242, 0.4);
  font-weight: 600;
  white-space: nowrap;
}

.practice-slider {
  width: 72px;
  height: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
}

.practice-slider-sm {
  width: 48px;
}

.practice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-deep);
}

.practice-pct {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.practice-pct-sm {
  font-size: 11px;
  color: rgba(247, 246, 242, 0.7);
  min-width: 30px;
}

.practice-status {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.12);
  white-space: nowrap;
}

.practice-status:empty {
  display: none;
}

@keyframes practice-pulse {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 12px rgba(126, 203, 135, 0.5); }
}

.speed-inline-pct.is-bumping {
  animation: practice-pulse 0.4s ease;
}

@media (max-width: 540px) {
  .mixer-popover {
    width: calc(100vw - 32px);
    left: -16px;
  }
}

.mixer-track-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  gap: 12px 16px;
  transition: background 0.2s ease;
}

.mixer-fx-panel {
  width: 100%;
}

.mixer-track-item.is-active {
  background: var(--accent-soft-alt);
  border: 1px solid var(--accent-border);
}

.mixer-track-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.mixer-track-name {
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
}

.mixer-track-instrument {
  font-size: 0.8rem;
  color: var(--muted);
}

.mixer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mixer-btn {
  background: rgba(255,255,255,0.05);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mixer-btn.is-active {
  background: var(--accent);
  color: #102117;
}

.mixer-btn svg {
  width: 18px;
  height: 18px;
}

.mixer-vol {
  width: 80px;
  accent-color: var(--accent);
}

.mixer-prog-select {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  width: 120px;
}

/* Songsterr Search Modal */
.ss-modal {
  max-width: 560px;
}

.ss-auth-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(214, 101, 101, 0.12);
  border-bottom: 1px solid rgba(214, 101, 101, 0.2);
  color: rgba(255, 200, 200, 0.9);
  font-size: 0.85rem;
}

.ss-auth-banner.hidden { display: none; }

.ss-login-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #102117;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ss-login-btn:disabled { opacity: 0.5; }

.ss-search-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ss-search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.ss-search-bar input:focus {
  border-color: var(--accent);
}

.ss-search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.ss-search-submit {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #102117;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.ss-search-submit:hover { opacity: 0.85; }

.ss-status {
  padding: 10px 16px;
  font-size: 0.82rem;
  text-align: center;
}

.ss-status.hidden { display: none; }
.ss-status-loading { color: rgba(255, 255, 255, 0.6); }
.ss-status-error { color: #f0a0a0; background: rgba(214, 101, 101, 0.08); }
.ss-status-success { color: var(--accent); }
.ss-status-info { color: rgba(255, 255, 255, 0.5); }

.ss-results {
  padding: 8px 12px;
  overflow-y: auto;
  max-height: calc(80vh - 200px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ss-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.ss-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ss-result-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.ss-result-title {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-result-artist {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 2px;
}

.ss-result-tracks {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.ss-download-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}

.ss-download-btn:hover {
  background: var(--accent);
  color: #102117;
}

.ss-download-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.ss-track-list {
  margin-top: 8px;
  padding: 8px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ss-track-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.ss-track-name {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.ss-track-views {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.ss-footer {
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-footer .ss-online { color: var(--accent); }

.ss-hint {
  opacity: 0.6;
  font-style: italic;
}

.ss-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ss-spin 0.6s linear infinite;
}

@keyframes ss-spin {
  to { transform: rotate(360deg); }
}

/* FX Panel Styles (embedded in mixer tracks) */
.mixer-fx-panel {
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
}

.mixer-fx-panel.hidden {
  display: none;
}

.mixer-fx-btn.is-active {
  background: var(--accent-soft-strong) !important;
  color: var(--accent) !important;
  border-color: var(--accent-border-strong) !important;
}

.fx-section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fx-section:last-child {
  border-bottom: none;
}

.fx-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fx-section-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.fx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.fx-row label {
  min-width: 68px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.fx-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}

.fx-value {
  min-width: 56px;
  text-align: right;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
}

.fx-toggle {
  padding: 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fx-toggle.is-on {
  background: var(--accent);
  color: #102117;
  border-color: var(--accent);
}

.fx-reset-btn {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fx-reset-btn:hover {
  background: rgba(214, 101, 101, 0.15);
  color: var(--danger);
  border-color: rgba(214, 101, 101, 0.3);
}

.transport-cluster {
  flex: 1;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.play-toggle,
.tool-button {
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.07);
}

.speed-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 60px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
}

.speed-inline-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(247, 246, 242, 0.55);
  font-weight: 600;
  white-space: nowrap;
}

.speed-inline-slider {
  width: 80px;
  height: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
}

.speed-inline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-deep);
}

.speed-inline-pct {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.play-toggle {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.play-svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: #f7f6f2;
  stroke-width: 2;
}

.play-svg circle {
  fill: rgba(126, 203, 135, 0.18);
  stroke: rgba(255, 255, 255, 0.16);
}

.pause-shape {
  display: none;
}

#root[data-playing="on"] .play-shape {
  display: none;
}

#root[data-playing="on"] .pause-shape {
  display: inline;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: 18px;
  color: #fff;
}

.tool-button.is-locked {
  opacity: 0.72;
}

.tool-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #dfe8e1;
  font-weight: 700;
}

.tool-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.timeline-cluster {
  min-width: 290px;
  gap: 14px;
}

.timeline-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 108px;
}

#measure-slider {
  flex: 1;
  accent-color: var(--accent);
}

.time-copy {
  min-width: 100px;
  text-align: right;
  color: rgba(247, 246, 242, 0.7);
  font-variant-numeric: tabular-nums;
}

.tab-page {
  padding-bottom: 32px;
}

.tab-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(126, 203, 135, 0.08);
  border: 1px solid rgba(126, 203, 135, 0.22);
  font-size: 13px;
  color: rgba(247, 246, 242, 0.8);
  animation: hint-fade-in 0.5s ease;
}

.tab-hint.hidden {
  display: none;
}

.tab-hint-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.tab-hint-text {
  flex: 1;
}

.tab-hint-close {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 246, 242, 0.5);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.tab-hint-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

@keyframes hint-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

#tablature {
  padding: 24px;
  border-radius: 26px;
  /* alphaTab renders the score as a transparent SVG, so the "paper"
     colour is just whatever background sits behind it. We bind to
     --paper-rgba (paper colour + paperAlpha) so the Tema panel can
     make the score sheet translucent and let the page background
     image show through. */
  background: var(--paper-rgba, var(--paper));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  /* DO NOT set overflow: hidden here — alphaTab's score can be many
     thousands of pixels tall and clipping it makes the bottom half
     invisible when the user scrolls down. */
}

/* AlphaTab specific styles to match mockup */
.at-wrap {
  width: 100%;
}

.at-cursor-bar {
  background: transparent;
  z-index: 1;
}

.at-cursor-beat {
  background: var(--cursor-glow);
  border-radius: 4px;
  z-index: 1;
}

/* AlphaTab Selection / Loop Highlight
 *
 * Just a translucent background tint — no edge markers. Two
 * previous attempts at drawing start/end bars (1 px box-shadow,
 * then 2 px pseudo-elements) both ended up dancing around as the
 * underlying div was resized during a drag. Letting the browser
 * paint a flat fill is the only thing that survives every drag
 * frame cleanly.
 */
.at-selection div {
  background: var(--warm-soft) !important;
}

/* alphaTab adds .at-highlight to the currently-playing beat. Originally
 * we forced fill/stroke to inherit on every descendant SVG node so the
 * notes wouldn't disappear under the cursor highlight, but the cursor
 * is actually a translucent background div that sits BEHIND the SVG —
 * the override was unnecessary and was triggering visible re-rendering
 * artefacts on bend / vibrato / slide path glyphs as the cursor walked
 * over them (they would visibly thicken).
 *
 * Leave the original svg attributes alone.
 */

@media (max-width: 1180px) {
  #app {
    width: calc(100vw - 20px);
  }

  .shell-nav,
  .hero-main,
  .hero-rail,
  .control-bar {
    flex-wrap: wrap;
  }

  .nav-group-center,
  .transport-cluster,
  .timeline-cluster {
    justify-content: flex-start;
  }

  .timeline-cluster {
    width: 100%;
  }
}

@media (max-width: 780px) {
  :root {
    --nav-height: 116px;
    --control-height: 168px;
  }

  #app {
    width: calc(100vw - 14px);
    padding-top: 8px;
  }

  .shell-nav,
  .hero-card,
  .control-bar,
  .tab-line {
    border-radius: 20px;
  }

  .shell-nav,
  .hero-card,
  .control-bar {
    padding: 16px;
  }

  .hero-copy h1 {
    line-height: 1;
  }

  .hero-actions-card {
    flex-direction: row;
  }

  .hero-action-btn {
    flex: 1;
    justify-content: center;
  }

  .track-switcher,
  .transport-cluster,
  .timeline-cluster {
    width: 100%;
  }

  .transport-cluster {
    gap: 10px;
  }

  .tool-button {
    flex: 1 1 140px;
    justify-content: center;
  }
}

/* ─── Library Modal ─── */
.lib-modal {
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.lib-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lib-import-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.lib-import-btn:hover {
  background: var(--accent-fill-strong);
}

.lib-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.lib-category-bar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.lib-cat-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(247,246,242,0.5);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.lib-cat-btn:hover {
  color: rgba(247,246,242,0.8);
  border-color: rgba(255,255,255,0.2);
}

.lib-cat-btn.is-active {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}

.lib-empty {
  text-align: center;
  color: rgba(247, 246, 242, 0.5);
  padding: 40px 20px;
  font-size: 14px;
  line-height: 1.6;
}

.lib-song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s;
}

.lib-song-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lib-song-item.is-active {
  background: var(--accent-soft-alt);
  border-left: 3px solid var(--accent);
}

.lib-song-info {
  flex: 1;
  min-width: 0;
}

.lib-song-title {
  font-weight: 600;
  font-size: 14px;
  color: #f7f6f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-song-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: rgba(247, 246, 242, 0.5);
  margin-top: 3px;
}

.lib-song-artist {
  color: rgba(247, 246, 242, 0.7);
}

.lib-song-notes {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.14);
  color: var(--accent);
  border: 1px solid rgba(126, 203, 135, 0.28);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: auto;
}

.lib-song-actions {
  display: flex;
  gap: 6px;
  margin-left: 12px;
  flex-shrink: 0;
}

.lib-load-btn,
.lib-delete-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 246, 242, 0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.lib-load-btn:hover {
  background: var(--accent-soft-strong);
  color: var(--accent);
  border-color: var(--accent-border-strong);
}

.lib-delete-btn:hover {
  background: rgba(255, 80, 80, 0.2);
  color: #ff5050;
  border-color: rgba(255, 80, 80, 0.4);
}

/* Theme Modal */
.theme-modal {
  max-width: 720px;
}

.theme-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.theme-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.theme-preset-btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f7f6f2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme-preset-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.theme-preset-btn.is-active {
  border-color: var(--accent-border-strong);
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theme-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(247, 246, 242, 0.82);
  font-size: 13px;
}

.theme-field span {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.theme-color-input {
  width: 100%;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.theme-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.theme-color-input::-webkit-color-swatch {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.theme-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-section {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-field-wide {
  /* Full-width variant of .theme-field for sliders + image picker */
}

.theme-range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-range-input {
  flex: 1;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  outline: none;
}

.theme-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-deep);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.theme-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-deep);
}

.theme-range-row output {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.theme-bg-image-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-bg-image-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.theme-bg-image-info strong {
  font-size: 13px;
  color: #f7f6f2;
}

.theme-bg-image-info span {
  font-size: 11px;
  color: rgba(247, 246, 242, 0.55);
}

.theme-bg-image-actions {
  display: flex;
  gap: 6px;
}

.theme-bg-image-btn {
  background: var(--accent);
  color: var(--bg-deep);
  border: 0;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.theme-bg-image-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(126, 203, 135, 0.32);
}

.theme-bg-image-btn-ghost {
  background: transparent;
  color: rgba(247, 246, 242, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-bg-image-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  box-shadow: none;
}

/* When a background image is active, dim the body's default radial
   glows that would otherwise muddy the picture. */
body.has-bg-image {
  background-color: #000;
}

/* While the AI reader is open, lock the page so the user can only
   scroll inside the reader-body. Without this the wheel keeps trying
   to scroll the underlying #tablature, which forces the browser to
   recomposite the entire viewport (very expensive when a background
   image + backdrop-filter blur are stacked behind the reader). */
body.ai-reader-open {
  overflow: hidden;
}

.theme-reset-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #f7f6f2;
  cursor: pointer;
  transition: background 0.15s ease;
}

.theme-reset-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.theme-save-status {
  color: rgba(247, 246, 242, 0.62);
  font-size: 13px;
}

.theme-save-status.is-error {
  color: #ffb0b0;
}

@media (max-width: 780px) {
  .theme-presets,
  .theme-grid {
    grid-template-columns: 1fr 1fr;
  }

  .theme-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ───────────────────────── AI Drawer ──────────────────────────────── */
/* Selection-locked buttons: visible but dimmed until a region is selected */
.tool-button.is-locked,
.ai-trigger.is-locked {
  opacity: 0.35;
  filter: saturate(0.4);
  cursor: not-allowed;
  pointer-events: auto; /* still clickable so we can show the toast */
}

.tool-button.is-locked:hover,
.ai-trigger.is-locked:hover {
  opacity: 0.5;
}

/* Toast notification */
.am-toast {
  position: fixed;
  bottom: calc(var(--control-height, 112px) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(28, 40, 34, 0.96);
  border: 1px solid rgba(126, 203, 135, 0.32);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  z-index: 100000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s ease;
}

.am-toast.hidden {
  display: none;
}

.am-toast.am-toast-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

.ai-trigger {
  position: relative;
}

/* Toolbar pill — small "remaining/limit" badge on the AI button */
.ai-quota-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.16);
  border: 1px solid rgba(126, 203, 135, 0.32);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.ai-quota-pill.is-low {
  background: rgba(217, 178, 95, 0.18);
  border-color: rgba(217, 178, 95, 0.4);
  color: var(--accent-warm);
}

.ai-quota-pill.is-empty {
  background: rgba(214, 101, 101, 0.18);
  border-color: rgba(214, 101, 101, 0.4);
  color: #ffb0b0;
}

.ai-quota-pill.is-unlimited {
  background: rgba(126, 203, 135, 0.22);
  color: var(--accent);
  font-size: 13px;
  padding: 0 8px;
}

/* Drawer header — bar + text "Bugün X/Y" */
.ai-quota-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(247, 246, 242, 0.6);
}

.ai-quota-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  max-width: 160px;
}

.ai-quota-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.3s ease, background 0.3s ease;
}

.ai-quota-bar-fill.is-low {
  background: linear-gradient(90deg, var(--accent-warm), #c7942e);
}
.ai-quota-bar-fill.is-empty {
  background: linear-gradient(90deg, var(--danger), #a64343);
}
.ai-quota-bar-fill.is-unlimited {
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}

.ai-quota-text {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ai-tool-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.ai-trigger.ai-has-selection {
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 22px var(--accent-glow);
}

.ai-trigger.ai-has-selection::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 203, 135, 0.25);
  animation: ai-pulse 1.6s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  z-index: 100050;
  /* Opaque gradient — backdrop-filter blur was a no-op behind it
     and triggered a full-screen GPU pass on every scroll. */
  background: linear-gradient(180deg,
    rgb(20, 28, 24) 0%,
    rgb(14, 20, 17) 100%);
  border-left: 1px solid rgba(126, 203, 135, 0.18);
  box-shadow: -22px 0 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.32s cubic-bezier(0.2, 0.85, 0.25, 1),
              opacity 0.22s ease,
              visibility 0.22s ease;
  opacity: 1;
  visibility: visible;
  /* Promote to its own composite layer so the slide animation
     doesn't repaint the underlying tab on every frame. */
  will-change: transform;
}

.ai-drawer.hidden {
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ai-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* min-height: 0 lets flex children shrink past their content size,
     which is what unlocks the inner overflow-y: auto on the notes list
     and the result area. Without it the notes list grows past the
     viewport height and the user can't scroll to the bottom. */
  min-height: 0;
  padding: 20px 22px 24px;
  gap: 16px;
  overflow: hidden;
}

.ai-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-drawer-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.ai-drawer-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: var(--bg-deep);
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(126, 203, 135, 0.25);
}

.ai-drawer-title h2 {
  margin: 0 0 4px;
  font-size: 1.12rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.ai-drawer-title p {
  margin: 0;
  font-size: 12.5px;
  color: rgba(247, 246, 242, 0.62);
  line-height: 1.4;
}

/* Selection summary card */
.ai-selection-card {
  background: rgba(126, 203, 135, 0.06);
  border: 1px solid rgba(126, 203, 135, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-sel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.ai-sel-label {
  color: rgba(247, 246, 242, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
  font-weight: 600;
}

.ai-sel-row strong {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.ai-sel-tags-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

.ai-sel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  flex: 1;
}

.ai-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.16);
  color: var(--accent);
  border: 1px solid rgba(126, 203, 135, 0.28);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ai-tag-muted {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(247, 246, 242, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Preset grid */
.ai-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-preset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #f7f6f2;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.ai-preset:hover:not(:disabled) {
  background: rgba(126, 203, 135, 0.1);
  border-color: rgba(126, 203, 135, 0.36);
  transform: translateY(-1px);
}

.ai-preset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-preset-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(126, 203, 135, 0.18);
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
}

.ai-preset-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ai-preset-text strong {
  font-size: 12.5px;
  color: #fff;
  font-weight: 600;
}

.ai-preset-text small {
  font-size: 10.5px;
  color: rgba(247, 246, 242, 0.55);
  margin-top: 1px;
}

/* Question form */
.ai-question-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-question-form label {
  font-size: 10.5px;
  color: rgba(247, 246, 242, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.ai-question-row {
  display: flex;
  gap: 8px;
}

.ai-question-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ai-question-row input:focus {
  border-color: var(--accent);
  background: rgba(126, 203, 135, 0.07);
}

.ai-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg-deep);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.ai-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(126, 203, 135, 0.3);
}

.ai-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ai-send-btn.is-sending svg {
  animation: ai-spin 0.9s linear infinite;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

/* Result area */
.ai-result {
  flex: 1;
  min-height: 0;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-result::-webkit-scrollbar {
  width: 8px;
}
.ai-result::-webkit-scrollbar-thumb {
  background: rgba(126, 203, 135, 0.22);
  border-radius: 4px;
}
.ai-result::-webkit-scrollbar-track {
  background: transparent;
}

.ai-result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 32px 8px;
  color: rgba(247, 246, 242, 0.55);
}

.ai-result-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.ai-result-empty p strong {
  color: #fff;
  font-size: 13.5px;
}

.ai-empty-sub {
  font-size: 12px !important;
  color: rgba(247, 246, 242, 0.45) !important;
  max-width: 280px;
}

.ai-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(126, 203, 135, 0.1);
  color: var(--accent);
  margin-bottom: 6px;
}

.ai-empty-flash {
  animation: ai-flash 0.55s ease;
}

@keyframes ai-flash {
  0%, 100% { background: transparent; }
  40% { background: rgba(217, 178, 95, 0.16); }
}

/* Streaming response */
.ai-response {
  color: #f4f3ee;
  font-size: 13.5px;
  line-height: 1.62;
  word-wrap: break-word;
}

.ai-turn + .ai-turn,
.ai-turn:not(:first-child) {
  margin-top: 4px;
}

.ai-thread-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
  color: rgba(247, 246, 242, 0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-thread-sep::before,
.ai-thread-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 203, 135, 0.22), transparent);
}

.ai-thread-sep span {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.ai-response h1, .ai-response h2, .ai-response h3,
.ai-response h4, .ai-response h5, .ai-response h6 {
  color: #fff;
  margin: 18px 0 6px;
  letter-spacing: 0.01em;
}

.ai-response h1:first-child,
.ai-response h2:first-child,
.ai-response h3:first-child {
  margin-top: 0;
}

.ai-response h1 { font-size: 1.18rem; }
.ai-response h2 { font-size: 1.06rem; color: var(--accent); }
.ai-response h3 { font-size: 0.97rem; color: var(--accent-warm); }
.ai-response h4 { font-size: 0.92rem; }

.ai-response p {
  margin: 0 0 10px;
}

.ai-response ul, .ai-response ol {
  margin: 6px 0 12px;
  padding-left: 22px;
}

.ai-response li {
  margin-bottom: 4px;
}

.ai-response strong { color: #fff; }
.ai-response em { color: rgba(247, 246, 242, 0.85); }

.ai-response code {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  background: rgba(126, 203, 135, 0.12);
  border: 1px solid rgba(126, 203, 135, 0.22);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
}

.ai-pre {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(126, 203, 135, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 11px 13px;
  margin: 10px 0;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
}

.ai-pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #cfe9d3;
  font-size: 12px;
}

.ai-response blockquote {
  border-left: 3px solid var(--accent-warm);
  background: rgba(217, 178, 95, 0.07);
  padding: 8px 12px;
  margin: 10px 0;
  color: rgba(247, 246, 242, 0.85);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(126, 203, 135, 0.07);
  border: 1px solid rgba(126, 203, 135, 0.22);
  border-radius: 11px;
  color: rgba(247, 246, 242, 0.78);
  font-size: 12px;
}

.ai-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(126, 203, 135, 0.25);
  border-top-color: var(--accent);
  animation: ai-spin 0.85s linear infinite;
  flex-shrink: 0;
}

.ai-cancel-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(247, 246, 242, 0.7);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ai-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ai-inline-error {
  background: rgba(214, 101, 101, 0.12);
  border: 1px solid rgba(214, 101, 101, 0.4);
  color: #ffb0b0;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-top: 8px;
}

/* Tabs */
.ai-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.ai-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: rgba(247, 246, 242, 0.6);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  position: relative;
}

.ai-tab:hover {
  color: #f7f6f2;
  background: rgba(255, 255, 255, 0.04);
}

.ai-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg-deep);
}

.ai-tab-icon {
  display: inline-flex;
  align-items: center;
}

.ai-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(217, 178, 95, 0.95);
  color: var(--bg-deep);
  font-size: 10.5px;
  font-weight: 700;
  margin-left: 4px;
}

.ai-tab.is-active .ai-tab-badge {
  background: rgba(31, 42, 37, 0.85);
  color: #fff;
}

.ai-tabpanel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.ai-tabpanel[hidden] {
  display: none;
}

/* Notes panel toolbar */
.ai-notes-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-notes-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 0 11px;
  color: rgba(247, 246, 242, 0.55);
  transition: border-color 0.16s ease;
}

.ai-notes-search:focus-within {
  border-color: var(--accent);
  color: var(--accent);
}

.ai-notes-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 9px 0;
  font-size: 12.5px;
  outline: none;
}

.ai-notes-scope {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}

.ai-scope-btn {
  border: 0;
  background: transparent;
  color: rgba(247, 246, 242, 0.6);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.ai-scope-btn:hover {
  color: #f7f6f2;
}

.ai-scope-btn.is-active {
  background: var(--accent);
  color: var(--bg-deep);
}

/* Notes list */
.ai-notes-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-right: 4px;
}

.ai-notes-list::-webkit-scrollbar {
  width: 8px;
}
.ai-notes-list::-webkit-scrollbar-thumb {
  background: rgba(126, 203, 135, 0.22);
  border-radius: 4px;
}

.ai-notes-empty {
  text-align: center;
  padding: 36px 16px;
  color: rgba(247, 246, 242, 0.55);
}

.ai-notes-empty p {
  margin: 0 0 6px;
  font-size: 13px;
}

.ai-notes-error {
  background: rgba(214, 101, 101, 0.12);
  border: 1px solid rgba(214, 101, 101, 0.35);
  color: #ffb0b0;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12.5px;
}

/* Note card */
.ai-note-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ai-note-card:hover {
  border-color: rgba(126, 203, 135, 0.32);
  background: rgba(126, 203, 135, 0.04);
}

.ai-note-card.is-active-thread {
  border-color: var(--accent);
  background: rgba(126, 203, 135, 0.07);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.ai-note-card.is-expanded {
  background: rgba(126, 203, 135, 0.05);
  border-color: rgba(126, 203, 135, 0.32);
}

.ai-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
  cursor: pointer;
}

.ai-note-titlewrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ai-note-bar {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.ai-note-song {
  font-size: 11.5px;
  color: rgba(247, 246, 242, 0.55);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-note-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.ai-note-actions button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: rgba(247, 246, 242, 0.55);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 14px;
}

.ai-note-actions button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.ai-note-star.is-on {
  color: var(--accent-warm);
}

.ai-note-del:hover {
  color: var(--danger);
}

.ai-note-preview {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 0 14px 8px;
}

.ai-note-preview-text {
  font-size: 12.5px;
  color: rgba(247, 246, 242, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-note-preview-date {
  font-size: 10.5px;
  color: rgba(247, 246, 242, 0.42);
  flex-shrink: 0;
}

.ai-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 14px 12px;
}

.ai-note-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(247, 246, 242, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ai-note-chip-tech {
  background: rgba(126, 203, 135, 0.12);
  color: var(--accent);
  border-color: rgba(126, 203, 135, 0.25);
}

.ai-note-chip-track {
  background: rgba(217, 178, 95, 0.12);
  color: var(--accent-warm);
  border-color: rgba(217, 178, 95, 0.28);
}

.ai-note-chip-track-other {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(247, 246, 242, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Note card faded when its track ≠ currently active track */
.ai-note-card.is-other-track {
  opacity: 0.55;
  filter: saturate(0.6);
}

.ai-note-card.is-other-track:hover {
  opacity: 0.85;
  filter: saturate(0.85);
}

.ai-note-card.is-other-track .ai-note-bar {
  color: rgba(247, 246, 242, 0.55);
}

.ai-note-body {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(126, 203, 135, 0.18);
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-turn-user {
  display: flex;
}

.ai-turn-tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-turn-saved {
  font-size: 13px;
  line-height: 1.6;
  color: #f4f3ee;
}

.ai-turn-saved h1, .ai-turn-saved h2, .ai-turn-saved h3 {
  color: #fff;
  margin: 12px 0 5px;
}
.ai-turn-saved h2 { color: var(--accent); font-size: 0.98rem; }
.ai-turn-saved h3 { color: var(--accent-warm); font-size: 0.92rem; }
.ai-turn-saved p { margin: 0 0 8px; }
.ai-turn-saved code {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  background: rgba(126, 203, 135, 0.12);
  border: 1px solid rgba(126, 203, 135, 0.22);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}
.ai-turn-saved pre {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(126, 203, 135, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
  padding: 9px 11px;
  margin: 8px 0;
  overflow-x: auto;
  font-size: 11.5px;
}
.ai-turn-saved pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #cfe9d3;
}

.ai-note-continue {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.ai-note-continue-btn {
  background: transparent;
  border: 1px dashed rgba(126, 203, 135, 0.4);
  color: var(--accent);
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.ai-note-continue-btn:hover {
  background: rgba(126, 203, 135, 0.1);
  border-color: var(--accent);
}

/* Follow-up suggestion chips */
.ai-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(126, 203, 135, 0.18);
}

.ai-followups-label {
  font-size: 10.5px;
  color: rgba(247, 246, 242, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-right: 4px;
}

.ai-followup-chip {
  background: rgba(126, 203, 135, 0.08);
  border: 1px solid rgba(126, 203, 135, 0.28);
  color: var(--accent);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.14s ease, border-color 0.16s ease;
  text-align: left;
}

.ai-followup-chip:hover {
  background: rgba(126, 203, 135, 0.18);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ───────────────────────── Auth ──────────────────────────────────── */
.am-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  /* Gradient is dense enough that we only need a light blur — keeps
     the look but spares a heavy GPU pass. */
  background: radial-gradient(circle at center, rgba(20, 28, 24, 0.95), rgba(8, 12, 10, 0.99));
  backdrop-filter: blur(8px);
  font-family: inherit;
}

.am-auth-card {
  background: linear-gradient(180deg, rgba(28, 40, 34, 0.96), rgba(16, 22, 19, 0.96));
  border: 1px solid rgba(126, 203, 135, 0.22);
  border-radius: 22px;
  padding: 38px 36px 32px;
  width: min(380px, calc(100vw - 32px));
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  color: #f7f6f2;
}

.am-auth-icon {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 32px rgba(126, 203, 135, 0.32);
}

.am-auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.am-auth-card p {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: rgba(247, 246, 242, 0.62);
}

.am-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #fff;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.16s ease;
}

.am-auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.am-auth-note {
  margin: 18px 0 0;
  font-size: 11px;
  color: rgba(247, 246, 242, 0.42);
  letter-spacing: 0.04em;
}

/* User badge in header */
.am-user-badge {
  position: relative;
  margin-left: 10px;
}

.am-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.12);
  border: 1px solid rgba(126, 203, 135, 0.28);
  color: #f7f6f2;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
  font-family: inherit;
}

.am-user-pill:hover {
  background: rgba(126, 203, 135, 0.18);
  border-color: var(--accent);
}

.am-user-pill img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.am-user-init {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: var(--bg-deep);
  font-weight: 700;
  font-size: 13px;
}

.am-user-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-deep);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.am-user-menu.hidden {
  display: none;
}

.am-user-menu-email {
  font-size: 12px;
  color: rgba(247, 246, 242, 0.55);
  padding: 6px 10px 2px;
  word-break: break-all;
}

.am-user-menu-plan {
  font-size: 11px;
  color: var(--accent);
  padding: 0 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.am-user-menu-item {
  background: transparent;
  border: 0;
  color: #f7f6f2;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.am-user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Tab pin markers */
.ai-pin-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
  width: 100%;
  height: 100%;
}

.ai-pin {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transform: translate(-50%, -100%);
  padding: 3px 8px 3px 6px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(126, 203, 135, 0.95), rgba(87, 168, 100, 0.95));
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3),
              0 0 0 2px rgba(126, 203, 135, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.ai-pin.is-other-track {
  background: linear-gradient(135deg, rgba(150, 160, 156, 0.78), rgba(110, 122, 117, 0.78));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22),
              0 0 0 2px rgba(255, 255, 255, 0.05);
  opacity: 0.55;
}

.ai-pin.is-other-track:hover {
  opacity: 0.95;
}

.ai-pin:hover {
  transform: translate(-50%, -100%) scale(1.08);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4),
              0 0 0 3px rgba(126, 203, 135, 0.32);
}

.ai-pin-dot {
  font-size: 11px;
  line-height: 1;
}

.ai-pin-num {
  font-size: 11px;
  letter-spacing: 0.02em;
}

@media (max-width: 540px) {
  .ai-drawer {
    width: 100vw;
  }
  .ai-presets {
    grid-template-columns: 1fr;
  }
}

/* ───────────────────────── AI Note Reader ────────────────────────── */
/* Full-screen modal for reading a single saved thread comfortably.
   The drawer (440px wide) is too cramped for long answers; opening a
   note here gives the user a 760px max-width reading column with
   generous padding and large enough type. */
.ai-reader {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ai-reader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ai-reader-backdrop {
  position: absolute;
  inset: 0;
  /* Slightly denser background lets us drop the blur radius from
     16px to 8px without losing the "behind glass" look. */
  background: radial-gradient(circle at center, rgba(8, 12, 10, 0.82), rgba(0, 0, 0, 0.92));
  backdrop-filter: blur(8px);
}

.ai-reader-card {
  position: relative;
  background: linear-gradient(180deg, rgba(28, 40, 34, 0.99), rgba(16, 22, 19, 0.99));
  border: 1px solid rgba(126, 203, 135, 0.22);
  border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-reader-title {
  flex: 1;
  min-width: 0;
}

.ai-reader-bar {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(126, 203, 135, 0.16);
  color: var(--accent);
  border: 1px solid rgba(126, 203, 135, 0.32);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.ai-reader-title h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.ai-reader-meta {
  font-size: 12px;
  color: rgba(247, 246, 242, 0.5);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-reader-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ai-reader-icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 246, 242, 0.75);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.ai-reader-icon-btn:hover {
  background: rgba(126, 203, 135, 0.12);
  color: var(--accent);
  border-color: rgba(126, 203, 135, 0.32);
}

#ai-reader-star.is-on {
  background: rgba(217, 178, 95, 0.18);
  color: var(--accent-warm);
  border-color: rgba(217, 178, 95, 0.4);
}

.ai-reader-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-reader-body::-webkit-scrollbar {
  width: 10px;
}
.ai-reader-body::-webkit-scrollbar-thumb {
  background: rgba(126, 203, 135, 0.28);
  border-radius: 5px;
}
.ai-reader-body::-webkit-scrollbar-track {
  background: transparent;
}

/* Turn rendering inside the reader */
.ai-reader-turn-user {
  display: flex;
}

.ai-reader-turn-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-reader-turn-ai {
  font-size: 15px;
  line-height: 1.72;
  color: #f4f3ee;
}

.ai-reader-turn-ai h1 {
  font-size: 1.45rem;
  color: #fff;
  margin: 22px 0 10px;
}
.ai-reader-turn-ai h2 {
  font-size: 1.22rem;
  color: var(--accent);
  margin: 22px 0 10px;
}
.ai-reader-turn-ai h3 {
  font-size: 1.06rem;
  color: var(--accent-warm);
  margin: 18px 0 8px;
}
.ai-reader-turn-ai h1:first-child,
.ai-reader-turn-ai h2:first-child,
.ai-reader-turn-ai h3:first-child {
  margin-top: 0;
}
.ai-reader-turn-ai p {
  margin: 0 0 12px;
}
.ai-reader-turn-ai ul,
.ai-reader-turn-ai ol {
  margin: 8px 0 14px;
  padding-left: 26px;
}
.ai-reader-turn-ai li {
  margin-bottom: 6px;
}
.ai-reader-turn-ai strong {
  color: #fff;
}
.ai-reader-turn-ai code {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  background: rgba(126, 203, 135, 0.12);
  border: 1px solid rgba(126, 203, 135, 0.22);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
}
.ai-reader-turn-ai pre {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(126, 203, 135, 0.2);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  padding: 14px 18px;
  margin: 14px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.62;
}
.ai-reader-turn-ai pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #cfe9d3;
  font-size: 13px;
}
.ai-reader-turn-ai blockquote {
  border-left: 3px solid var(--accent-warm);
  background: rgba(217, 178, 95, 0.07);
  padding: 10px 16px;
  margin: 14px 0;
  color: rgba(247, 246, 242, 0.85);
  border-radius: 0 10px 10px 0;
}

.ai-reader-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(247, 246, 242, 0.35);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 6px 0;
}

.ai-reader-sep::before,
.ai-reader-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 203, 135, 0.2), transparent);
}

.ai-reader-foot {
  padding: 16px 28px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ai-reader-continue-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg-deep);
  border: 0;
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.16s ease;
  font-family: inherit;
}

.ai-reader-continue-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(126, 203, 135, 0.35);
}

@media (max-width: 720px) {
  .ai-reader {
    padding: 0;
  }
  .ai-reader-card {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
  }
  .ai-reader-body {
    padding: 18px 22px 24px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION BAR — Pratik / Atölye toggle
   ═══════════════════════════════════════════════════════════════ */

.app-nav {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.app-nav-btn {
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: rgba(247,246,242,0.5);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.app-nav-btn:hover {
  color: rgba(247,246,242,0.8);
  border-color: rgba(255,255,255,0.15);
}

.app-nav-btn.is-active {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   ATÖLYE (WORKSHOP) — AI tab generation
   ═══════════════════════════════════════════════════════════════ */

.atolye-view {
  min-height: calc(100vh - 42px);
  background: var(--bg);
}

.atolye-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 42px);
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.atolye-sidebar {
  background: var(--bg-deep);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.atolye-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.atolye-sidebar-head strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(247,246,242,0.5);
}

.atolye-new-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.atolye-new-btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

.atolye-pieces-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.atolye-pieces-empty {
  padding: 20px 14px;
  text-align: center;
  color: rgba(247,246,242,0.3);
  font-size: 12px;
}

.atolye-piece-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: rgba(247,246,242,0.7);
  font-size: 12px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.atolye-piece-item:hover {
  background: rgba(255,255,255,0.06);
}

.atolye-piece-item.is-active {
  background: rgba(126,203,135,0.12);
  color: var(--accent);
}

.atolye-piece-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.atolye-piece-fav {
  color: var(--accent-warm);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Main area ───────────────────────────────────────────────── */

.atolye-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Renderer ────────────────────────────────────────────────── */

.atolye-renderer {
  position: relative;
  min-height: 200px;
  max-height: 45vh;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-deep);
}

.atolye-empty-renderer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: rgba(247,246,242,0.25);
  gap: 8px;
}

.atolye-empty-renderer .atolye-empty-icon {
  font-size: 32px;
  opacity: 0.5;
}

.atolye-empty-renderer p {
  font-size: 13px;
}

.atolye-alphatab {
  display: none;
  background: var(--paper-rgba, var(--paper));
  border-radius: 16px;
  padding: 16px;
  margin: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.atolye-renderer-controls {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-deep);
  border-top: 1px solid rgba(255,255,255,0.06);
  justify-content: center;
  flex-shrink: 0;
}

.atolye-ctrl-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(247,246,242,0.8);
  cursor: pointer;
  transition: all 0.15s ease;
}

.atolye-ctrl-btn:hover {
  background: rgba(126,203,135,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.atolye-ctrl-btn.is-fav {
  border-color: var(--accent-warm);
}

.atolye-lib-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(126,203,135,0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.atolye-lib-btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

.atolye-lib-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ── Chat ────────────────────────────────────────────────────── */

.atolye-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.atolye-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atolye-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 10px;
  flex: 1;
}

.atolye-empty-state .atolye-empty-icon {
  font-size: 48px;
}

.atolye-empty-state h3 {
  font-size: 20px;
  color: var(--accent);
  margin: 0;
}

.atolye-empty-state p {
  font-size: 13px;
  color: rgba(247,246,242,0.5);
  max-width: 400px;
  line-height: 1.5;
  margin: 0;
}

.atolye-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.atolye-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(126,203,135,0.25);
  background: rgba(126,203,135,0.06);
  color: var(--accent);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.atolye-chip:hover {
  background: rgba(126,203,135,0.15);
  border-color: var(--accent);
}

/* Messages */

.ws-msg {
  max-width: 92%;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.ws-msg--user {
  align-self: flex-end;
  padding: 10px 16px;
  background: rgba(126,203,135,0.15);
  color: rgba(247,246,242,0.9);
  border-bottom-right-radius: 4px;
}

.ws-msg--error {
  align-self: flex-start;
}

/* AI response card */
.ws-card {
  align-self: flex-start;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}

.ws-card-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.ws-card-body {
  flex: 1;
  min-width: 0;
}

.ws-card-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(247,246,242,0.9);
}

.ws-card-sub {
  font-size: 11px;
  color: rgba(247,246,242,0.45);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.ws-card-status {
  font-size: 11px;
  color: var(--accent);
  margin-top: 6px;
}

/* Generating animation */
.ws-card.is-generating {
  border-color: rgba(126,203,135,0.2);
  background: rgba(126,203,135,0.04);
}

.ws-card.is-generating .ws-card-title {
  color: var(--accent);
}

.ws-card-dots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.ws-card-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: ws-dot 1.2s ease-in-out infinite;
}

.ws-card-dots span:nth-child(2) { animation-delay: 0.2s; }
.ws-card-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ws-dot {
  0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.2); }
}

/* Error card */
.ws-msg--error .ws-card-icon { font-size: 20px; }
.ws-msg--error {
  background: rgba(214,101,101,0.08);
  border-color: rgba(214,101,101,0.2);
}
.ws-msg--error .ws-card-title { color: #ffb0b0; }

/* Input bar */

.atolye-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-deep);
}

.atolye-prompt {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
}

.atolye-prompt:focus {
  border-color: var(--accent);
}

.atolye-prompt::placeholder {
  color: rgba(247,246,242,0.3);
}

.atolye-send-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--bg-deep);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.atolye-send-btn:hover {
  filter: brightness(1.15);
}

.atolye-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .atolye-grid {
    grid-template-columns: 1fr;
  }

  .atolye-sidebar {
    display: none;
  }

  .atolye-renderer {
    max-height: 35vh;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING SPOTLIGHT
   ═══════════════════════════════════════════════════════════════ */

.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.onboard-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.onboard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.onboard-spotlight {
  position: absolute;
  border-radius: 999px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
  background: transparent;
  transition: all 0.3s ease;
  z-index: 1;
}

.onboard-card {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 28px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1e2d24 0%, #162018 100%);
  border: 1px solid rgba(126, 203, 135, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(126, 203, 135, 0.08);
  text-align: center;
  z-index: 2;
  animation: onboard-float 0.5s ease both;
}

@keyframes onboard-float {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.onboard-emoji {
  font-size: 44px;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(126, 203, 135, 0.3));
}

.onboard-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.onboard-preview {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(126, 203, 135, 0.15);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.onboard-desc {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(247, 246, 242, 0.65);
}

.onboard-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.onboard-btn {
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboard-btn--primary {
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
}

.onboard-btn--primary:hover {
  filter: brightness(1.15);
  transform: scale(1.03);
}

.onboard-btn--ghost {
  background: transparent;
  color: rgba(247, 246, 242, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.onboard-btn--ghost:hover {
  color: rgba(247, 246, 242, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}
