:root {
  --bg: #f5f5f3;
  --bg-soft: #f9f7f2;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --stroke: rgba(19, 31, 45, 0.08);
  --text: #121826;
  --muted: #536074;
  --muted-soft: #7a8698;
  --primary: #1d7af2;
  --primary-dark: #0f5ec6;
  --accent: #f3b843;
  --green: #1db954;
  --purple: #7b61ff;
  --red: #f35f5f;
  --orange: #ff9f43;
  --shadow: 0 24px 48px rgba(25, 33, 50, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(29, 122, 242, 0.08), transparent 30%),
    linear-gradient(180deg, #f9f4ed 0%, #f5f5f3 100%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 12px 20px rgba(29, 122, 242, 0.25);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-tag {
  font-size: 0.6rem;
  color: var(--muted-soft);
}

.main-nav {
  display: none;
  align-items: center;
  gap: 18px;
  font-size: 0.96rem;
}

.nav-item {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: rgba(29, 122, 242, 0.08);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  margin: 0 auto;
}

.page-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 16px 24px;
}

.narrow-shell {
  max-width: 980px;
}

.section-surface {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--stroke);
  box-shadow: 0 10px 24px rgba(19, 31, 45, 0.07);
  border-radius: 26px;
  padding: 18px 16px;
}

.hero {
  display: grid;
  gap: 22px;
  padding: 22px 18px 18px;
}

.gradient-panel {
  background: linear-gradient(135deg, rgba(29, 122, 242, 0.12), rgba(123, 97, 255, 0.08));
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--primary-dark);
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

.hero h1,
.hero-inline h1,
.about-hero h1,
.practice-header h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.lead {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 58ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 24px;
}

.primary-btn,
.secondary-btn,
.filter-pill,
.chip,
.scale-btn,
.play-button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  box-shadow: 0 18px 30px rgba(29, 122, 242, 0.25);
}

.secondary-btn {
  background: rgba(18, 24, 38, 0.04);
  color: var(--text);
}

.primary-btn.small,
.secondary-btn.small {
  padding: 10px 14px;
  font-size: 0.9rem;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 420px);
}

.mini-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(18, 24, 38, 0.06);
}

.mini-stats strong {
  font-size: 1.2rem;
}

.mini-stats span {
  font-size: 0.75rem;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.visual-card {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 22px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(15, 94, 198, 0.88), rgba(123, 97, 255, 0.8));
  color: white;
  box-shadow: 0 26px 50px rgba(35, 46, 80, 0.23);
}

.visual-card h3 {
  margin: 10px 0 8px;
  font-size: 2rem;
}

.visual-card p {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.card-topline {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.25);
}

.chip.accent {
  background: rgba(243, 184, 67, 0.13);
  color: #8a5b06;
}

.chip.neutral {
  background: rgba(29, 122, 242, 0.1);
  color: var(--primary-dark);
}

.chip.purple {
  background: rgba(123, 97, 255, 0.12);
  color: #4333b5;
}

.chip.green {
  background: rgba(29, 185, 84, 0.12);
  color: #107a3f;
}

.pulse-orb {
  position: absolute;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.26), rgba(29, 122, 242, 0.08));
  border-radius: 50%;
  filter: blur(12px);
}

.content-grid,
.about-grid {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: -0.05em;
}

.text-link {
  color: var(--primary-dark);
  font-weight: 700;
}

.list-compact {
  display: grid;
  gap: 12px;
}

.mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 24, 38, 0.02);
  border: 1px solid rgba(18, 24, 38, 0.04);
}

.mini-card strong,
.mini-card span {
  display: block;
}

.mini-card span {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 4px;
}

.progress-stack {
  display: grid;
  gap: 18px;
}

.progress-item {
  display: grid;
  gap: 10px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 24, 38, 0.06);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--green));
}

.card-grid {
  display: grid;
  gap: 18px;
}

