:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #5c6862;
  --line: #d8ded9;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #b91c1c;
  --good: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
}

.shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: 24px;
  align-items: end;
  padding: 24px 0 32px;
}

.login-screen {
  min-height: calc(100svh - 36px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.topbar p,
.panel p {
  color: var(--muted);
}

.login-card,
.panel,
.practice-surface,
.lesson-list button,
.analysis,
.live-compare {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.login-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-hint.error {
  color: var(--danger);
  font-weight: 700;
}

.public-directory-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 800;
}

.app-panel {
  min-height: calc(100svh - 36px);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  background: #e8ece8;
  border-radius: 8px;
}

.segmented button {
  color: var(--ink);
  background: transparent;
}

.segmented button.active {
  color: #fff;
  background: var(--accent-2);
}

.segmented.small {
  width: 180px;
  margin-bottom: 0;
}

.segmented.small button {
  min-height: 34px;
}

.teacher-tabs {
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(680px, 100%);
  margin-bottom: 16px;
  padding: 4px;
  background: #e8ece8;
  border-radius: 8px;
}

.student-mobile-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8ece8;
}

.student-mobile-nav button {
  min-height: 46px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
}

.student-mobile-nav button.active {
  color: #fff;
  background: var(--accent);
}

.teacher-tabs,
.segmented.small {
  position: sticky;
  top: 0;
  z-index: 3;
}

.teacher-tabs button {
  color: var(--ink);
  background: transparent;
}

.teacher-tabs button.active {
  color: #fff;
  background: var(--accent);
}

#loginForm,
.lesson-form,
.student-form {
  display: grid;
  gap: 10px;
}

.labeled-field {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.labeled-field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-status {
  min-height: 1.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-status.error {
  color: #b91c1c;
  font-weight: 700;
}

.lesson-library {
  display: grid;
  gap: 14px;
}

.lesson-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px;
  gap: 10px;
}

.lesson-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lesson-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
}

.lesson-table th,
.lesson-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

.lesson-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3ef;
  color: var(--ink);
}

.lesson-table tr:last-child td {
  border-bottom: 0;
}

.lesson-table audio {
  width: 190px;
}

.notation-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.lesson-share-checkbox,
.share-student-row input {
  width: 18px;
  height: 18px;
  min-height: auto;
}

.share-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 -8px 20px rgba(23, 33, 29, 0.08);
}

.share-bar > div {
  display: inline-flex;
  gap: 8px;
}

.lesson-share-page {
  display: grid;
  gap: 12px;
}

.share-student-list {
  display: grid;
  gap: 8px;
}

.share-student-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.share-student-row span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.app-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ghost-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--accent);
  background: #eef3ef;
  border: 1px solid var(--line);
}

.subhead {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.practice-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.teacher-dashboard {
  display: grid;
  gap: 14px;
}

.teacher-tab-panel {
  margin-top: 4px;
}

.lesson-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.lesson-plan-head h3 {
  margin: 0;
}

.profile-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.profile-save-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.teacher-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profile-icon {
  display: inline-grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-weight: 800;
}

.profile-form,
.profile-media-form {
  display: grid;
  gap: 10px;
}

.signup-form,
.contact-verification {
  display: grid;
  gap: 10px;
}

.contact-verification {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.contact-verification p {
  margin: 0;
}

.profile-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-form textarea {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.profile-form textarea,
.publish-toggle {
  grid-column: 1 / -1;
}

.publish-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.publish-toggle input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.profile-view {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-summary-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.profile-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.profile-summary-head strong,
.profile-summary-head span {
  display: block;
}

.profile-summary-head span,
.profile-detail-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-detail-grid div,
.profile-view section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profile-detail-grid strong {
  display: block;
  margin-top: 4px;
}

.profile-view h4 {
  margin: 0 0 6px;
}

.profile-view p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.profile-media-form {
  grid-template-columns: 220px 1fr auto;
  margin: 18px 0;
}

.profile-media-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  font: inherit;
}

.profile-media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.profile-media-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.profile-media-item img,
.profile-media-item video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.profile-media-item span,
.public-profile-link {
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-hero,
.preview-grid section,
.preview-split section,
.demo-script {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.preview-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 14px;
}

.preview-hero h3,
.preview-grid h4,
.preview-split h4,
.demo-script h4 {
  margin-top: 0;
}

.preview-hero p,
.preview-grid p,
.preview-split p,
.mock-public-profile span {
  color: var(--muted);
}

.preview-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.architecture-flow div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.architecture-flow span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.preview-grid section,
.preview-split section,
.demo-script {
  padding: 14px;
}

.preview-grid ul,
.demo-script ol {
  padding-left: 20px;
  margin-bottom: 0;
}

.preview-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.mock-public-profile,
.mock-post {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mock-public-profile > div:last-child,
.mock-post {
  display: grid;
  gap: 4px;
}

.mock-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-weight: 900;
}

.roadmap-list {
  display: grid;
  gap: 8px;
}

.roadmap-list span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.demo-script {
  margin-top: 14px;
}

.student-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.community-action-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.community-panel-head,
.community-head-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.community-panel-head h4 {
  margin: 0;
}

.community-group-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) auto;
  gap: 10px;
}

.community-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.community-layout aside,
.community-feed-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.community-layout h4 {
  margin: 0 0 10px;
}

.community-groups {
  display: grid;
  gap: 8px;
}

.community-groups button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
}

.community-groups button.active {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 118, 110, 0.15);
}

