:root {
  --bg: #0c0818;
  --bg-card: rgba(22, 16, 38, 0.78);
  --bg-input: rgba(12, 8, 24, 0.65);
  --bg-sidebar: rgba(16, 11, 30, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f3ff;
  --text-soft: rgba(247, 243, 255, 0.72);
  --text-muted: rgba(247, 243, 255, 0.48);
  --coral: #ff7d6e;
  --amber: #ffb347;
  --violet: #9b7bff;
  --teal: #5fd4c7;
  --rose: #ff6cab;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius: 20px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  line-height: 1.5;
  background:
    radial-gradient(1200px 700px at 50% -20%, rgba(155, 123, 255, 0.20), transparent 55%),
    radial-gradient(900px 500px at 100% 30%, rgba(255, 125, 110, 0.10), transparent 50%),
    radial-gradient(800px 500px at 0% 80%, rgba(95, 212, 199, 0.09), transparent 45%),
    var(--bg);
}

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-a { width: 340px; height: 340px; top: -80px; right: -60px; background: rgba(155, 123, 255, 0.35); }
.orb-b { width: 280px; height: 280px; bottom: 10%; left: -80px; background: rgba(255, 125, 110, 0.22); }
.orb-c { width: 220px; height: 220px; bottom: 35%; right: 12%; background: rgba(95, 212, 199, 0.18); }

/* ---------------- App shell ---------------- */
.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.75rem 1.1rem;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  width: 2.9rem; height: 2.9rem; display: grid; place-items: center; border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 125, 110, 0.3), rgba(155, 123, 255, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.brand-sa {
  font-family: var(--font-display); font-size: 1.25rem; line-height: 1;
  background: linear-gradient(135deg, #ffd4a8, #fff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text h1 { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; line-height: 1; }
.brand-text p { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 0.3rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  padding: 0.7rem 0.8rem; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 500;
  color: var(--text-soft); background: transparent; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.active { background: rgba(155, 123, 255, 0.16); color: #fff; }
.nav-item.active .nav-icon { color: var(--violet); }
.nav-icon { display: grid; place-items: center; color: var(--text-muted); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.85rem; }
.foot-note { margin: 0; font-size: 0.74rem; color: var(--text-muted); line-height: 1.4; }

.account { padding: 0.75rem 0.8rem; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,0.03); }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.acct-tier { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--text-soft); padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(255,255,255,0.06); }
.acct-tier.pro { color: #0c0818; background: linear-gradient(135deg, var(--amber), var(--coral)); }
.acct-upgrade { font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: #fff; border: 0; border-radius: 999px; padding: 0.3rem 0.7rem; background: linear-gradient(135deg, var(--violet), var(--coral)); }
.acct-upgrade:hover { filter: brightness(1.08); }
.acct-meta { margin: 0.5rem 0 0; font-size: 0.74rem; color: var(--text-muted); }
.acct-meta:empty { display: none; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.25rem; background: rgba(6, 4, 14, 0.62); backdrop-filter: blur(6px); }
.modal-card { position: relative; width: 100%; max-width: 380px; padding: 1.75rem 1.6rem 1.5rem; border-radius: 22px; border: 1px solid var(--border-strong); background: linear-gradient(160deg, rgba(28,20,48,0.98), rgba(18,12,32,0.98)); box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 0.8rem; right: 0.95rem; font-size: 1.5rem; line-height: 1; color: var(--text-muted); background: transparent; border: 0; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-kicker { margin: 0; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; background: linear-gradient(135deg, var(--amber), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.modal-title { margin: 0.3rem 0 1rem; font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; }
.modal-perks { list-style: none; margin: 0 0 1.3rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.modal-perks li { position: relative; padding-left: 1.5rem; font-size: 0.92rem; color: var(--text-soft); }
.modal-perks li::before { content: "✦"; position: absolute; left: 0; color: var(--amber); }
.modal-cta { width: 100%; font: inherit; font-size: 0.98rem; font-weight: 600; color: #fff; border: 0; border-radius: 13px; padding: 0.85rem; cursor: pointer; background: linear-gradient(135deg, var(--violet), var(--coral)); box-shadow: 0 12px 30px rgba(155,123,255,0.3); }
.modal-cta:hover { filter: brightness(1.06); }
.modal-fineprint { margin: 0.8rem 0 0; text-align: center; font-size: 0.76rem; color: var(--text-muted); }

.content { padding: 2.25rem 2rem 4rem; max-width: 1080px; width: 100%; }

.view-head { margin-bottom: 1.4rem; }
.view-title { margin: 0; font-family: var(--font-display); font-size: 2.1rem; font-weight: 400; letter-spacing: -0.01em; }
.view-sub { margin: 0.3rem 0 0; color: var(--text-soft); font-size: 0.98rem; }

.panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(18px); box-shadow: var(--shadow);
}

/* ---------------- Pitch Finder ---------------- */
.search-panel { padding: 1.25rem; position: relative; z-index: 5; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#search {
  width: 100%; padding: 1rem 1rem 1rem 3rem; font: inherit; font-size: 1.02rem; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#search::placeholder { color: rgba(247, 243, 255, 0.34); }
#search:focus { border-color: rgba(155, 123, 255, 0.55); box-shadow: 0 0 0 4px rgba(155, 123, 255, 0.14); background: rgba(12, 8, 24, 0.85); }

.suggestions {
  list-style: none; margin: 0.55rem 0 0; padding: 0.4rem; position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: rgba(18, 12, 32, 0.97); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; backdrop-filter: blur(20px);
}
.suggestions li { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.75rem; border-radius: 11px; cursor: pointer; transition: background 0.15s; }
.suggestions li:hover, .suggestions li.active { background: rgba(255, 255, 255, 0.06); }
.suggestions li.empty { color: var(--text-muted); cursor: default; padding-left: 0.85rem; }
.s-art { width: 2.6rem; height: 2.6rem; border-radius: 9px; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.s-copy { min-width: 0; }
.s-title { font-weight: 600; font-size: 0.96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.welcome-panel { margin-top: 1.25rem; padding: 1.35rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.welcome-panel[hidden] { display: none !important; }
.welcome-art { display: flex; align-items: flex-end; gap: 4px; height: 42px; flex-shrink: 0; }
.welcome-art .bar { width: 5px; border-radius: 999px; background: linear-gradient(180deg, var(--coral), var(--violet)); animation: bounce 1.2s ease-in-out infinite; }
.welcome-art .bar:nth-child(1) { height: 35%; animation-delay: 0s; }
.welcome-art .bar:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.welcome-art .bar:nth-child(3) { height: 50%; animation-delay: 0.2s; }
.welcome-art .bar:nth-child(4) { height: 90%; animation-delay: 0.15s; }
.welcome-art .bar:nth-child(5) { height: 60%; animation-delay: 0.25s; }
.welcome-art .bar:nth-child(6) { height: 40%; animation-delay: 0.05s; }
.welcome-art .bar:nth-child(7) { height: 75%; animation-delay: 0.18s; }
@keyframes bounce { 0%, 100% { transform: scaleY(0.75); opacity: 0.65; } 50% { transform: scaleY(1); opacity: 1; } }
.welcome-text { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

.result-panel { margin-top: 1.25rem; padding: 1.35rem; }
.result-panel[hidden] { display: none !important; }
.now-playing { display: flex; align-items: center; gap: 1rem; }
.artwork { width: 4.5rem; height: 4.5rem; border-radius: 13px; flex-shrink: 0; box-shadow: 0 12px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.15); }
.now-label { margin: 0; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--coral); font-weight: 600; }
.track-copy h3 { margin: 0.2rem 0 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; line-height: 1.15; }
.result-meta { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.88rem; }

.status { display: flex; align-items: center; gap: 0.85rem; margin-top: 1.35rem; padding: 0.85rem 1rem; border-radius: 13px; background: rgba(255,255,255,0.04); color: var(--text-soft); font-size: 0.92rem; }
.pulse-ring { width: 1rem; height: 1rem; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 0 rgba(155,123,255,0.55); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(155,123,255,0.55); } 70% { box-shadow: 0 0 0 12px rgba(155,123,255,0); } 100% { box-shadow: 0 0 0 0 rgba(155,123,255,0); } }

.pitch-card { position: relative; margin-top: 1.35rem; overflow: hidden; border-radius: 16px; border: 1px solid rgba(255,255,255,0.1); }
.pitch-card-inner { position: relative; z-index: 1; padding: 1.65rem 1.25rem 1.5rem; text-align: center; }
.pitch-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(255,179,71,0.22), transparent 55%), radial-gradient(circle at 20% 100%, rgba(155,123,255,0.18), transparent 50%), radial-gradient(circle at 80% 100%, rgba(95,212,199,0.14), transparent 45%); }
.pitch-label { margin: 0; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); font-weight: 600; }
.pitch-value { margin: 0.25rem 0 0; font-family: var(--font-display); font-size: 4.5rem; font-weight: 400; line-height: 1; letter-spacing: -0.03em; background: linear-gradient(135deg, #fff 20%, #ffd4a8 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pitch-sa { margin: 0.55rem 0 0; font-size: 0.95rem; color: var(--text-soft); font-weight: 500; }
.pitch-tip { margin: 0.85rem auto 0; max-width: 26rem; font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; }

/* ---------------- Discover ---------------- */
.filter-panel { padding: 1.25rem; }
.filter-row { margin-bottom: 1rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; }
.filter-field { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-field label { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.filter-field input[type="search"], .filter-field select {
  width: 100%; padding: 0.7rem 0.8rem; font: inherit; font-size: 0.94rem; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 11px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238b7fa0' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2rem;
}
.filter-field input:focus, .filter-field select:focus { border-color: rgba(155,123,255,0.55); box-shadow: 0 0 0 3px rgba(155,123,255,0.14); }
.filter-check { justify-content: flex-end; }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text-soft); cursor: pointer; text-transform: none; letter-spacing: 0; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--violet); }

.filter-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 1.1rem; }
.discover-count { font-size: 0.86rem; color: var(--text-muted); font-weight: 500; }
.ghost-btn { font: inherit; font-size: 0.86rem; font-weight: 500; color: var(--text-soft); background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 999px; padding: 0.45rem 0.95rem; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.ghost-btn:hover { background: rgba(255,125,110,0.14); border-color: rgba(255,125,110,0.35); }

.discover-results { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.discover-empty { color: var(--text-muted); font-size: 0.95rem; grid-column: 1 / -1; padding: 1rem 0.25rem; }

.song-card {
  display: flex; gap: 0.85rem; align-items: center; text-align: left; width: 100%;
  padding: 0.8rem; border: 1px solid var(--border); border-radius: 15px; cursor: pointer;
  background: var(--bg-card); color: var(--text); font: inherit;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.song-card:hover { transform: translateY(-2px); border-color: rgba(155,123,255,0.4); background: rgba(28,20,48,0.85); }
.card-art { position: relative; width: 3.4rem; height: 3.4rem; border-radius: 11px; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18); }
.card-pitch { position: absolute; right: -6px; bottom: -6px; min-width: 1.5rem; height: 1.5rem; padding: 0 0.35rem; display: grid; place-items: center; border-radius: 999px; background: #0c0818; border: 1px solid rgba(255,255,255,0.18); font-family: var(--font-display); font-size: 0.95rem; color: var(--amber); }
.card-body { min-width: 0; flex: 1; }
.card-title { font-weight: 600; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.card-tag { font-size: 0.72rem; color: var(--text-soft); background: rgba(255,255,255,0.06); border-radius: 999px; padding: 0.2rem 0.55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------------- Riyaz (swara tuner) ---------------- */
.riyaz-controls { padding: 1.1rem 1.25rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.1rem; }
.riyaz-control { display: flex; flex-direction: column; gap: 0.4rem; }
.riyaz-control > label { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.riyaz-control select {
  padding: 0.6rem 2rem 0.6rem 0.8rem; font: inherit; font-size: 0.94rem; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 11px; outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238b7fa0' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
}
.riyaz-control select:focus { border-color: rgba(155,123,255,0.55); box-shadow: 0 0 0 3px rgba(155,123,255,0.14); }
.riyaz-toggles { justify-content: flex-end; padding-bottom: 0.55rem; }
.riyaz-mic { margin-left: auto; }

.segmented { display: inline-flex; padding: 3px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; }
.seg { font: inherit; font-size: 0.85rem; font-weight: 500; color: var(--text-soft); background: transparent; border: 0; border-radius: 9px; padding: 0.5rem 0.85rem; cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg:hover { color: var(--text); }
.seg.active { background: rgba(155,123,255,0.22); color: #fff; }

.mic-btn { display: inline-flex; align-items: center; gap: 0.55rem; font: inherit; font-size: 0.95rem; font-weight: 600; color: #fff; cursor: pointer; padding: 0.7rem 1.2rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); background: linear-gradient(135deg, var(--violet), var(--coral)); box-shadow: 0 10px 26px rgba(155,123,255,0.32); transition: transform 0.12s, box-shadow 0.15s; }
.mic-btn:hover { transform: translateY(-1px); }
.mic-btn.on { background: linear-gradient(135deg, #ff6b6b, #ff9a6b); box-shadow: 0 10px 26px rgba(255,107,107,0.32); }
.mic-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: rgba(255,255,255,0.7); }
.mic-btn.on .mic-dot { background: #fff; animation: micpulse 1.1s ease-out infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.6); } 70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

.tuner-panel { margin-top: 1.25rem; padding: 1.6rem 1.5rem; }
.tuner-status { margin: 0; text-align: center; color: var(--text-soft); font-size: 0.95rem; }

.tuner-stage { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.swara-readout { display: flex; flex-direction: column; align-items: center; }
.swara-octave { order: 0; height: 1.1rem; font-size: 1.3rem; line-height: 1; letter-spacing: 4px; color: var(--amber); }
.swara-octave.below { order: 2; color: var(--violet); }
.swara-name { order: 1; font-family: var(--font-display); font-size: 5rem; font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; transition: color 0.12s; }
.swara-sub { order: 3; margin-top: 0.35rem; color: var(--text-muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }

.meter { width: 100%; max-width: 460px; }
.meter-track { position: relative; height: 58px; border-radius: 13px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); overflow: hidden; }
.meter-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.28); transform: translateX(-50%); }
.meter-zone { position: absolute; top: 0; bottom: 0; background: rgba(95,212,199,0.14); border-left: 1px solid rgba(95,212,199,0.35); border-right: 1px solid rgba(95,212,199,0.35); }
.meter-needle { position: absolute; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.4); box-shadow: 0 0 14px currentColor; transition: left 0.07s linear, background 0.12s; color: var(--teal); }
.meter-tick { position: absolute; top: 50%; transform: translateY(-50%); font-size: 0.68rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.meter-tick-l { left: 9px; } .meter-tick-r { right: 9px; }
.meter-readout { margin-top: 0.55rem; text-align: center; font-size: 0.9rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.meter-dir { margin-left: 0.35rem; font-weight: 600; }

.sustain { display: flex; justify-content: center; }
.sustain-ring { position: relative; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring, #5fd4c7) var(--fill, 0deg), rgba(255,255,255,0.07) 0deg); transition: background 0.1s linear; }
.sustain-ring::before { content: ""; position: absolute; width: 74px; height: 74px; border-radius: 50%; background: #130d22; }
.sustain-ring span { position: relative; z-index: 1; font-size: 0.74rem; color: var(--text-muted); text-align: center; }
.sustain-ring.done { --ring: #54e08a; box-shadow: 0 0 26px rgba(84,224,138,0.45); }
.sustain-ring.done span { color: #8ff0b3; font-weight: 600; }

.swara-scale { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.swara-pip { font-size: 0.85rem; font-weight: 600; color: var(--text-soft); padding: 0.4rem 0.62rem; border-radius: 9px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); transition: background 0.12s, color 0.12s, transform 0.12s; }
.swara-pip.altered { color: var(--text-muted); font-weight: 500; }
.swara-pip.active { color: #0c0818; background: var(--pip, var(--teal)); border-color: transparent; box-shadow: 0 6px 18px rgba(0,0,0,0.3); transform: translateY(-1px); }

/* Bhatkhande marks: komal = underline below, tivra = vertical line above. */
.swara-mark { position: relative; display: inline-block; padding: 0 0.06em; }
.swara-mark.komal::after {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: -0.04em;
  height: max(2px, 0.05em); background: currentColor; border-radius: 1px;
}
.swara-mark.tivra::before {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: -0.18em;
  width: max(2px, 0.05em); height: 0.3em; background: currentColor; border-radius: 1px;
}

/* ---------------- Raag Practice (tanpura + tabla) ---------------- */
.raag-controls { padding: 1.1rem 1.25rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.1rem; }
.raag-control { display: flex; flex-direction: column; gap: 0.4rem; }
.raag-control > label { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.raag-control select {
  padding: 0.6rem 2rem 0.6rem 0.8rem; font: inherit; font-size: 0.94rem; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 11px; outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238b7fa0' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
}
.raag-control select:focus { border-color: rgba(155,123,255,0.55); box-shadow: 0 0 0 3px rgba(155,123,255,0.14); }
.raag-bpm { min-width: 200px; flex: 1 1 200px; }
.raag-vol { min-width: 140px; flex: 1 1 140px; }
.raag-vol input[type="range"] { width: 100%; accent-color: var(--teal); margin-top: 0.35rem; }
.raag-bpm input[type="range"] { width: 100%; accent-color: var(--violet); margin-top: 0.35rem; }
.bpm-readout { color: var(--amber); font-variant-numeric: tabular-nums; }
.raag-toggles { flex-direction: row; flex-wrap: wrap; gap: 1rem; align-items: center; padding-bottom: 0.55rem; }
.raag-play { margin-left: auto; }

.play-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; font: inherit; font-size: 0.95rem; font-weight: 600;
  color: #fff; cursor: pointer; padding: 0.7rem 1.2rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(135deg, var(--teal), var(--violet)); box-shadow: 0 10px 26px rgba(95,212,199,0.28);
  transition: transform 0.12s, box-shadow 0.15s;
}
.play-btn:hover { transform: translateY(-1px); }
.play-btn.on { background: linear-gradient(135deg, #ff6b6b, #ff9a6b); box-shadow: 0 10px 26px rgba(255,107,107,0.32); }
.play-icon { font-size: 0.85rem; }

.raag-panel { margin-top: 1.25rem; padding: 1.4rem 1.35rem; }
.raag-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.85rem; }
.raag-taal { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; color: var(--text); }
.sam-legend { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.legend-item { font-size: 0.76rem; color: var(--text-muted); padding: 0.25rem 0.55rem; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); }
.legend-item.taali strong { color: var(--amber); }
.legend-item.khali { border-color: rgba(95,212,199,0.35); color: var(--teal); }
.legend-item.khali strong { color: var(--teal); }

.raag-status { margin: 0 0 1.2rem; text-align: center; color: var(--text-soft); font-size: 0.92rem; }

.matra-grid {
  display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 0.45rem;
}
.matra-vibhag {
  width: 2px; align-self: stretch; min-height: 4.5rem; margin: 0 0.15rem;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.22), transparent); border-radius: 2px;
}
.matra-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 3.6rem; padding: 0.55rem 0.45rem 0.4rem; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  transition: background 0.1s, border-color 0.1s, transform 0.1s, box-shadow 0.1s;
}
.matra-sam { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.2rem; color: var(--amber); }
.matra-sam.khali { color: var(--teal); font-size: 0.58rem; }
.matra-bol { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.matra-num { margin-top: 0.25rem; font-size: 0.65rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.matra-cell.active {
  background: rgba(155,123,255,0.22); border-color: rgba(155,123,255,0.55);
  box-shadow: 0 8px 22px rgba(155,123,255,0.25); transform: translateY(-2px);
}
.matra-cell.active .matra-bol { color: #fff; }
.matra-cell.sam-beat.active { border-color: rgba(255,193,90,0.65); box-shadow: 0 8px 22px rgba(255,193,90,0.2); }
.matra-cell.active .matra-sam.khali { color: #9ef0e8; }

/* ---------------- Mobile ---------------- */
.mobile-tabs { display: none; }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .nav { display: none; }
  .sidebar-foot { margin-top: 0; }
  .sidebar-foot .foot-note, .sidebar-foot .acct-meta { display: none; }
  .account { padding: 0; border: 0; background: transparent; }
  .account-row { gap: 0.5rem; }
  .content { padding: 1.5rem 1.1rem 6rem; }
  .view-title { font-size: 1.8rem; }
  .mobile-tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(16, 11, 30, 0.95); border-top: 1px solid var(--border); backdrop-filter: blur(18px);
  }
  .mobile-tabs .tab { flex: 1; padding: 0.95rem; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
  .mobile-tabs .tab.active { color: #fff; box-shadow: inset 0 2px 0 var(--violet); }

  .riyaz-controls { align-items: stretch; }
  .riyaz-control { flex: 1 1 100%; }
  .riyaz-mic { margin-left: 0; }
  .riyaz-control select, .segmented, .mic-btn { width: 100%; justify-content: center; }
  .raag-controls { align-items: stretch; }
  .raag-control { flex: 1 1 100%; }
  .raag-play { margin-left: 0; }
  .raag-control select, .play-btn { width: 100%; justify-content: center; }
  .mobile-tabs .tab { font-size: 0.78rem; padding: 0.85rem 0.35rem; }
  .matra-cell { min-width: 2.85rem; padding: 0.45rem 0.3rem; }
  .matra-bol { font-size: 0.92rem; }
  .swara-name { font-size: 4rem; }
}