.music-card {
  padding: 18px 16px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, #f9f7f2);
  border: 1px solid rgba(18, 24, 38, 0.06);
  box-shadow: 0 10px 28px rgba(15, 22, 35, 0.04);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(29, 122, 242, 0.08);
  color: var(--primary-dark);
}

.card-badge.purple {
  background: rgba(123, 97, 255, 0.12);
  color: #4333b5;
}

.card-badge.green {
  background: rgba(29, 185, 84, 0.12);
  color: #0f7d44;
}

.card-badge.orange {
  background: rgba(255, 159, 67, 0.12);
  color: #a85c0a;
}

.card-badge.red {
  background: rgba(243, 95, 95, 0.1);
  color: #9f2e2e;
}

.card-badge.blue {
  background: rgba(29, 122, 242, 0.1);
  color: #1d5fc6;
}

.music-card h3 {
  margin: 16px 0 10px;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
}

.music-card p {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.concept-grid {
  display: grid;
  gap: 18px;
}

.concept-box {
  padding: 18px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(29, 122, 242, 0.04), rgba(123, 97, 255, 0.02));
  border: 1px solid rgba(18, 24, 38, 0.05);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  margin-bottom: 14px;
}

.concept-box p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 18px;
}

.search-box input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(18, 24, 38, 0.08);
  background: rgba(18, 24, 38, 0.02);
  color: var(--text);
  outline: none;
}

.raag-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.raag-filter-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.raag-filter-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.raag-filter-form button {
  white-space: nowrap;
}

.raag-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.composition-lab:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 22px;
  margin-top: 20px;
}

.dataset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.dataset-tabs .is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.dataset-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding-right: 18px;
  border-right: 1px solid var(--stroke);
}

.dataset-sidebar label,
.dataset-select-wrap {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.dataset-sidebar select,
.dataset-sidebar input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.dataset-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.dataset-meta div {
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}

.dataset-meta dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.dataset-meta dd {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
}

.dataset-analysis {
  min-width: 0;
}

.dataset-analysis h2,
.dataset-analysis h3 {
  margin: 0 0 10px;
}

.dataset-analysis h2 {
  font-size: 1.15rem;
}

.dataset-field-stats,
.dataset-table-wrap {
  width: 100%;
  overflow: auto;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.dataset-field-stats table,
.dataset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dataset-field-stats th,
.dataset-field-stats td,
.dataset-table th,
.dataset-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
  white-space: nowrap;
}

.dataset-field-stats th,
.dataset-table th {
  position: sticky;
  top: 0;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 0.75rem;
}

.dataset-table tbody tr {
  cursor: pointer;
}

.dataset-table tbody tr:hover,
.dataset-table tbody tr[aria-selected="true"] {
  background: #edf6f4;
}

.dataset-row-count,
.dataset-empty {
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.dataset-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 0;
}

.dataset-pagination span {
  color: var(--muted);
  font-size: 0.82rem;
}

.dataset-record-detail {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--text);
  font: 0.78rem/1.5 "JetBrains Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dataset-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.dataset-record-editor {
  display: block;
  width: 100%;
  min-height: 280px;
  max-height: 65vh;
  margin: 8px 0;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: 0.78rem/1.5 "JetBrains Mono", monospace;
  white-space: pre;
}

.dataset-record-editor[hidden] {
  display: none;
}

.dataset-record-editor[hidden],
.dataset-editor-actions [hidden] {
  display: none;
}

.dataset-form-editor {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  margin: 10px 0;
}

.dataset-edit-field {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

.dataset-edit-field > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dataset-edit-field input,
.dataset-edit-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: 400 0.88rem/1.4 "Inter", sans-serif;
}

.dataset-edit-field input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  justify-self: start;
}

.dataset-edit-field input:disabled {
  background: #f1f3f5;
  color: var(--muted);
}

.dataset-edit-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fbfcfd;
}

.dataset-edit-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dataset-edit-group > .dataset-edit-field {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 5px;
  border-bottom: 0;
}

