/* ============================================================
   SWARALAYA — Design System
   Dark premium Indian classical aesthetic. Shared by the main site
   (index.html) and the Stem Separator (stem-frontend), so both look alike.

   Breakpoints: 1100px (wide) · 960px (tablet) · 760px (small tablet)
                · 640px (phone) · 400px (small phone)
   ============================================================ */

/* The reset lives in a layer so that it never outranks the Stem Separator's
   Tailwind utilities (which are layered too). */
@layer base {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
}

:root {
  color-scheme: dark;       /* dark native scrollbars, pickers and form controls */
  --gold:        #f5a623;
  --gold-dark:   #c47d0e;
  --gold-light:  #ffd166;
  --orange:      #e8572a;
  --bg-deep:     #090806;
  --bg-card:     rgba(255,255,255,0.035);
  --bg-hover:    rgba(255,255,255,0.065);
  --bg-active:   rgba(245,166,35,0.14);
  --border:      rgba(255,255,255,0.07);
  --border-gold: rgba(245,166,35,0.32);
  --text-primary: #ede0cc;
  --text-sub:    #86775f;   /* 4.5:1 on the background */
  --text-muted:  #6b5d4b;   /* 3:1 — hints and secondary labels */
  --text-faint:  #3a3028;   /* decoration only (dividers, scrollbars) */
  --radius:      18px;
  --radius-sm:   11px;
  --radius-lg:   24px;
  --gutter:      24px;      /* page side padding */
  --focus-ring:  0 0 0 2px var(--bg-deep), 0 0 0 4px rgba(245,166,35,0.75);
  --shadow-gold: 0 0 50px rgba(245,166,35,0.12);
  --transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Outfit', 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }

a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
img, svg, canvas { max-width: 100%; }

/* Keyboard focus: one consistent ring everywhere */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
:where(input, select, textarea):focus-visible {
  outline: 2px solid rgba(245,166,35,0.7);
  outline-offset: 1px;
}

/* `hidden` always hides, even on elements whose class sets a display */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Ambient Background ── */
.bg-orb {
  position: fixed;
  max-width: 90vw;
  max-height: 90vw;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #f5a62335, transparent 70%);
  top: -250px; right: -150px;
  animation: orbFloat 14s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #e8572a28, transparent 70%);
  bottom: 50px; left: -150px;
  animation: orbFloat 18s ease-in-out infinite reverse;
}
.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #9b59b618, transparent 70%);
  top: 40%; left: 45%;
  animation: orbFloat 22s ease-in-out infinite 5s;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-45px) scale(1.04); }
}

/* ── Header ──
   One row on wide screens (logo · nav · tools); on narrow screens the nav
   drops to its own full-width row under the logo and tools. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "logo nav tools";
  align-items: center;
  gap: 10px 24px;
  padding: 14px 36px;
  line-height: 1.3;         /* pinned: the Stem Separator's Tailwind base uses 1.5 */
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  background: rgba(9,8,6,0.82);
  box-shadow: 0 1px 0 rgba(245,166,35,0.06), 0 4px 24px rgba(0,0,0,0.3);
}
.logo {
  grid-area: logo;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.logo:hover {
  transform: translateY(-1px);
}
.logo-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}
.logo:hover .logo-icon {
  transform: scale(1.1) rotate(15deg);
  filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.4));
}
.logo-text { display: block; min-width: 0; }
.logo-title {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.18rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.07em;
  transition: filter 0.3s ease;
}
.logo:hover .logo-title {
  filter: drop-shadow(0 0 6px rgba(245, 166, 35, 0.3));
}
.logo-sub {
  display: block;
  font-size: 0.62rem;
  color: var(--text-sub);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 400;
  white-space: nowrap;
}
.header-right {
  grid-area: tools;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Scale (Sa) control — in the Lehra's Now Playing card */
.pitch-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.pitch-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-sub);
}
.pitch-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.4);
  color: var(--gold);
  padding: 6px 32px 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5a623' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  max-width: 100%;
  text-overflow: ellipsis;
}
/* Only the Lehra's Sa selector pulses to invite a choice */
#pitchSelect { animation: pulse-gold 2.5s infinite; }

@keyframes pulse-gold {
  0% { box-shadow: 0 0 0 0 rgba(245,166,35,0.3); }
  50% { box-shadow: 0 0 8px 2px rgba(245,166,35,0.15); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}

.pitch-select:hover, .pitch-select:focus {
  background-color: rgba(245,166,35,0.14);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245,166,35,0.2);
  animation: none;
}
.pitch-select:disabled { opacity: 0.4; cursor: default; }
.pitch-select option {
  background: #1a1208;
  color: var(--text-primary);
  font-weight: 400;
}

.fine-tune-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0 8px;
  transition: border-color 0.3s;
}
.fine-tune-wrap:hover, .fine-tune-wrap:focus-within {
  border-color: rgba(245,166,35,0.4);
}
.fine-tune-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  width: 56px;
  text-align: right;
  outline: none;
  padding: 6px 0;
  -moz-appearance: textfield;
}
.fine-tune-input::-webkit-inner-spin-button,
.fine-tune-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fine-tune-unit {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-left: 4px;
}

.status-badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
  transition: all var(--transition);
}
.status-badge.loading {
  color: var(--gold);
  border-color: var(--border-gold);
  background: rgba(245,166,35,0.08);
  animation: badgePulse 1.2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Secondary button: icon and/or short label (header tools, toolbars, modals) */
.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.header-icon-btn.icon-only { min-width: 34px; padding: 6px; }
.header-icon-btn svg { flex-shrink: 0; }
.btn-label { font-size: 0.75rem; color: inherit; }
.header-icon-btn:hover {
  background: rgba(245,166,35,0.1);
  color: var(--gold);
  border-color: var(--border-gold);
  transform: translateY(-1px);
}
.header-icon-btn:active {
  transform: scale(0.96);
}
.header-icon-btn.active {
  background: rgba(245,166,35,0.18);
  color: var(--gold);
  border-color: rgba(245,166,35,0.5);
  box-shadow: 0 0 15px rgba(245,166,35,0.2);
}
.header-icon-btn:disabled { opacity: 0.45; cursor: default; transform: none; }

/* ── App Container ── */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Now Playing Card ── */
.now-playing-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  background: linear-gradient(135deg,
    rgba(245,166,35,0.055),
    rgba(232,87,42,0.035) 50%,
    rgba(0,0,0,0.05));
  border: 1px solid var(--border-gold);
  border-radius: 26px;
  padding: 32px;
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(245,166,35,0.06);
  transition: box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.now-playing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.3), transparent);
  pointer-events: none;
}
.now-playing-card.playing {
  box-shadow: 0 0 80px rgba(245,166,35,0.22), 0 0 160px rgba(245,166,35,0.07), inset 0 1px 0 rgba(245,166,35,0.1);
}

.np-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  min-width: 0;
}
.np-fullscreen-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}
.np-mandala {
  width: 150px; height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.6s ease;
}
.playing .np-mandala {
  filter: drop-shadow(0 0 18px rgba(245,166,35,0.35));
}
.mandala-svg { width: 100%; height: 100%; }
.mandala-rotate { transform-origin: 0 0; animation: none; }
.playing .mandala-rotate { animation: rotateMandala 9s linear infinite; }

/* Mandala pulse with playing */
.playing .mandala-svg circle:nth-child(2) {
  animation: mandraPulse 2s ease-in-out infinite;
}
@keyframes mandraPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes rotateMandala {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.np-waveform { width: 100%; }
#waveCanvas {
  width: 100%; height: 56px;
  border-radius: 8px;
  display: block;
  transition: opacity 0.4s ease;
}

/* Now Playing Info */
.np-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.np-label-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.np-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
}
.np-raag {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
  background: linear-gradient(135deg, var(--text-primary) 55%, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.np-details {
  font-size: 0.88rem;
  color: var(--text-sub);
  font-weight: 300;
  line-height: 1.5;
}
.np-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-sub);
  transition: all var(--transition);
}
.tag.active {
  background: var(--bg-active);
  border-color: var(--border-gold);
  color: var(--gold);
}
.tag-pitch.active {
  background: rgba(245,166,35,0.2);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 700;
}

/* Matra Display */
.matra-row {
  margin-top: 6px;
}
.matra-display {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(245,166,35,0.06);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
}
.matra-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-sub);
  font-weight: 500;
}
.matra-number {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 2ch;
  text-align: center;
  transition: transform 0.08s ease;
}
.matra-number.sam {
  background: linear-gradient(135deg, #ffffff 20%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  transform: scale(1.18);
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.9));
}
.matra-sep {
  color: var(--text-muted);
  font-size: 1.1rem;
  opacity: 0.6;
}
.matra-total {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-sub);
  line-height: 1;
}

/* ── Taal circle: one avartan, sam at the top, matras clockwise ── */
.now-playing-card.has-taal { grid-template-columns: 260px minmax(0, 1fr) 280px; }
.np-taal {
  width: 100%;
  max-width: 280px;
  justify-self: center;
  min-width: 0;
}
.np-taal[hidden] { display: none; }
.taal-svg { display: block; width: 100%; height: auto; overflow: visible; }