.community-groups span,
.community-head p,
.community-post-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.community-head,
.community-post-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.admin-badge {
  padding: 4px 8px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: 0.82rem;
  font-weight: 800;
}

.community-post-form {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.community-post-form textarea {
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
}

.community-feed {
  display: grid;
  gap: 12px;
}

.community-post {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.community-post p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.community-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.community-media img,
.community-media video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.payment-account-details,
.payment-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.payment-account-details summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.payment-account-details summary strong {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.payment-account-view {
  margin: 12px 0;
}

.payment-section {
  margin-top: 14px;
}

.payment-form,
.student-payment-form,
.payment-list {
  display: grid;
  gap: 10px;
}

.payment-form textarea {
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  resize: vertical;
}

.payment-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-card span,
.payment-card a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.pay-now-link {
  width: fit-content;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #fff !important;
  background: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.payment-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.payment-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: capitalize;
}

.payment-status.paid {
  background: #dcfce7;
  color: #166534;
}

.payment-status.submitted {
  background: #dbeafe;
  color: #1d4ed8;
}

.student-payment-form {
  grid-column: 1 / -1;
  grid-template-columns: 180px 1fr 1fr auto;
}

.roster-toolbar,
.roster-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.roster-toolbar h3,
.roster-group-head h4 {
  margin: 0;
}

.roster-board {
  display: grid;
  gap: 12px;
}

.roster-group {
  overflow: hidden;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.roster-group-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.roster-group-head span,
.roster-row span,
.last-score {
  color: var(--muted);
  font-size: 0.88rem;
}

.roster-list {
  display: grid;
}

.roster-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.4fr) auto 130px 70px auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.roster-row:last-child {
  border-bottom: 0;
}

.roster-row > div:first-child,
.student-meta {
  display: grid;
  gap: 2px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 14px);
  gap: 4px;
}

.heatmap i {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3px;
}

.heatmap i.active {
  background: #16a34a;
}

.heatmap i.inactive {
  background: #ef4444;
}

.roster-actions {
  position: relative;
  justify-self: end;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--accent);
  background: #eef3ef;
  border: 1px solid var(--line);
  font-weight: 900;
  line-height: 1;
}

.student-action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
  min-width: 142px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.16);
}

.student-action-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  border: 0;
  border-radius: 6px;
}

.student-action-menu button:hover {
  background: #eef3ef;
}

.roster-status {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
}

.roster-status.active {
  background: #dcfce7;
  color: #166534;
}

.roster-status.needs-attention {
  background: #fef3c7;
  color: #92400e;
}

.lesson-list {
  display: grid;
  gap: 8px;
}

.lesson-list button {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.lesson-list button.active {
  border-color: var(--accent);
  outline: 2px solid rgba(15, 118, 110, 0.15);
}

.practice-surface {
  min-height: 480px;
  padding: 18px;
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--muted);
}