.dataset-edit-complex {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  grid-column: 1 / -1;
}

.dataset-edit-complex textarea {
  min-height: 150px;
  resize: vertical;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.dataset-form-editor[hidden] {
  display: none;
}

@media (max-width: 620px) {
  .dataset-edit-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .dataset-edit-group {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .composition-lab:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }

  .dataset-sidebar {
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--stroke);
  }
}

.raag-card {
  min-width: 0;
}

.raag-record-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 7px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.raag-record-status.candidate {
  border-color: #e7c477;
  background: #fff9e8;
  color: #76520a;
}

.raag-record-status.published {
  border-color: #9bcbb9;
  background: #edf7f2;
  color: #24634d;
}

.raag-card .card-open {
  min-height: 100%;
  padding: 0;
}

.raag-card .card-open h3 {
  font-size: 1.2rem;
  letter-spacing: 0;
}

@media (max-width: 700px) {
  .raag-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 440px) {
  .raag-filter-form {
    grid-template-columns: 1fr;
  }

  .raag-filter-form button {
    width: 100%;
  }
}

.explorer-grid {
  margin-top: 22px;
}

.thaat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.thaat-card {
  display: block;
  min-width: 0;
  padding: 18px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--stroke);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.thaat-card:hover,
.thaat-card:focus-visible {
  border-color: var(--primary);
  background: #f7fafc;
}

.thaat-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.thaat-card p {
  margin: 6px 0;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.thaat-card .thaat-source-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.thaat-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 14px;
  align-items: end;
  margin-top: 16px;
}

.thaat-toolbar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.thaat-toolbar input,
.thaat-toolbar select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.thaat-toolbar .raag-status {
  grid-column: 1 / -1;
}

.thaat-toolbar .thaat-source-note {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .thaat-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .thaat-toolbar .raag-status {
    grid-column: auto;
  }

  .thaat-toolbar .thaat-source-note {
    grid-column: auto;
  }
}

.thaat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.thaat-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(29, 122, 242, 0.1);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 8px 10px;
}

.thaat-badge.purple {
  background: rgba(123, 97, 255, 0.12);
  color: #4333b5;
}

.thaat-badge.green {
  background: rgba(29, 185, 84, 0.12);
  color: #107a3f;
}

.thaat-badge.orange {
  background: rgba(255, 159, 67, 0.12);
  color: #a85c0a;
}

.thaat-badge.red {
  background: rgba(243, 95, 95, 0.1);
  color: #9f2e2e;
}

.thaat-badge.blue {
  background: rgba(29, 122, 242, 0.1);
  color: #1d5fc6;
}

.thaat-card p,
.thaat-card li,
.about-hero p,
.lesson-card p,
.check-list,
.about-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.thaat-card ul, .check-list {
  padding-left: 18px;
  margin: 12px 0 0;
}

.lesson-layout {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

.moodle-admin-tools {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.moodle-admin-tools[hidden] {
  display: none;
}

.moodle-admin-tools h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.moodle-admin-tools p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.moodle-sync-status {
  min-height: 1.4em;
  font-size: 0.88rem;
}

.moodle-admin-tools button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.lesson-sidebar {
  padding: 18px 16px;
}

.lesson-sidebar h3 {
  margin-bottom: 14px;
}

.lesson-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.lesson-sidebar li {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(18, 24, 38, 0.02);
  color: var(--muted);
  font-weight: 600;
}

.lesson-sidebar li.active {
  background: rgba(29, 122, 242, 0.09);
  color: var(--primary-dark);
}

.lesson-cards {
  display: grid;
  gap: 18px;
}

.lesson-card {
  padding: 18px 16px;
}

.moodle-sync-status,
.lesson-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lesson-topic-filter {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lesson-card h3 {
  font-size: 1.25rem;
  letter-spacing: 0;
}

.lesson-material-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.lesson-material-links a {
  overflow-wrap: anywhere;
}

.lesson-media-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin-top: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #101820;
}

.lesson-media-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-request-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.lesson-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.lesson-card h3 {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  margin-bottom: 10px;
  letter-spacing: -0.04em;
}

.practice-layout {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

.practice-panel,
.practice-sidebar {
  padding: 20px;
}

.practice-header {
  margin-bottom: 16px;
}

.play-button {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  margin: 10px auto 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--green));
  color: white;
  font-size: 2.6rem;
  box-shadow: 0 20px 40px rgba(29, 122, 242, 0.22);
}

.selected-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 24, 38, 0.02);
  color: var(--muted);
  margin-bottom: 18px;
}