.tc-track { fill: none; stroke: var(--border-gold); stroke-width: 1.5; }
.tc-tick { stroke: var(--border-gold); stroke-width: 1.2; }
.tc-arc {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tc-marker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  fill: var(--gold);
  text-anchor: middle;
  dominant-baseline: central;
}

/* Nodes mirror the beat dots: sam solid, taali tinted, khali hollow-dashed */
.tc-dot, .tc-halo { transform-box: fill-box; transform-origin: center; }
.tc-dot {
  fill: rgba(255,255,255,0.08);
  stroke: var(--border);
  stroke-width: 1;
  transition: fill 0.12s ease, stroke 0.12s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tc-node.sam .tc-dot { fill: rgba(245,166,35,0.28); stroke: var(--gold); }
.tc-node.taali .tc-dot { fill: rgba(245,166,35,0.15); stroke: rgba(245,166,35,0.4); }
.tc-node.khali .tc-dot { fill: transparent; stroke: rgba(255,255,255,0.22); stroke-dasharray: 2 2; }
.tc-node.active .tc-dot {
  fill: var(--gold);
  stroke: var(--gold);
  stroke-dasharray: none;
  transform: scale(1.35);
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.85));
}
.tc-halo { fill: none; stroke: var(--gold); stroke-width: 1.5; opacity: 0; }
.tc-node.active .tc-halo { animation: tcHalo 0.55s ease-out; }
.tc-node.active.sam .tc-halo { stroke-width: 2.5; animation-duration: 0.8s; }
@keyframes tcHalo {
  from { opacity: 0.75; transform: scale(1); }
  to   { opacity: 0;    transform: scale(2.8); }
}

.tc-bol {
  font-size: 8.5px;
  fill: var(--text-sub);
  dominant-baseline: central;
  transition: fill 0.1s ease;
}
.tc-node.active .tc-bol { fill: var(--gold-light); font-weight: 600; }

/* The sweeping hand: shown only while the lehra plays */
.tc-hand { opacity: 0; transition: opacity 0.3s ease; }
.now-playing-card.playing .tc-hand,
.now-playing-card.playing .tc-arc { opacity: 1; }
.tc-hand-line { stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; opacity: 0.55; }
.tc-head { fill: var(--gold-light); filter: drop-shadow(0 0 5px rgba(245,166,35,0.9)); }
.taal-svg.count-in .tc-arc,
.taal-svg.count-in .tc-hand-line { stroke: var(--orange); }
.taal-svg.count-in .tc-head { fill: var(--orange); filter: drop-shadow(0 0 5px rgba(232,87,42,0.9)); }

/* Centre readout: matra number, its role, and its bol */
.tc-num {
  font-family: 'Cinzel', serif;
  font-size: 36px;
  font-weight: 700;
  fill: var(--gold);
  text-anchor: middle;
  transition: fill 0.1s ease;
}
.taal-svg[data-role="sam"] .tc-num { fill: #ffffff; filter: drop-shadow(0 0 6px rgba(245,166,35,0.9)); }
.tc-label {
  font-size: 8px;
  letter-spacing: 0.2em;
  fill: var(--text-sub);
  text-anchor: middle;
}
.tc-bolnow {
  font-size: 12px;
  font-weight: 600;
  fill: var(--gold-light);
  text-anchor: middle;
}
@media (prefers-reduced-motion: reduce) {
  .tc-node.active .tc-halo { animation: none; }
  .tc-dot { transition: none; }
}

/* ── Controls Grid ── */
/* minmax(0, …) everywhere: a long unbreakable label (e.g. a file name)
   must not widen its column past the screen */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ── Control Panel ── */
.control-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.control-panel:hover {
  border-color: rgba(245,166,35,0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.panel-icon { font-size: 1rem; line-height: 1; }
.panel-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-sub);
}

/* ── Selector Lists ── */
.selector-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 270px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-faint) transparent;
}
.selector-list::-webkit-scrollbar { width: 3px; }
.selector-list::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 2px; }

.empty-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 0;
}

.selector-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.selector-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  padding-left: 16px;
}
.selector-btn.active {
  background: var(--bg-active);
  border-color: var(--border-gold);
  color: var(--gold);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(245,166,35,0.1);
}
/* Shimmer on active selector buttons */
.selector-btn.active::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: -100%; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.06), transparent);
  animation: shimmerBtn 3s ease-in-out infinite;
  pointer-events: none;
}
.selector-btn { position: relative; overflow: hidden; }

@keyframes shimmerBtn {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.btn-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 2px 7px;
  border-radius: 10px;
}
.selector-btn.active .btn-badge {
  color: var(--gold-dark);
  background: rgba(245,166,35,0.14);
}

/* ── Playback Section ── */
.playback-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* ── Tempo Panel ── */
.tempo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tempo-panel:hover {
  border-color: rgba(245,166,35,0.15);
}
.tempo-range-label {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Preset pills */
.tempo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tempo-preset-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all var(--transition);
}
.tempo-preset-pill:hover {
  background: var(--bg-hover);
  border-color: rgba(245,166,35,0.3);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.tempo-preset-pill.active {
  background: rgba(245,166,35,0.18);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(245,166,35,0.15);
}

/* Slider */
.tempo-slider-wrap { width: 100%; }
.tempo-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slider-track-wrap { flex: 1; position: relative; }
.tempo-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--gold) var(--slider-pct, 50%),
    rgba(255,255,255,0.07) var(--slider-pct, 50%)
  );
  outline: none;
  cursor: pointer;
}
.tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  box-shadow: 0 2px 14px rgba(245,166,35,0.55);
  cursor: pointer;
  transition: transform var(--transition-spring), box-shadow var(--transition);
  border: 2px solid rgba(255,255,255,0.18);
}
.tempo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 22px rgba(245,166,35,0.75);
}
.tempo-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  border: 2px solid rgba(255,255,255,0.18);
  cursor: pointer;
}

/* Slider ticks */
.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  padding: 0 2px;
}
.slider-tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: color var(--transition);
}
.slider-tick-line {
  width: 1px; height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 1px;
}
.slider-tick-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}
.slider-tick.active .slider-tick-line { background: var(--gold); }
.slider-tick.active .slider-tick-label { color: var(--gold); }

/* +/- buttons */
.btn-bpm-step {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-sub);
  font-size: 1.25rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  user-select: none;
}
.btn-bpm-step:hover {
  background: var(--bg-active);
  border-color: var(--border-gold);
  color: var(--gold);
  transform: scale(1.1);
}
.btn-bpm-step:active { transform: scale(0.9); }

/* BPM display */
.tempo-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tempo-display { display: flex; align-items: baseline; gap: 8px; }
#tempoValue,
.tempo-value-input {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  transition: color 0.1s ease;
}

/* Input-specific overrides */
.tempo-value-input {
  border: none;
  outline: none;
  background-color: transparent;
  width: 3.4ch;
  padding: 0;
  text-align: center;
  cursor: text;
  caret-color: var(--gold);
  -moz-appearance: textfield;
}
.tempo-value-input::-webkit-inner-spin-button,
.tempo-value-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tempo-value-input:focus {
  -webkit-text-fill-color: var(--gold);
  background: none;
  outline: none;
  border-bottom: 1.5px solid rgba(245,166,35,0.5);
}
.tempo-unit {
  font-size: 0.82rem;
  color: var(--text-sub);
  font-weight: 300;
  letter-spacing: 0.1em;
}

/* Tap button */
.btn-tap {
  padding: 8px 18px;
  border-radius: 22px;
  border: 1px solid var(--border-gold);
  background: rgba(245,166,35,0.07);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}
.btn-tap:hover {
  background: rgba(245,166,35,0.16);
  box-shadow: 0 0 20px rgba(245,166,35,0.28);
  transform: translateY(-1px);
}
.btn-tap:active {
  transform: scale(0.94);
  background: rgba(245,166,35,0.28);
}

/* ── Playback Controls Panel ── */
.playback-controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color var(--transition);
}
.playback-controls:hover {
  border-color: rgba(245,166,35,0.15);
}

/* Volume rows */
.volume-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vol-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-sub);
}
.vol-icon { font-size: 0.9rem; }
.vol-name { min-width: 60px; font-weight: 400; }
.vol-slider-wrap { flex: 1; }
.vol-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--gold) var(--val, 80%),
    rgba(255,255,255,0.09) var(--val, 80%)
  );
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 2px 10px rgba(245,166,35,0.5);
  cursor: pointer;
  transition: transform var(--transition-spring);
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.vol-val { min-width: 38px; text-align: right; color: var(--text-primary); font-weight: 500; font-size: 0.8rem; }