.lesson-title-row {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

audio {
  width: 100%;
}

.notation-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notation-panel h4 {
  margin: 0;
}

.notation-panel img {
  display: block;
  width: min(100%, 720px);
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.calibration {
  display: grid;
  grid-template-columns: 160px 1fr minmax(180px, auto);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dial {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border: 8px solid #d9e8e4;
  border-radius: 50%;
}

.dial span {
  font-size: 1.15rem;
  font-weight: 700;
}

.dial strong {
  color: var(--muted);
  font-size: 0.85rem;
}

.meter {
  height: 18px;
  overflow: hidden;
  background: #e8ece8;
  border-radius: 999px;
}

#stabilityBar {
  width: 0;
  height: 100%;
  background: var(--good);
  transition: width 120ms linear;
}

.calibration-actions {
  display: grid;
  gap: 8px;
}

#startTanpura {
  color: var(--ink);
  background: #eef3ef;
  border: 1px solid var(--line);
}

#startTanpura.active {
  color: #fff;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.recorder {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 18px 0;
}

.recording-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.recording-group span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.recording-option {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.recording-option input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

#stopRecording {
  background: var(--danger);
}

.live-compare {
  padding: 14px;
  margin-bottom: 18px;
  position: relative;
}

.compare-head,
.compare-readout,
.legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.compare-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.compare-head h3 {
  margin-bottom: 0;
}

.legend span,
.compare-readout span {
  color: var(--muted);
  font-size: 0.9rem;
}

.legend i {
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 999px;
}

.teacher-line {
  background: var(--accent-2);
}

.student-line {
  background: var(--accent);
}

.deviation-line {
  background: var(--danger);
}

#pitchCanvas {
  width: 100%;
  height: 280px;
  display: block;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.countdown-overlay {
  position: absolute;
  inset: 58px 14px 70px;
  display: grid;
  place-items: center;
  z-index: 2;
  color: #fff;
  background: rgba(23, 33, 29, 0.72);
  border-radius: 6px;
  font-size: clamp(3rem, 14vw, 8rem);
  font-weight: 800;
}

.deviation-log {
  margin-top: 12px;
}

.deviation-log h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

#deviationList {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.deviation-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.deviation-item.active {
  border-color: var(--danger);
  background: #fff5f5;
}

.analysis {
  padding: 16px;
}

.score {
  display: inline-grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #d9e8e4;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.clip-list {
  display: grid;
  gap: 12px;
  margin: 10px 0 18px;
}

.clip-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.clip-pair > div {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.clip-pair span {
  color: var(--muted);
  font-size: 0.9rem;
}

.clip-pair audio {
  width: 100%;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .login-screen {
    padding: 22px 14px;
    align-content: center;
    min-height: 100svh;
  }

  .app-panel,
  .panel {
    border: 0;
    border-radius: 0;
    margin-bottom: 0;
    padding: 14px;
  }

  .topbar,
  .practice-grid,
  .lesson-title-row,
  .calibration,
  .clip-pair,
  .student-form,
  .payment-card,
  .student-payment-form,
  .community-group-form,
  .community-layout,
  .lesson-filters,
  .labeled-field,
  .form-actions,
  .profile-save-actions,
  .roster-row,
  .profile-form,
  .profile-detail-grid,
  .profile-media-form,
  .architecture-flow,
  .preview-grid,
  .preview-split {
    grid-template-columns: 1fr;
  }

  .preview-hero {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 2.75rem;
  }

  .topbar p {
    font-size: 1rem;
  }

  .panel-head {
    align-items: flex-start;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px 0;
    background: var(--surface);
  }

  .teacher-identity {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .teacher-identity #teacherName,
  #studentName {
    display: none;
  }

  .teacher-tabs {
    width: 100%;
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(112px, 1fr));
  }

  #teacherPanel {
    padding-bottom: 86px;
  }

  #teacherPanel .teacher-tabs {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    top: auto;
    z-index: 20;
    margin-bottom: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(23, 33, 29, 0.16);
  }

  #studentPanel {
    padding-bottom: 86px;
  }

  .student-mobile-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 20;
    margin-bottom: 0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(23, 33, 29, 0.16);
  }

  .student-mobile-nav button {
    min-height: 52px;
    font-size: 0.92rem;
  }

  .teacher-tabs button {
    padding: 0 10px;
  }

  .roster-toolbar {
    display: grid;
    gap: 10px;
  }

  .lesson-plan-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-actions {
    width: 100%;
    justify-content: space-between;
  }

  .community-head,
  .community-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented.small {
    width: 100%;
  }

  .recording-group,
  .recorder,
  .compare-head,
  .compare-readout {
    align-items: stretch;
    display: grid;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dial {
    width: 120px;
    height: 120px;
  }
}