.selected-scale strong {
  color: var(--text);
  font-size: 1.4rem;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scale-btn {
  min-height: 58px;
  border-radius: 16px;
  background: rgba(18, 24, 38, 0.04);
  color: var(--text);
  font-weight: 700;
}

.scale-btn.active {
  background: linear-gradient(135deg, var(--green), #2fc58b);
  color: white;
}

.control-group {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.control-group label {
  font-weight: 600;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
}

.timer-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18, 24, 38, 0.02);
}

.practice-queue {
  margin-top: 12px;
}

.practice-queue h4 {
  margin-bottom: 10px;
}

.practice-queue ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.clip-loop-section {
  margin-top: 20px;
}

.clip-loop-header h2 {
  margin-bottom: 18px;
  font-size: 1.4rem;
}

.clip-url-form,
.clip-audio-upload,
.clip-boundary {
  display: grid;
  gap: 8px;
}

.clip-url-form > label,
.clip-audio-upload > label,
.clip-boundary > label {
  color: var(--muted);
  font-weight: 600;
}

.clip-url-row,
.clip-boundary-control {
  display: flex;
  gap: 10px;
}

.clip-url-row input,
.clip-audio-upload input,
.clip-boundary-control input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.clip-privacy-note,
.clip-audio-file-name,
.clip-loop-status {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.clip-privacy-note {
  margin: 10px 0 4px;
}

.clip-audio-file-name {
  margin: 0;
  overflow-wrap: anywhere;
}

.clip-loop-status {
  min-height: 1.4em;
  margin-bottom: 0;
}

.clip-fallback-link {
  width: fit-content;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

.clip-fallback-link[hidden] {
  display: none;
}

.clip-workspace[hidden] {
  display: none;
}

.clip-workspace {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.clip-player-frame {
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #101820;
}

.clip-player-frame[hidden],
.clip-local-audio[hidden] {
  display: none;
}

.clip-local-audio {
  display: block;
  width: 100%;
  min-height: 48px;
}

#youtubePlayer,
#youtubePlayer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.clip-position {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.clip-position strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.clip-time-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.clip-boundaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.clip-boundary-control .secondary-btn {
  flex-shrink: 0;
}

.clip-workspace > .primary-btn {
  justify-self: start;
}

.clip-loop-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.card-open {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.card-open .meta-row {
  margin-top: 18px;
}

.raag-detail-sheet {
  max-height: min(720px, 88vh);
  overflow: auto;
}

.raag-description {
  color: var(--muted);
  line-height: 1.6;
}

.raag-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.raag-facts span {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(29, 122, 242, 0.08);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.raag-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.raag-detail-facts div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
}

.raag-detail-facts dt {
  margin-bottom: 4px;
  color: var(--muted-soft);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.raag-detail-facts dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.raag-detail-back {
  display: inline-flex;
  margin: 4px 0 14px;
}

.raag-detail-hero {
  display: grid;
  gap: 18px;
}

.raag-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.raag-detail-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  overflow-wrap: anywhere;
}

.raag-detail-summary {
  margin: 8px 0 0;
  color: var(--muted);
}

.raag-detail-content {
  display: grid;
  gap: 16px;
}

.raag-detail-notation {
  padding: 14px 16px;
  border-left: 3px solid var(--green);
  background: rgba(29, 185, 84, 0.06);
}

.raag-detail-notation h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.raag-detail-notation p,
.raag-detail-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.raag-admin-form {
  display: grid;
  gap: 14px;
}

.raag-detail-content[hidden],
.raag-admin-form[hidden],
.raag-detail-admin-actions [hidden] {
  display: none;
}

.raag-topic-form[hidden] {
  display: none;
}

.raag-recordings {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.raag-recordings .section-head {
  align-items: center;
}

.raag-recordings h2 {
  margin: 0;
  font-size: 1.1rem;
}

.raag-topic-form {
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
}

.raag-edit-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
}

.raag-edit-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.raag-edit-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.raag-edit-field input,
.raag-edit-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.raag-edit-field textarea {
  min-height: 68px;
  resize: vertical;
}

.raag-edit-field input[readonly] {
  background: #f2f4f7;
  color: var(--muted);
}

.raag-provenance {
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.raag-provenance summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.raag-provenance .raag-detail-facts {
  margin-top: 12px;
}

@media (max-width: 620px) {
  .raag-detail-heading {
    display: grid;
  }

  .raag-edit-group {
    grid-template-columns: minmax(0, 1fr);
  }
}

.raag-notation {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.raag-notation section {
  padding: 12px;
  border-left: 3px solid var(--green);
  background: rgba(29, 185, 84, 0.06);
}

.raag-notation h4 {
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.raag-notation p,
.raag-attribution {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.raag-attribution {
  margin: 12px 0;
  font-size: 0.82rem;
}

@media (max-width: 440px) {
  .raag-detail-facts {
    grid-template-columns: 1fr;
  }
}

.topic-list {
  display: grid;
  gap: 12px;
}

.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
}

.topic-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.topic-status {
  color: var(--muted);
  font-size: 0.85rem;
}

.composer {
  display: grid;
  gap: 18px;
  width: 100%;
  margin: 0;
}

.composer-title,
.modifier-group {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.composer-title input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface-strong);
}

.notation-output {
  min-height: 170px;
  padding: 20px;
  overflow-wrap: anywhere;
  border-radius: 16px;
  background: rgba(18, 24, 38, 0.04);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 1.5rem;
  line-height: 1.7;
}

.modifier-controls {
  display: grid;
  gap: 14px;
}

.modifier-label {
  font-size: 0.78rem;
  font-weight: 700;
}

.glass-slider {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(25, 33, 50, 0.06);
  backdrop-filter: blur(14px);
}

.glass-slider button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.glass-slider button.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
  box-shadow: 0 5px 12px rgba(25, 33, 50, 0.1);
}

.swara-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.swara-grid button,
.structure-row button {
  aspect-ratio: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.structure-row {
  justify-content: center;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.structure-row button {
  width: 44px;
  min-height: 40px;
  border-radius: 10px;
  background: rgba(18, 24, 38, 0.08);
  color: var(--text);
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

 .print-document {
  display: none;
}

@media print {
  body * { visibility: hidden; }
  .print-document,
  .print-document * { visibility: visible; }
  .print-document {
    display: block;
    position: absolute;
    inset: 0;
    padding: 48px;
    color: #000;
    background: #fff;
  }

  .print-document h1 {
    margin-bottom: 32px;
    font-size: 28px;
  }

  .print-document div {
    white-space: pre-wrap;
    font-family: "JetBrains Mono", monospace;
    font-size: 20px;
    line-height: 1.8;
  }
}

.about-hero {
  margin-top: 12px;
}

.auth-button {
  display: inline-flex;
}

.hide-mobile {
  display: inline-flex;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-only {
  display: none;
}

.admin-only.visible {
  display: inline-flex;
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: end center;
  z-index: 120;
  padding: 16px 12px calc(82px + env(safe-area-inset-bottom));
}

.auth-sheet {
  width: min(100%, 430px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 28px 28px 20px 20px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.3);
  padding: 18px 16px 16px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.auth-header h3 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.close-auth {
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(18, 24, 38, 0.06);
  font-size: 1rem;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.google-sign-in {
  width: 100%;
  min-height: 48px;
  margin: 4px 0 0;
  background: #fff;
  border: 1px solid var(--stroke);
}

.auth-divider {
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.76rem;
  text-align: center;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(18, 24, 38, 0.02);
  border-radius: 12px;
  padding: 14px 12px;
  font: inherit;
}

.auth-password-field {
  position: relative;
  display: flex;
}

.auth-password-field input {
  padding-right: 64px;
}

.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px;
}

.auth-submit {
  margin-top: 6px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-error {
  margin: 0;
  color: #b42318;
  font-size: 0.75rem;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-toggle,
.auth-forgot {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
}

.profile-menu {
  z-index: 130;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.profile-menu-email {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-menu-email-value {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  word-break: break-all;
}

.profile-menu-status {
  margin: 0 0 8px;
  color: #b42318;
  font-size: 0.76rem;
  line-height: 1.45;
}

.profile-google-link {
  margin-bottom: 8px;
}

.profile-logout {
  background: transparent;
  border: none;
  padding: 0;
  color: #b42318;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: left;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: var(--container);
  margin: 0 auto 32px;
  padding: 24px 20px 0;
  color: var(--muted);
  border-top: 1px solid var(--stroke);
  font-size: 0.9rem;
}

.site-footer div,
.site-footer nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer > div {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.home-time-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.home-prahar-title {
  color: var(--muted);
  font-size: 0.76em;
  font-weight: 600;
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 8px 10px;
  border-radius: 24px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bottom-item {
  flex: 1 1 0;
  min-width: 0;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.bottom-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bottom-item span {
  transform: translateY(1px);
}

@media (min-width: 700px) {
  .main-nav {
    display: flex;
  }

  .auth-button {
    display: inline-flex;
  }

  .nav-toggle {
    display: none;
  }

  .hero {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    padding: 28px 28px 22px;
  }

  .two-up,
  .about-grid,
  .lesson-layout,
  .practice-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-up,
  .thaat-grid,
  .concept-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-grid {
    display: grid;
  }

  .hide-mobile {
    display: inline-flex;
  }

  .site-footer {
    flex-direction: row;
  }
}

@media (min-width: 980px) {
  .lesson-layout {
    grid-template-columns: 260px 1fr;
  }

  .lesson-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .practice-layout {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

@media (max-width: 699px) {
  .topbar {
    position: sticky;
  }

  .main-nav {
    position: absolute;
    top: 68px;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .brand-copy {
    display: none;
  }

  .composer {
    gap: 12px;
    padding: 14px 12px;
  }

  .notation-output {
    min-height: 104px;
    padding: 14px;
    font-size: 1.1rem;
  }

  .modifier-controls {
    gap: 8px;
  }

  .glass-slider button {
    min-height: 36px;
    font-size: 0.7rem;
  }

  .swara-grid {
    grid-template-columns: repeat(4, 64px);
    justify-content: center;
    gap: 8px;
  }

  .structure-row {
    gap: 8px;
  }

  .structure-row button {
    width: 36px;
    min-height: 36px;
  }

  .composer-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .clip-url-row,
  .clip-boundary-control {
    flex-direction: column;
  }

  .clip-boundaries {
    grid-template-columns: 1fr;
  }

  .clip-workspace > .primary-btn {
    width: 100%;
  }
}

@media (max-width: 699px) and (max-height: 740px) {
  .page-shell {
    padding-top: 10px;
  }

  .composer {
    gap: 8px;
    padding: 10px;
  }

  .notation-output {
    min-height: 76px;
    padding: 10px;
  }

  .swara-grid {
    grid-template-columns: repeat(4, 56px);
    gap: 6px;
  }

  .structure-row {
    gap: 6px;
  }

  .structure-row button {
    width: 32px;
    min-height: 32px;
  }
}