/* Transport */
.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.btn-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 50%;
}
.btn-transport svg { display: block; }
.btn-stop {
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.05);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-stop svg { width: 18px; height: 18px; }
.btn-stop:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}
.btn-play {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a0e00;
  box-shadow: 0 8px 32px rgba(245,166,35,0.38);
  position: relative;
  overflow: hidden;
}
/* Shimmer on play button */
.btn-play::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: -100%; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmerPlay 2.5s ease-in-out infinite;
}
@keyframes shimmerPlay {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.btn-play svg { width: 28px; height: 28px; position: relative; z-index: 1; }
.btn-play:hover {
  transform: scale(1.07) translateY(-2px);
  box-shadow: 0 14px 48px rgba(245,166,35,0.55);
}
.btn-play:active { transform: scale(0.97); }
.btn-loop {
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.05);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-loop svg { width: 18px; height: 18px; }
.btn-loop:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}
.btn-loop.active {
  background: var(--bg-active);
  color: var(--gold);
  border-color: var(--border-gold);
  box-shadow: 0 0 10px rgba(245,166,35,0.15);
}

/* Options Toggles */
.options-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.options-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.toggle-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}
/* Visually hidden but still reachable with the keyboard */
.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.toggle-checkbox:focus-visible + .toggle-slider { box-shadow: var(--focus-ring); }
.toggle-slider {
  position: relative;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border-radius: 9px;
  border: 1px solid var(--border);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  background: var(--text-sub);
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toggle-checkbox:checked + .toggle-slider {
  background: rgba(245,166,35,0.18);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(245,166,35,0.2);
}
.toggle-checkbox:checked + .toggle-slider::after {
  transform: translateX(14px);
  background: var(--gold);
  box-shadow: 0 0 6px rgba(245,166,35,0.5);
}
.toggle-text {
  font-size: 0.75rem;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color var(--transition);
}
.toggle-checkbox:checked ~ .toggle-text {
  color: var(--text-primary);
}

/* ── Beat Visualizer ── */
.beat-visualizer { text-align: center; }
.beat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}
.beat-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.beat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  transition: all 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.beat-dot.sam {
  background: rgba(245,166,35,0.28);
  border-color: var(--gold);
  width: 14px; height: 14px;
}
.beat-dot.taali {
  background: rgba(245,166,35,0.15);
  border-color: rgba(245,166,35,0.4);
  width: 12px; height: 12px;
}
.beat-dot.khali {
  background: transparent;
  border-color: rgba(255,255,255,0.15);
  border-style: dashed;
}
.beat-dot.active {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 14px rgba(245,166,35,0.8);
  transform: scale(1.4);
}

/* ── Info Bar ── */
.info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255,255,255,0.018);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  color: var(--text-sub);
  gap: 8px 16px;
  flex-wrap: wrap;
}
.shortcuts-hint {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.info-item { display: flex; align-items: center; gap: 9px; }
.info-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.info-dot.playing {
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74,222,128,0.6);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.info-dot.loading {
  background: var(--gold);
  animation: dotPulse 0.8s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;          /* closed modals can't be tabbed into */
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s;
}
.modal-content {
  background: linear-gradient(160deg, rgba(30,22,10,0.98), rgba(9,8,6,0.98));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 0 60px rgba(245,166,35,0.15), 0 24px 64px rgba(0,0,0,0.6);
  transform: scale(0.93) translateY(8px);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
  opacity: 0;
  position: relative;
}
.modal-content:focus { outline: none; }
.modal-content.modal-wide { max-width: 600px; }
.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.4), transparent);
  pointer-events: none;
}
.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header .panel-title { color: var(--gold); }
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: -6px -6px -6px 12px;
  border-radius: 50%;
  background: none; border: none;
  color: var(--text-sub);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  line-height: 1;
}
.modal-close:hover {
  color: var(--gold);
  transform: scale(1.15) rotate(90deg);
}

/* Long-form help text inside a modal */
.modal-prose h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 18px 0 8px;
}
.modal-prose h3:first-child { margin-top: 0; }
.modal-prose p,
.modal-prose li {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-sub);
}
.modal-prose ul { padding-left: 1.2em; margin: 6px 0 4px; }
.modal-prose strong { color: var(--text-primary); font-weight: 600; }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.stats-total { text-align: center; margin-top: 16px; font-size: 0.8rem; color: var(--text-sub); }
.stats-total span { color: var(--gold); font-weight: 700; }
.fx-sliders { display: flex; flex-direction: column; gap: 16px; }

/* Riyaz Chart */
.stats-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 150px;
  padding-top: 20px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.stat-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.stat-bar {
  width: 100%;
  max-width: 30px;
  background: linear-gradient(to top, rgba(245,166,35,0.2), var(--gold));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.5s ease-out;
}
.stat-label {
  font-size: 0.6rem;
  color: var(--text-sub);
  margin-top: 6px;
}

/* Fullscreen Mode: just the Now Playing card */
body.fullscreen-mode .site-header,
body.fullscreen-mode #view-lehra > :not(.now-playing-card) {
  display: none !important;
}
body.fullscreen-mode .app-container {
  justify-content: center;
  height: 100vh;
  padding: 0;
}
body.fullscreen-mode .now-playing-card {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 40px;
  grid-template-columns: 1fr;
}
body.fullscreen-mode .np-mandala {
  width: 35vh;
  height: 35vh;
  max-width: 400px;
  max-height: 400px;
}
body.fullscreen-mode .np-waveform {
  width: 80%;
  max-width: 800px;
}
/* …with the taal circle, the card has to make room for it: the circle beside
   the info on a wide screen, under it (with a smaller mandala) on a tall one */
body.fullscreen-mode .now-playing-card.has-taal {
  gap: 20px;
  overflow-y: auto;
  justify-content: safe center;
}
body.fullscreen-mode .now-playing-card.has-taal .np-mandala { width: 12vh; height: 12vh; }
body.fullscreen-mode .now-playing-card.has-taal .np-waveform { display: none; }
body.fullscreen-mode .np-taal { width: min(44vh, 86vw); max-width: none; flex: none; }
@media (min-aspect-ratio: 1/1) {
  body.fullscreen-mode .now-playing-card.has-taal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: safe center;
    justify-items: center;
    gap: 16px 48px;
  }
  body.fullscreen-mode .now-playing-card.has-taal .np-visual { grid-column: 1; grid-row: 1; width: 100%; }
  body.fullscreen-mode .now-playing-card.has-taal .np-waveform { display: block; }
  body.fullscreen-mode .now-playing-card.has-taal .np-mandala { width: 18vh; height: 18vh; }
  body.fullscreen-mode .now-playing-card.has-taal .np-info { grid-column: 1; grid-row: 2; align-items: center; }
  body.fullscreen-mode .np-taal { grid-column: 2; grid-row: 1 / span 2; width: min(80vh, 100%); }
}

/* ── SPA Navigation ── */
.site-nav {
  grid-area: nav;
  justify-self: center;
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 5px 6px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.nav-btn.active {
  color: var(--gold);
  background: rgba(245, 166, 35, 0.14);
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.28);
}
.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: width 0.3s ease;
  border-radius: 1px;
}
.nav-btn.active::after {
  width: 50%;
}

/* ── App View Transitions ── */
.app-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
/* View entrance animation applied on show */
.app-view.entering {
  animation: viewEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ── Hero Sections & Typography ── */
.hero-section {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
  max-width: 820px;
  margin: 0 auto;
}
.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-sub);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.65;
}
.text-gradient {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Dashboard Cards ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.75rem;
  padding: 1rem 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.dashboard-card {
  position: relative;
  background: linear-gradient(160deg,
    rgba(255,255,255,0.04),
    rgba(245,166,35,0.02) 60%,
    rgba(0,0,0,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04);
}
.card-body { display: flex; flex-direction: column; align-items: center; min-width: 0; }
/* Gradient border on hover */
.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(245,166,35,0.55), rgba(232,87,42,0.15), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  pointer-events: none;
}
.dashboard-card:hover {
  transform: translateY(-7px);
  background: linear-gradient(160deg,
    rgba(255,255,255,0.06),
    rgba(245,166,35,0.04) 60%,
    rgba(0,0,0,0.06));
  box-shadow: 0 18px 42px rgba(0,0,0,0.35), 0 0 50px rgba(245,166,35,0.1), inset 0 1px 0 rgba(245,166,35,0.08);
  border-color: rgba(245,166,35,0.2);
}
.dashboard-card:hover::before {
  opacity: 1;
}
.dashboard-card:active {
  transform: translateY(-3px);
}
.card-icon {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  margin: 0 auto 1.6rem;
  background: rgba(245,166,35,0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, background 0.4s ease;
  box-shadow: 0 0 0 4px rgba(245,166,35,0.04);
}
.card-icon svg { width: 30px; height: 30px; }
.dashboard-card:hover .card-icon {
  transform: scale(1.12) rotate(8deg);
  box-shadow: 0 0 30px rgba(245,166,35,0.28), 0 0 0 6px rgba(245,166,35,0.06);
  background: rgba(245,166,35,0.14);
  color: var(--gold-light);
}
.dashboard-card :is(h2, h3) {
  font-family: 'Cinzel', serif;
  font-size: 1.45rem;
  margin-bottom: 0.7rem;
  color: var(--text-primary);
  font-weight: 700;
  transition: color var(--transition);
  z-index: 1;
  position: relative;
}
.dashboard-card:hover :is(h2, h3) {
  color: var(--gold-light);
}
.dashboard-card p {
  font-size: 0.92rem;
  color: var(--text-sub);
  line-height: 1.6;
  z-index: 1;
  position: relative;
}

/* ── Notation Editor View ── */
.notation-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
/* ============================================================
   NOTATION STUDIO LAYOUT
   ============================================================ */

.studio-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  height: 80vh;
  min-height: 540px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Sidebar */
.studio-sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-header {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1.05rem;
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}

.palette-search {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color var(--transition);
}

.palette-search:focus {
  outline: none;
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.08);
}

.palette-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  align-content: start;
}

.palette-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 4px;
  min-height: 40px;
  width: 100%;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
}

.palette-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-gold);
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.palette-item:active {
  transform: scale(0.96);
}

/* Main Workspace */
.studio-workspace {
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.studio-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}

.studio-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.toggle-group {
  display: flex;
  background: rgba(0,0,0,0.4);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 3px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.toggle-btn.active {
  background: var(--bg-active);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(245,166,35,0.1);
}
.toggle-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ns-play-btn { color: var(--gold); border-color: var(--border-gold); }

/* Notation Toolbar */
.notation-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  gap: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}

.format-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Document Area */
.notation-document-wrapper {
  flex: 1;
  overflow: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #050403;
  min-height: 0;
}

.notation-document {
  width: 100%;
  max-width: 900px;
  min-height: 520px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  padding: 48px;
  border-radius: 8px;
}
.ns-add-row { text-align: center; margin: 1rem 0 2rem; }
.btn-add-line {
  border: 1px dashed var(--gold);
  color: var(--gold);
  background: rgba(245,166,35,0.05);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-add-line:hover { background: rgba(245,166,35,0.12); box-shadow: 0 0 20px rgba(245,166,35,0.15); }

.doc-header {
  text-align: center;
  margin-bottom: 32px;
}

.doc-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.3rem, 3vw, 2rem);
  text-align: center;
  width: 100%;
  max-width: 640px;
  padding-bottom: 8px;
  outline: none;
  transition: border-color 0.3s;
}

.doc-title-input:focus {
  border-bottom-color: var(--gold);
  border-bottom-style: solid;
}

/* Dynamic Grid Elements */
.dynamic-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.grid-row {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  container-type: inline-size;
}

/* Vibhags wrap as whole units; the line under each is a shadow and the bar
   between them the last matra's border, so neither adds to the width. */
.grid-vibhag {
  display: flex;
  flex: 1 1 auto;
  box-shadow: 0 1px 0 var(--border);
}
.grid-vibhag > .grid-cell:last-child { border-right: 2px solid var(--border); }
.grid-vibhag:last-child > .grid-cell:last-child { border-right: none; }

.grid-cell {
  flex: 1 0 44px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px;
  border-right: 1px dashed rgba(255,255,255,0.05);
  position: relative;
  min-height: 70px;
  transition: background var(--transition);
}
/* Every matra is 1/--per-line of the row (notation.js picks --per-line) */
@supports (width: 1cqi) {
  .grid-vibhag { flex: none; }
  .grid-cell { flex: 0 0 calc((100cqi - 1px) / var(--per-line, 16)); }
}
.grid-cell:focus-within {
  background: rgba(245,166,35,0.04);
}

.matra-num {
  font-size: 0.7rem;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.tali-khali {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.65rem;
  color: var(--orange);
  font-weight: 600;
}

.cell-content {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  min-width: 30px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  padding: 4px;
  outline: none;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background var(--transition), border-color var(--transition);
}
.cell-content:focus {
  background: rgba(255,255,255,0.06);
}
.cell-content.is-selected {
  background: rgba(245,166,35,0.15);
  border-color: var(--gold);
  border-style: dashed;
}
.cell-content.is-playing {
  background: rgba(245,166,35,0.3);
  border-color: var(--gold);
  border-style: solid;
  box-shadow: 0 0 12px rgba(245,166,35,0.35);
}

/* Modifiers */

/* --- BHATKHANDE SYSTEM (Default) --- */
[data-system="bhatkhande"] .mod-underline {
  border-bottom: 2px solid var(--text-sub);
  padding-bottom: 2px;
}
[data-system="bhatkhande"] .mod-dot-below {
  position: relative;
}
[data-system="bhatkhande"] .mod-dot-below::after {
  content: '.';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
}
[data-system="bhatkhande"] .mod-dot-above {
  position: relative;
}
[data-system="bhatkhande"] .mod-dot-above::before {
  content: '.';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
}
[data-system="bhatkhande"] .mod-vertical {
  position: relative;
}
[data-system="bhatkhande"] .mod-vertical::before {
  content: '|';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: bold;
}

/* --- PALUSKAR SYSTEM --- */
[data-system="paluskar"] .mod-underline {
  position: relative;
  border-bottom: none;
  padding-bottom: 0;
}
[data-system="paluskar"] .mod-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 8px;
  height: 2px;
  background: currentColor;
  transform: translateX(-50%) rotate(-30deg);
}
[data-system="paluskar"] .mod-vertical {
  position: relative;
}
[data-system="paluskar"] .mod-vertical::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 8px;
  height: 2px;
  background: currentColor;
  transform: translateX(-50%) rotate(30deg);
}
[data-system="paluskar"] .mod-dot-below {
  position: relative;
}
[data-system="paluskar"] .mod-dot-below::before {
  content: '.';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
}
[data-system="paluskar"] .mod-dot-below::after {
  display: none;
}
[data-system="paluskar"] .mod-dot-above {
  position: relative;
}
[data-system="paluskar"] .mod-dot-above::before {
  content: '|';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: bold;
}

/* ── Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bg-orb { animation: none; }
  .playing .mandala-rotate { animation: none; }
  .btn-play::after { animation: none; }
  .selector-btn.active::after { animation: none; }
  .fade-up { opacity: 1; transform: none; animation: none; }
  .orb-1, .orb-2, .orb-3 { animation: none; }
  .app-view.entering { animation: none; }
}

/* ══════════════════════════════════════════════════════════════════
   Shared small controls (presets, trainer, timer, tuner, recorder…)
   ══════════════════════════════════════════════════════════════════ */
.modal-hint {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 14px;
}
.text-input,
.num-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color var(--transition);
}
.text-input:focus,
.num-input:focus { border-color: var(--gold); }
.num-input { width: 64px; text-align: center; -moz-appearance: textfield; }
.small-select {
  padding: 3px 24px 3px 8px;
  font-size: 0.7rem;
  border-radius: 4px;
  background-position: right 6px center;
  background-size: 8px;
  animation: none;
}

/* ── Presets ── */
.preset-save-row { display: flex; gap: 8px; margin-bottom: 16px; }
.preset-save-row .text-input { flex: 1; min-width: 0; }
.preset-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-x: hidden;
  overflow-y: auto;
}
.preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.preset-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.preset-name { font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-summary { font-size: 0.7rem; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-delete { padding: 4px 9px; font-size: 1rem; line-height: 1; }
.preset-delete:hover { color: #ff6b6b; border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.08); }

/* ── Theka (under the beat dots) ── */
.theka-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 0;
  margin-top: 14px;
}
.theka-row[hidden] { display: none; }
.theka-vibhag {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 8px;
  border-left: 1px solid var(--border-gold);
}
.theka-vibhag:first-child { border-left: none; }
.theka-marker {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--gold);
  min-height: 0.8rem;
  letter-spacing: 0.05em;
}
.theka-bols { display: flex; gap: 6px; }
.theka-bol {
  font-size: 0.78rem;
  color: var(--text-sub);
  padding: 1px 2px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}
.theka-bol.active {
  color: #1a1208;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(245,166,35,0.6);
}
.fx-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.fx-section .toggle-label { white-space: normal; }
.fx-section .toggle-text { white-space: normal; }

/* ── Tool boxes (laya trainer, practice timer) ── */
.tool-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
}
.tool-box[open] { border-color: rgba(245,166,35,0.2); }
.tool-box summary {
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  list-style: none;
  user-select: none;
}
.tool-box summary::-webkit-details-marker { display: none; }
.tool-box summary::before { content: '▸ '; display: inline-block; transition: transform var(--transition); }
.tool-box[open] summary::before { transform: rotate(90deg); }
.tool-sub {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-sub);
  margin-left: 6px;
}
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 0 10px;
  font-size: 0.75rem;
  color: var(--text-sub);
}
.tool-grid label { display: flex; align-items: center; gap: 6px; }
.tool-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.tool-row .btn-tap.active { background: var(--gold); color: #1a1208; }
.tool-progress {
  flex: 1;
  min-width: 80px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.tool-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.4s ease;
}
.tool-status {
  min-height: 1.1em;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-sub);
  overflow-wrap: anywhere;
}
.tool-status-inline { margin-top: 0; }
.modal-hint-last { margin: 8px 0 0; }

/* ── Riyaz goal & streak ── */
.stats-chart { position: relative; }
.stat-bar.met { background: linear-gradient(to top, rgba(245,166,35,0.35), var(--gold-light)); }
.stat-goal-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed rgba(255,209,102,0.55);
  pointer-events: none;
}
.goal-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.goal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.goal-label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-sub); }
.goal-streak { font-size: 0.8rem; color: var(--text-sub); }
.goal-streak strong { color: var(--gold); }

/* ── Tanpura options (under the tanpura volume) ── */
.tanpura-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 0 70px;
}
.tanpura-options select:disabled { opacity: 0.4; cursor: default; }

/* ── Swar tuner ── */
.tuner-display { text-align: center; padding: 6px 0 14px; }
.tuner-octave { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-sub); min-height: 1em; }
.tuner-swar {
  font-family: 'Cinzel', serif;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245,166,35,0.35);
}
.tuner-qualifier { font-size: 0.8rem; color: var(--text-sub); min-height: 1.1em; font-style: italic; }
.tuner-gauge {
  position: relative;
  height: 46px;
  margin: 16px 6px 6px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,107,107,0.12), rgba(245,166,35,0.12) 30%, rgba(46,204,113,0.18) 45%, rgba(46,204,113,0.18) 55%, rgba(245,166,35,0.12) 70%, rgba(255,107,107,0.12));
  border: 1px solid var(--border);
}
.tuner-zone { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,0.35); }
.tuner-ticks {
  position: absolute; left: 0; right: 0; bottom: -18px;
  display: flex; justify-content: space-between;
  font-size: 0.6rem; color: var(--text-muted);
}
.tuner-needle {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(245,166,35,0.7);
}
.tuner-needle.good { background: #2ecc71; box-shadow: 0 0 12px rgba(46,204,113,0.8); }
.tuner-needle.near { background: var(--gold); }
.tuner-needle.far { background: #ff6b6b; box-shadow: 0 0 10px rgba(255,107,107,0.7); }
.tuner-needle.idle { background: rgba(255,255,255,0.15); box-shadow: none; }
.tuner-readout { margin-top: 24px; font-size: 0.85rem; color: var(--text-primary); min-height: 1.2em; }
.tuner-readout #tunerHz { color: var(--text-sub); margin-left: 8px; }
.tuner-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 0.8rem; color: var(--text-sub); }
.tuner-sa strong { color: var(--gold); }
.tuner-mic-btn { width: 100%; padding-top: 11px; padding-bottom: 11px; }
.btn-tap.active { background: var(--gold); color: #1a1208; }

/* ── Riyaz recorder ── */
.rec-row { margin-top: 12px; }
.rec-btn.recording { background: #e74c3c; border-color: #e74c3c; color: #fff; animation: rec-pulse 1.4s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 14px rgba(231,76,60,0.7); } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--text-primary); min-width: 36px; }
.rec-meter .tool-bar { transition: width 0.05s linear; background: linear-gradient(90deg, #2ecc71, var(--gold) 80%, #e74c3c); }
.take-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.take-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--bg-card); }
.take-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.take-name { flex: 1; min-width: 0; font-size: 0.78rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take-head a.header-icon-btn { font-size: 0.7rem; text-decoration: none; }
.take-item audio { width: 100%; height: 32px; }

/* ── Intonation report (a riyaz take) ── */
.take-report { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.report-summary { font-size: 0.8rem; line-height: 1.5; color: var(--text-primary); }
.report-summary strong { color: var(--gold); }
.report-graph { display: block; width: 100%; height: 180px; margin-top: 8px; border-radius: 8px; background: rgba(0,0,0,0.25); }
.report-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 0.68rem; color: var(--text-sub); }
.report-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.report-legend .dot.tune { background: #5fd38d; }
.report-legend .dot.off { background: #f5a623; }
.report-legend .dot.glide { background: rgba(237,224,204,0.35); }
.report-swaras { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.report-swaras li { padding: 3px 9px; border-radius: 12px; border: 1px solid var(--border); font-size: 0.72rem; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.report-swaras li.drift { border-color: rgba(245,166,35,0.5); color: var(--gold-light); }

/* ── Audio export ── */
.export-summary { margin-top: 12px; font-size: 0.78rem; line-height: 1.5; color: var(--text-primary); }
.export-options { margin-top: 0; }
.export-options .toggle-label { min-height: 0; }
#exBtn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }

/* ── Notation library / share ── */
.ns-tempo { font-size: 0.7rem; color: var(--text-sub); margin-right: 8px; white-space: nowrap; }
.ns-file-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.ns-share-url { width: 100%; font-size: 0.72rem; }
#nsLibraryBtn.saved { color: #2ecc71; border-color: rgba(46,204,113,0.5); }

/* ── Carnatic suite ── */
.carnatic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 32px;
}
.carnatic-panel { display: flex; flex-direction: column; gap: 16px; }
.carnatic-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.75rem;
  color: var(--text-sub);
}
.carnatic-fields label, .carnatic-custom { display: flex; align-items: center; gap: 6px; }
.carnatic-custom[hidden] { display: none; }
.talam-tempo { flex-wrap: wrap; }
.talam-vol { flex: 1; min-width: 180px; }
.talam-display { text-align: center; padding: 6px 0; }
.talam-name { font-family: 'Cinzel', serif; font-size: 1.1rem; color: var(--text-primary); }
.talam-now {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  min-height: 2.8rem;
  transition: transform 0.08s;
}
.talam-now.sam { text-shadow: 0 0 22px rgba(245,166,35,0.6); }
.talam-now.kriya-wave { color: var(--gold-light); }
.talam-now.kriya-finger, .talam-now.kriya-count, .talam-now.kriya-hold { color: var(--text-primary); font-size: 1.6rem; }
.talam-count { font-size: 0.75rem; color: var(--text-sub); min-height: 1em; }
.talam-angas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.anga {
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 6px 8px 8px;
  background: rgba(245,166,35,0.03);
}
.anga-symbol { font-family: 'Cinzel', serif; font-size: 0.85rem; color: var(--gold); text-align: center; margin-bottom: 6px; }
.anga-beats { display: flex; gap: 5px; }
.kriya {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.08s, transform 0.08s, box-shadow 0.08s;
}
.kriya-num { font-size: 0.6rem; color: var(--text-muted); }
.kriya-label { font-size: 0.7rem; color: var(--text-sub); text-transform: capitalize; }
.kriya-clap .kriya-label { color: var(--gold); font-weight: 600; }
.kriya-wave .kriya-label { color: var(--gold-light); }
.kriya.sam { border-color: var(--gold); }
.kriya.active {
  background: var(--gold);
  box-shadow: 0 0 14px rgba(245,166,35,0.7);
  transform: scale(1.08);
}
.kriya.active .kriya-label, .kriya.active .kriya-num { color: #1a1208; }

/* ── Practise along (song mode) ── */
.practice-panel { width: 100%; max-width: 860px; margin: 0 auto 32px; display: flex; flex-direction: column; gap: 18px; }
.practice-message { font-size: 0.9rem; color: var(--text-primary); line-height: 1.5; text-align: center; }
.practice-message.error { color: #ff8a80; }
.practice-link { align-self: center; text-decoration: none; }
.practice-link[hidden], .practice-message[hidden] { display: none; }
.practice-transport { justify-content: center; }
.practice-seek { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; font-size: 0.78rem; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.practice-seek-track { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.practice-seek-track .vol-slider { flex: 1; min-width: 0; position: relative; z-index: 1; }
.ab-band {
  position: absolute;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: rgba(245,166,35,0.18);
  border: 1px solid var(--border-gold);
  pointer-events: none;
}
.practice-ab { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; font-size: 0.78rem; color: var(--text-sub); }
.practice-ab-range { font-variant-numeric: tabular-nums; }
.practice-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.practice-field {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  font-size: 0.8rem;
  color: var(--text-sub);
}
.practice-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.practice-label { color: var(--text-sub); }
.practice-grid .vol-name { min-width: 96px; }
.practice-value { min-width: 44px; text-align: center; color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.practice-unit { color: var(--text-muted); }
.practice-speed { flex: 1; min-width: 100px; max-width: 320px; }
.practice-stem-list { display: flex; flex-wrap: wrap; gap: 10px 16px; }

/* ══════════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .site-header { padding: 12px 24px; gap: 10px 16px; }
  /* Too narrow for three columns: the taal circle takes its own row */
  .now-playing-card.has-taal { grid-template-columns: 260px minmax(0, 1fr); }
  .np-taal { grid-column: 1 / -1; }
}
/* Header: below this the nav can't sit in the page centre, so it takes the space between */
@media (max-width: 900px) {
  .site-header { grid-template-columns: auto 1fr auto; }
}

/* Tablets */
@media (max-width: 960px) {
  .now-playing-card,
  .now-playing-card.has-taal {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 28px 24px;
    text-align: center;
  }
  .np-mandala { width: 110px; height: 110px; }
  .np-waveform { max-width: 420px; }
  .np-label-row, .np-tags, .pitch-wrap { justify-content: center; }
  .matra-row { display: flex; justify-content: center; }
  .playback-section { grid-template-columns: minmax(0, 1fr); }
  .carnatic-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid { padding: 1rem 0; gap: 1.25rem; }

  /* Notation Editor: palette above the page; the page scrolls, not a pane */
  .studio-layout { grid-template-columns: 1fr; height: auto; min-height: 0; overflow: visible; }
  .studio-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .palette-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); max-height: 196px; }
  .studio-workspace { overflow: visible; }
  .notation-document-wrapper { overflow: visible; padding: 20px; border-radius: 0 0 var(--radius) var(--radius); }
  .notation-document { min-height: 0; padding: 32px 24px; }
}

/* Small tablets / large phones */
@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo tools" "nav nav";
  }
  .site-nav { justify-self: stretch; }
  .nav-btn { flex: 1; }
  .controls-grid { grid-template-columns: minmax(0, 1fr); }
  .selector-list { max-height: 220px; }
}

/* Phones */
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .site-header { padding: 10px var(--gutter); gap: 8px 12px; }
  .logo { gap: 10px; min-height: 40px; }  /* as tall as the tool buttons, so pages without them match */
  .logo-icon { width: 34px; height: 34px; }
  .logo-title { font-size: 1.02rem; }
  .logo-sub { font-size: 0.54rem; letter-spacing: 0.12em; }
  .site-nav { padding: 4px; }
  .nav-btn { padding: 8px 6px; font-size: 0.85rem; }

  .app-container { padding: 16px var(--gutter) 40px; gap: 16px; }
  .app-view { gap: 16px; }
  .hero-section { padding: 1.75rem 0.25rem 1rem; }
  .hero-title { margin-bottom: 0.6rem; }
  .hero-subtitle { font-size: 0.95rem; }

  /* Dashboard cards become compact rows */
  .dashboard-grid { grid-template-columns: 1fr; padding: 0 0 1rem; gap: 12px; }
  .dashboard-card {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 18px;
    text-align: left;
  }
  .dashboard-card:hover { transform: translateY(-2px); }
  .card-icon { width: 52px; height: 52px; margin: 0; }
  .card-icon svg { width: 24px; height: 24px; }
  .card-body { align-items: flex-start; }
  .dashboard-card :is(h2, h3) { font-size: 1.15rem; margin-bottom: 0.25rem; }
  .dashboard-card p { font-size: 0.85rem; line-height: 1.45; }

  /* Lehra */
  .now-playing-card { padding: 22px 16px 20px; gap: 16px; border-radius: var(--radius-lg); }
  .np-mandala { width: 88px; height: 88px; }
  .np-fullscreen-btn { top: 12px; left: 12px; }
  .control-panel, .tempo-panel, .playback-controls { padding: 18px 16px; }
  .selector-list { max-height: 200px; }
  .selector-btn { padding: 11px 13px; font-size: 0.9rem; }
  #tempoValue { font-size: 2.4rem; }
  .tempo-slider::-webkit-slider-thumb { width: 28px; height: 28px; }
  .tempo-slider::-moz-range-thumb { width: 28px; height: 28px; }
  .vol-slider::-webkit-slider-thumb { width: 22px; height: 22px; }
  .btn-bpm-step { width: 40px; height: 40px; font-size: 1.4rem; }
  .volume-row { gap: 16px; }
  .tanpura-options { margin-left: 0; }
  .options-row { gap: 14px; }
  .info-bar { flex-direction: column; text-align: center; gap: 6px; }
  .shortcuts-hint { display: none; }

  /* Carnatic */
  .talam-vol { min-width: 100%; }

  /* Modals */
  .modal-overlay { padding: 12px; }
  .modal-content { padding: 20px 18px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .modal-header { margin-bottom: 16px; }
  .stats-chart { height: 120px; }
  .tuner-swar { font-size: 2.8rem; }

  /* Notation Editor */
  .notation-card.studio-layout { border-radius: var(--radius-sm); }
  .studio-topbar, .notation-toolbar { padding: 10px 12px; }
  .sidebar-header { padding: 14px 12px 12px; }
  .palette-grid { padding: 10px 12px; max-height: 172px; }
  .notation-document-wrapper { padding: 12px; }
  .notation-document { padding: 20px 10px; }
  .doc-header { margin-bottom: 20px; }
  .dynamic-grid { gap: 16px; }
  .grid-cell { padding: 10px 2px; min-height: 62px; }
  .cell-content { font-size: 1rem; min-width: 26px; }
  .ns-add-row { margin: 1rem 0 0.5rem; }

  /* Practise along */
  .practice-field { grid-template-columns: 80px minmax(0, 1fr); }
  .practice-grid .vol-name { min-width: 80px; }
}

/* Small phones */
@media (max-width: 370px) {
  .logo-sub { display: none; }
}
@media (max-width: 400px) {
  .nav-btn { font-size: 0.8rem; padding: 8px 4px; }
  .transport { gap: 12px; }
  .btn-play { width: 62px; height: 62px; }
  .practice-field { grid-template-columns: 1fr; gap: 6px; }
  .practice-grid .vol-name { min-width: 60px; }
  .hero-title { font-size: 1.75rem; }
}

/* Touch screens: bigger targets, and 16px text in fields so iOS doesn't
   zoom the page when one is focused */
@media (pointer: coarse) {
  .pitch-select, .num-input, .text-input, .palette-search, .fine-tune-input { font-size: 16px; }
  .small-select { padding: 6px 28px 6px 10px; background-size: 10px; }
  .header-icon-btn { min-height: 40px; }
  .header-icon-btn.icon-only { min-width: 40px; }
  .modal-close { width: 40px; height: 40px; }
  .toggle-label { min-height: 32px; }
  .btn-tap { padding: 10px 20px; }
  .tempo-preset-pill { padding: 8px 14px; }
}

/* No hover on touch: don't leave cards and buttons stuck mid-animation */
@media (hover: none) {
  .dashboard-card:hover, .dashboard-card:hover .card-icon,
  .header-icon-btn:hover, .btn-tap:hover, .btn-bpm-step:hover,
  .tempo-preset-pill:hover, .palette-item:hover, .logo:hover,
  .logo:hover .logo-icon, .btn-play:hover { transform: none; }
}

/* ══════════════════════════════════════════════════════════════════
   Riyaz games (public/js/games/)
   ══════════════════════════════════════════════════════════════════ */
.games-hub { max-width: 820px; }
/* In a game, the page title makes way for the board */
#view-games.in-game .hero-section { display: none; }
button.dashboard-card { width: 100%; font: inherit; }
.card-meta {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.game-panel { width: 100%; max-width: 760px; margin: 0 auto 32px; }
.game-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.game-top .panel-title { color: var(--gold); font-size: 0.95rem; }
.game-prompt { text-align: center; font-size: 0.9rem; line-height: 1.5; color: var(--text-sub); min-height: 1.5em; margin: 12px auto; max-width: 520px; }
.game-hint { text-align: center; font-size: 0.7rem; line-height: 1.5; color: var(--text-muted); margin-top: 10px; }
.game-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Heads-up display */
.game-hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.hud-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
  min-width: 0;
}
.hud-label { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-sub); }
.hud-value { font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hud-wide .hud-value { font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 600; line-height: 1.35; }
.hud-lives { color: #ff7b7b; letter-spacing: 3px; }

/* Swar Pehchaan: the orb and the harmonium keyboard */
.swar-stage { display: flex; flex-direction: column; align-items: center; margin-top: 22px; }
.swar-orb {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: radial-gradient(circle at 35% 30%, rgba(255,209,102,0.35), rgba(245,166,35,0.12) 55%, rgba(232,87,42,0.08));
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(245,166,35,0.15), inset 0 0 20px rgba(245,166,35,0.12);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.swar-orb:hover { transform: scale(1.04); }
.swar-orb.pulse { animation: orbPulse 1.3s ease-out; }
.swar-orb.right { border-color: #5fd38d; box-shadow: 0 0 45px rgba(95,211,141,0.35); color: #b8f5cf; }
.swar-orb.wrong { border-color: #ff7b7b; box-shadow: 0 0 45px rgba(255,123,123,0.3); color: #ffc2c2; animation: shake 0.35s; }
@keyframes orbPulse {
  0% { box-shadow: 0 0 0 0 rgba(245,166,35,0.55), inset 0 0 20px rgba(245,166,35,0.12); }
  100% { box-shadow: 0 0 0 36px rgba(245,166,35,0), inset 0 0 20px rgba(245,166,35,0.12); }
}
@keyframes shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.swar-keys {
  position: relative;
  display: flex;
  height: 190px;
  max-width: 560px;
  margin: 18px auto 4px;
  user-select: none;
  touch-action: manipulation;
}
.swar-key {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  font: inherit;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform 0.08s, box-shadow var(--transition);
}
.swar-key.white {
  flex: 1;
  min-width: 0;
  padding-bottom: 14px;
  background: linear-gradient(180deg, #f6eddc, #dccdb2);
  color: #2b1d0c;
  border: 1px solid rgba(0,0,0,0.45);
  border-radius: 0 0 10px 10px;
}
.swar-key.black {
  position: absolute;
  top: 0;
  left: calc(var(--at) * 100% / 7);
  z-index: 2;
  width: calc(100% / 7 * 0.64);
  height: 60%;
  transform: translateX(-50%);
  padding-bottom: 8px;
  background: linear-gradient(180deg, #2e241a, #0c0906);
  color: var(--gold-light);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 0 0 8px 8px;
}
.swar-key-name { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; }
.swar-key.black .swar-key-name { font-size: 0.85rem; }
.swar-key-q { font-size: 0.5rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.swar-key.white:hover:not(:disabled) { background: linear-gradient(180deg, #fff6e4, #eadbbf); }
.swar-key.black:hover:not(:disabled) { background: linear-gradient(180deg, #3d3022, #1a130c); }
.swar-key.white:active:not(:disabled) { transform: translateY(2px); }
.swar-key.black:active:not(:disabled) { transform: translateX(-50%) translateY(2px); }
.swar-key:disabled { cursor: default; }
.swar-key.white:disabled { background: linear-gradient(180deg, #7d735f, #625847); color: rgba(30,20,8,0.55); }
.swar-key.black:disabled { background: linear-gradient(180deg, #1b150f, #0a0806); color: rgba(255,209,102,0.22); border-color: rgba(245,166,35,0.08); }
.swar-key.right { background: linear-gradient(180deg, #8ff0b4, #3fbf73) !important; color: #06240f; opacity: 1; box-shadow: 0 0 18px rgba(95,211,141,0.6); }
.swar-key.wrong { background: linear-gradient(180deg, #ffb0a8, #e5534b) !important; color: #2a0503; opacity: 1; box-shadow: 0 0 18px rgba(229,83,75,0.55); }

/* Sam Pakdo: stages */
.stage-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.stage-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.stage-card:hover:not(:disabled) { border-color: var(--border-gold); background: var(--bg-hover); transform: translateY(-1px); }
.stage-card:disabled { cursor: default; opacity: 0.45; }
.stage-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold);
}
.stage-text { flex: 1; min-width: 0; }
.stage-title { display: block; font-weight: 600; color: var(--text-primary); }
.stage-sub { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--text-sub); }
.stage-stars { flex-shrink: 0; color: var(--gold); letter-spacing: 2px; font-size: 1rem; }

/* Sam Pakdo: the taal wheel */
.sam-stage-name { text-align: center; font-size: 0.8rem; color: var(--text-sub); margin-top: 12px; }
.sam-arena { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 6px auto 0; }
.taal-wheel { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; user-select: none; }
.wheel-ring { fill: rgba(245,166,35,0.03); stroke: var(--border-gold); stroke-width: 1.5; transition: fill 0.3s, stroke 0.3s; }
.taal-wheel.hit .wheel-ring { animation: wheelHit 0.45s ease-out; }
@keyframes wheelHit {
  0% { fill: rgba(245,166,35,0.28); stroke: var(--gold-light); }
  100% { fill: rgba(245,166,35,0.03); stroke: var(--border-gold); }
}
.wheel-dot { fill: rgba(255,255,255,0.2); transform-box: fill-box; transform-origin: center; transition: transform 0.08s, fill 0.08s; }
.wheel-dot.sam { fill: var(--gold); }
.wheel-dot.taali { fill: rgba(245,166,35,0.55); }
.wheel-dot.khali { fill: transparent; stroke: rgba(255,255,255,0.45); stroke-dasharray: 2 2; }
.wheel-dot.sam.khali { fill: var(--gold); stroke: none; }
.wheel-dot.now { fill: var(--gold-light); transform: scale(1.6); }
.wheel-label { fill: var(--text-sub); font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.wheel-label.sam { fill: var(--gold); font-size: 14px; }
.wheel-hand { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; transition: opacity 0.4s; }
.wheel-hub { fill: var(--gold); }
.taal-wheel.hand-hidden .wheel-hand { opacity: 0; }
.taal-wheel.hand-hidden .wheel-dot.now { fill: rgba(255,255,255,0.2); transform: none; }
.taal-wheel.hand-hidden .wheel-dot.sam.now { fill: var(--gold); }

.sam-feedback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}
.sam-feedback.show { animation: feedbackPop 0.9s ease-out forwards; }
@keyframes feedbackPop {
  0% { opacity: 0; transform: scale(0.7); }
  15% { opacity: 1; transform: scale(1.08); }
  30% { transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}
.fb-grade { font-family: 'Cinzel', serif; font-size: 1.7rem; font-weight: 700; text-shadow: 0 2px 16px rgba(0,0,0,0.8); }
.fb-detail { margin-top: 2px; font-size: 0.75rem; color: var(--text-primary); text-shadow: 0 1px 8px rgba(0,0,0,0.9); }
.grade-perfect .fb-grade { color: var(--gold-light); }
.grade-great .fb-grade { color: #7ee0a1; }
.grade-good .fb-grade { color: #8fb8ff; }
.grade-miss .fb-grade { color: #ff8a80; }
.grade-early .fb-grade, .grade-late .fb-grade { color: #ffb86b; }
.grade-wait .fb-grade { color: var(--text-sub); }

.btn-sam {
  display: block;
  width: min(320px, 100%);
  height: 68px;
  margin: 14px auto 0;
  border: none;
  border-radius: 34px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a0e00;
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(245,166,35,0.35);
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.06s, box-shadow var(--transition);
}
.btn-sam:active { transform: scale(0.97); box-shadow: 0 4px 16px rgba(245,166,35,0.35); }

/* Results */
.game-results { text-align: center; padding: 8px 0 4px; }
.result-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-sub); margin-top: 14px; }
.result-stars { font-size: 2.2rem; letter-spacing: 8px; color: var(--gold); text-shadow: 0 0 22px rgba(245,166,35,0.45); }
.result-score {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--gold-light), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.result-best { font-size: 0.85rem; color: var(--text-sub); margin-top: 2px; }
.result-best.new-best { color: var(--gold-light); font-weight: 700; }
.result-stats { font-size: 0.85rem; line-height: 1.5; color: var(--text-primary); margin: 10px auto 0; max-width: 520px; }
.result-list { list-style: none; margin-top: 6px; font-size: 0.85rem; line-height: 1.7; color: var(--text-sub); }

@media (max-width: 640px) {
  .swar-keys { height: 170px; }
  .swar-orb { width: 96px; height: 96px; font-size: 1.9rem; }
  .game-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hud-wide { grid-column: 1 / -1; order: 5; }
  .hud-item { padding: 7px 10px; }
  .stage-card { gap: 10px; padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .swar-orb.pulse, .swar-orb.wrong, .taal-wheel.hit .wheel-ring { animation: none; }
  .sam-feedback.show { animation: none; opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════════
   Page frame: skip link, footer, route focus
   ══════════════════════════════════════════════════════════════════ */
/* A column — header, content, footer — so the footer sits at the bottom of
   a short page */
body { display: flex; flex-direction: column; }
.app-container { flex: 1 0 auto; }

.skip-link {
  position: absolute;
  top: -64px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--gold);
  color: #1a1208;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* Focus moved here by the page itself (a new view, the skip link): no ring */
#main:focus,
[data-route-focus]:focus { outline: none; box-shadow: none; }

.site-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px var(--gutter) 26px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
}
.footer-nav a {
  padding: 4px 2px;
  border-radius: 4px;
  color: var(--text-sub);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--gold); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  font-size: 0.72rem;
  color: var(--text-sub);
  text-align: center;
}
body.fullscreen-mode .site-footer,
body.fullscreen-mode .skip-link { display: none; }
@media (pointer: coarse) {
  .footer-nav a { padding: 9px 4px; }
}

/* ── Keys (shortcut hints) ── */
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
}

/* ── Toasts (public/js/core/toast.js) ── */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 150;               /* above an open modal */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100% - 24px));
  pointer-events: none;
}
body.has-mini-player .toast-region { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 82px); }
.toast {
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  background: rgba(26,19,10,0.97);
  box-shadow: 0 10px 34px rgba(0,0,0,0.55);
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
.toast-success { border-color: rgba(74,222,128,0.45); }
.toast-error { border-color: rgba(255,107,107,0.55); color: #ffd9d4; }

/* ── Lehra mini player (public/js/lehra/mini-player.js) ── */
.mini-player {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 18px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  background: rgba(22,16,8,0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 30px rgba(245,166,35,0.08);
  animation: miniIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes miniIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
}
.mini-progress { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: rgba(255,255,255,0.05); }
.mini-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transition: width 0.12s linear;
}
.mini-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mini-title, .mini-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-title { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.mini-player.playing .mini-title { color: var(--gold-light); }
.mini-sub { font-size: 0.72rem; color: var(--text-sub); }
.mini-matra {
  flex-shrink: 0;
  min-width: 3.6em;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  text-align: right;
}
.mini-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.mini-btn:hover { background: rgba(245,166,35,0.12); border-color: var(--border-gold); }
.mini-btn:active { transform: scale(0.94); }
.mini-play {
  width: 48px;
  height: 48px;
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a1208;
  box-shadow: 0 4px 18px rgba(245,166,35,0.3);
}
.mini-play:hover { background: linear-gradient(135deg, var(--gold-light), var(--orange)); }
body.fullscreen-mode .mini-player { display: none; }
/* Room for the bar under the last thing on the page */
body.has-mini-player .site-footer { padding-bottom: 104px; }

/* ── Raag finder (public/js/lehra/finder.js) ── */
.raag-finder {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.finder-field { position: relative; flex: 0 1 340px; min-width: 220px; }
.finder-input {
  width: 100%;
  padding: 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.finder-input::placeholder { color: var(--text-sub); opacity: 1; }
.finder-input:focus { border-color: var(--border-gold); box-shadow: 0 0 0 3px rgba(245,166,35,0.12); }
.finder-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
  pointer-events: none;
}
.finder-key {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
  pointer-events: none;
}
.finder-input:focus ~ .finder-key,
.finder-input:not(:placeholder-shown) ~ .finder-key { display: none; }
.finder-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  background: rgba(24,18,9,0.98);
  box-shadow: 0 16px 44px rgba(0,0,0,0.6);
}
.finder-option {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.finder-option:hover,
.finder-option[aria-selected="true"] { background: var(--bg-active); }
.finder-option-name { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }
.finder-option[aria-selected="true"] .finder-option-name { color: var(--gold); }
.finder-option-where { font-size: 0.72rem; color: var(--text-sub); }
.finder-empty { padding: 10px; font-size: 0.8rem; color: var(--text-sub); }
.finder-chips {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.finder-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.finder-chip:hover { border-color: var(--border-gold); background: var(--bg-hover); }
.finder-chip.favourite .finder-chip-name { color: var(--gold); }
.finder-chip.active { border-color: var(--gold); background: var(--bg-active); }
.finder-chip-where { font-size: 0.66rem; color: var(--text-sub); }
.finder-hint { font-size: 0.76rem; color: var(--text-sub); }

/* Favourite star, beside the Now Playing label */
.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -6px 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-sub);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}
.fav-btn svg { fill: none; stroke: currentColor; }
.fav-btn:hover { color: var(--gold); background: rgba(245,166,35,0.1); }
.fav-btn:active { transform: scale(0.9); }
.fav-btn[aria-pressed="true"] { color: var(--gold); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

/* ── Home: continue your riyaz (public/js/lehra/resume.js) ── */
.resume-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 28px;
  width: calc(100% - 3rem);
  max-width: 1052px;
  margin: 0 auto;
  padding: 20px 24px;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(245,166,35,0.07), rgba(232,87,42,0.03) 60%, rgba(0,0,0,0.05));
  box-shadow: var(--shadow-gold);
}
.resume-main { min-width: 0; }
.resume-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
}
.resume-title {
  margin-top: 4px;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.resume-sub { margin-top: 2px; font-size: 0.84rem; color: var(--text-sub); }
.resume-goal { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.resume-goal .tool-progress { flex: none; }
.resume-goal-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 0.78rem;
  color: var(--text-sub);
}
.resume-streak { color: var(--gold); font-weight: 600; white-space: nowrap; }
.resume-btn { justify-self: end; text-decoration: none; white-space: nowrap; }

/* ── Riyaz tracker totals ── */
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
  text-align: center;
}
.stat-tile-value { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--gold); }
.stat-tile-label { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-sub); }
.stats-empty { margin: 12px 0 0; text-align: center; }

/* ── Keyboard shortcuts dialog ── */
.shortcut-list { margin-bottom: 16px; }
.shortcut-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.shortcut-list > div:last-child { border-bottom: none; }
.shortcut-list dt { display: flex; gap: 4px; }
.shortcut-list dd { font-size: 0.85rem; color: var(--text-primary); }
.shortcuts-btn {
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-sub);
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition);
}
.shortcuts-btn:hover { color: var(--gold); }

@media (max-width: 760px) {
  .resume-card { grid-template-columns: minmax(0, 1fr); gap: 14px; text-align: center; }
  .resume-goal-row { justify-content: center; }
  .resume-btn { justify-self: center; }
}
@media (max-width: 640px) {
  .resume-card { width: 100%; padding: 18px 16px; }
  .resume-title { font-size: 1.3rem; }
  .finder-field { flex-basis: 100%; }
  /* Favourites and recents in one swipeable row instead of pushing the lists down */
  .finder-chips { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .finder-chips::-webkit-scrollbar { display: none; }
  .finder-chip { flex-shrink: 0; }
  .finder-hint { white-space: normal; }
  .mini-player { gap: 8px; padding-left: 14px; }
  .mini-matra { min-width: 3.2em; font-size: 0.76rem; }
}
@media (pointer: coarse) {
  .finder-key { display: none; }
  .finder-input { font-size: 16px; }
  .finder-chip { padding: 8px 14px; }
  .fav-btn { width: 40px; height: 40px; margin: -10px 0; }
}

/* ══════════════════════════════════════════════════════════════════
   Your Progress / account (public/js/account/)
   ══════════════════════════════════════════════════════════════════ */
.account-panel {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.account-stats .stat-tile { padding: 14px 8px; }
.account-stats .stat-tile-value { font-size: 1.15rem; }
.account-days { margin: 14px 0 0; text-align: center; }
.account-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.account-box {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.account-state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.account-state .modal-hint { margin-bottom: 0; }
.account-loading { flex-direction: row; align-items: center; font-size: 0.84rem; color: var(--text-sub); }
.spinner {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(245,166,35,0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* "Continue with Google": Google's own light button, as its guidelines ask */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border: 1px solid #dadce0;
  border-radius: 22px;
  background: #ffffff;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.btn-google:hover { box-shadow: 0 2px 14px rgba(255,255,255,0.18); transform: translateY(-1px); }
.btn-google:active { transform: scale(0.98); }
.btn-google:disabled { opacity: 0.6; cursor: default; transform: none; }

.account-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-photo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  object-fit: cover;
}
.account-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-active);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
}
.account-who { min-width: 0; }
.account-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.account-email { font-size: 0.78rem; color: var(--text-sub); overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-danger:hover { color: #ff8f8f; border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.08); }
.account-error { margin: 0 0 14px; color: #ffb4a8; }
/* Signed in: the header button says so */
#accountBtn.active { box-shadow: 0 0 0 2px rgba(74,222,128,0.35); }

@media (max-width: 520px) {
  .account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ══════════════════════════════════════════════════════════════════
   Guided tour (public/js/core/tour.js) — Driver.js, in the site's colours
   ══════════════════════════════════════════════════════════════════ */
.driver-popover.swaralaya-tour {
  max-width: min(330px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  background: linear-gradient(160deg, #1e160a, #0d0b08);
  box-shadow: 0 0 40px rgba(245,166,35,0.14), 0 18px 48px rgba(0,0,0,0.65);
  color: var(--text-primary);
  font-family: 'Outfit', 'Inter', sans-serif;
}
.swaralaya-tour .driver-popover-title {
  padding-right: 22px;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--gold);
}
.swaralaya-tour .driver-popover-description {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.swaralaya-tour .driver-popover-progress-text { font-size: 0.72rem; color: var(--text-sub); }
.swaralaya-tour .driver-popover-footer-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  background: rgba(245,166,35,0.08);
  color: var(--gold);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  text-shadow: none;
}
.swaralaya-tour .driver-popover-footer-btn:hover,
.swaralaya-tour .driver-popover-footer-btn:focus { background: rgba(245,166,35,0.18); }
.swaralaya-tour .driver-popover-footer-btn:focus-visible { box-shadow: var(--focus-ring); }
.swaralaya-tour .driver-popover-close-btn { color: var(--text-sub); }
.swaralaya-tour .driver-popover-close-btn:hover,
.swaralaya-tour .driver-popover-close-btn:focus { color: var(--gold); }
/* The arrow takes the popover's colour on the side it points from */
.swaralaya-tour .driver-popover-arrow-side-left { border-left-color: #17110a; }
.swaralaya-tour .driver-popover-arrow-side-right { border-right-color: #17110a; }
.swaralaya-tour .driver-popover-arrow-side-top { border-top-color: #17110a; }
.swaralaya-tour .driver-popover-arrow-side-bottom { border-bottom-color: #17110a; }

/* First visit: the offer to take the tour */
.tour-offer {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 70;
  width: min(320px, calc(100% - 32px));
  padding: 16px;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  background: rgba(24,18,9,0.97);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 30px rgba(245,166,35,0.1);
  animation: offerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes offerIn {
  from { opacity: 0; transform: translateY(14px); }
}
.tour-offer p { font-size: 0.86rem; line-height: 1.5; color: var(--text-primary); }
.tour-offer-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
body.has-mini-player .tour-offer { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px); }
body.fullscreen-mode .tour-offer { display: none; }

/* ── Home: what each tool does ── */
.features-summary {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 2rem;
}
.features-title {
  margin-bottom: 1.1rem;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text-primary);
}
.features-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  list-style: none;
}
.features-list li {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-sub);
}
.features-list strong { display: block; margin-bottom: 2px; color: var(--gold); font-weight: 600; }
@media (max-width: 760px) {
  .features-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .features-summary { padding: 0 0 1rem; }
}
