:root {
  --bg: #080b1f;
  --panel: rgba(31, 35, 61, 0.78);
  --panel-strong: rgba(43, 47, 79, 0.9);
  --line: rgba(141, 132, 255, 0.38);
  --text: #f7f7ff;
  --muted: #aeb2c9;
  --purple: #6c5ce7;
  --cyan: #5cd8ff;
  --yellow: #ffd93d;
  --red: #ff4d5e;
  --green: #4ade80;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(108, 92, 231, 0.28), transparent 28rem),
    radial-gradient(circle at 80% 18%, rgba(255, 217, 61, 0.12), transparent 24rem),
    linear-gradient(135deg, #050718, #11142c 52%, #06091c);
  color: var(--text);
}

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

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0 22px;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 800;
  white-space: nowrap;
}

.brand strong {
  color: var(--purple);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: conic-gradient(from 210deg, var(--cyan), var(--purple), #d946ef, var(--cyan));
  box-shadow: 0 0 28px rgba(108, 92, 231, 0.55);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav a,
.status-pill,
.secondary,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text);
}

.nav a {
  padding: 10px 14px;
  color: var(--muted);
}

.nav a.active {
  color: var(--text);
  border-color: rgba(255, 217, 61, 0.68);
}

.status-pill {
  padding: 10px 12px;
  color: var(--yellow);
  min-width: 92px;
  text-align: center;
}

.language-control select {
  min-height: 40px;
  max-width: 132px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.account-chip span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #17120a;
  background: var(--yellow);
  font-weight: 900;
}

.account-chip strong {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-title {
  margin: 26px 0 26px;
}

.section-title.compact {
  margin-bottom: 14px;
}

.section-title p {
  margin: 0 0 8px;
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: 0;
}

.section-title h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.06;
  letter-spacing: 0;
}

.grid.two,
.exam-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.panel,
.stage-card,
.timeline-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(160deg, var(--panel), rgba(12, 15, 36, 0.72));
  box-shadow: 0 0 34px rgba(108, 92, 231, 0.18);
}

.panel,
.stage-card {
  padding: 26px;
}

.panel h2,
.stage-card h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.stack {
  display: grid;
  gap: 18px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  cursor: pointer;
}

.dropzone input {
  display: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  font-size: 46px;
  font-weight: 900;
}

small,
.dropzone small,
label {
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 8px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

.primary,
.secondary,
.icon-button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  color: #17120a;
  background: linear-gradient(135deg, var(--yellow), #fff176);
  box-shadow: 0 0 22px rgba(255, 217, 61, 0.32);
}

.secondary,
.icon-button {
  border: 1px solid var(--line);
}

.analysis-panel video,
.video-stage video {
  width: 100%;
  background: #000;
  border-radius: 8px;
}

.analysis-panel video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.progress {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.bar {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar i,
.bars i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--yellow));
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.metric-row div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.metric-row strong {
  display: block;
  font-size: 24px;
}

.metric-row span {
  color: var(--muted);
}

.table-head,
.course-row {
  display: grid;
  grid-template-columns: 110px 1.5fr 0.6fr 0.8fr 1fr;
  gap: 18px;
  align-items: center;
}

.table-head {
  color: var(--muted);
  padding: 0 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.course-row {
  padding: 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.thumb {
  width: 96px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(92, 216, 255, 0.6), rgba(108, 92, 231, 0.65));
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  color: #151515;
  background: var(--yellow);
  font-weight: 800;
}

.badge.muted {
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions button {
  min-height: 36px;
}

.assessment-toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.assessment-toolbar label {
  min-width: 260px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0 !important;
  padding-bottom: 9px;
}

.switch input {
  width: 20px;
  min-height: 20px;
}

.stage-card {
  padding: 18px;
}

.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.stage-heading h2 {
  margin: 0;
}

.reference-mode-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.reference-mode-switch button {
  min-height: 32px;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.reference-mode-switch button.active {
  background: var(--cyan);
  color: #08101f;
  box-shadow: 0 0 16px rgba(92, 216, 255, 0.3);
}

.reference-mode-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.video-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.video-stage video,
.video-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-stage canvas {
  pointer-events: none;
}

.video-stage .reference-source-hidden {
  visibility: hidden;
  pointer-events: none;
}

.avatar-teacher {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #080b1c;
  contain: strict;
}

.avatar-teacher.hidden {
  display: none;
}

.avatar-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.avatar-mode-status {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 12px;
  display: none;
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border: 1px solid rgba(92, 216, 255, 0.42);
  border-radius: 999px;
  background: rgba(8, 11, 28, 0.84);
  color: var(--muted);
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.avatar-mode-status.visible {
  display: block;
}

.score-bubble {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: var(--yellow);
  color: #302600;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 0 26px rgba(255, 217, 61, 0.42);
}

.rhythm-live {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  gap: 5px;
  width: min(230px, calc(100% - 120px));
  padding: 10px 12px;
  border: 1px solid rgba(92, 216, 255, 0.55);
  border-radius: 8px;
  background: rgba(10, 12, 28, 0.82);
  backdrop-filter: blur(8px);
}

.rhythm-live > span {
  color: var(--muted);
  font-size: 12px;
}

.rhythm-judgment {
  color: var(--cyan);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rhythm-judgment.good,
.rhythm-judgment.ok {
  color: var(--yellow);
}

.rhythm-judgment.miss {
  color: var(--red);
}

.rhythm-judgment.waiting {
  color: var(--muted);
}

.rhythm-score-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.rhythm-score-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--cyan));
  transition: width 180ms ease;
}

.feedback-stack {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  max-width: min(340px, calc(100% - 32px));
}

.feedback-stack div {
  padding: 10px 12px;
  border: 1px solid rgba(255, 217, 61, 0.8);
  border-radius: 8px;
  background: rgba(16, 18, 34, 0.72);
  color: var(--text);
}

.timeline-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
}

.score-timeline {
  display: flex;
  align-items: end;
  gap: 5px;
  width: 100%;
  height: 82px;
}

.assessment-timelines {
  display: grid;
  gap: 12px;
  width: 100%;
}

.beat-track-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.beat-timeline {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.beat-marker {
  position: absolute;
  top: 4px;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  transform: translateX(-50%);
}

.beat-marker.perfect {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(92, 216, 255, 0.7);
}

.beat-marker.good,
.beat-marker.ok {
  background: var(--yellow);
}

.beat-marker.miss {
  width: 5px;
  background: var(--red);
}

.beat-playhead {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 30px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  transform: translateX(-50%);
}

.beat-unavailable {
  display: block;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11px;
}

.score-timeline i {
  flex: 1;
  min-width: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.score-timeline i.good {
  background: var(--cyan);
}

.score-timeline i.mid {
  background: var(--yellow);
}

.score-timeline i.bad {
  background: var(--red);
}

.result-grid {
  grid-template-columns: 0.8fr 1.2fr;
}

.wide {
  grid-column: 1 / -1;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 260px;
  height: 260px;
  margin: 10px auto;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(10, 12, 28, 1) 51%, transparent 52%),
    conic-gradient(var(--yellow), var(--purple), var(--cyan), var(--yellow));
}

.score-ring span {
  font-size: 72px;
  font-weight: 900;
}

.score-ring small {
  margin-top: -64px;
  font-size: 32px;
  color: var(--yellow);
  font-weight: 900;
}

.bars {
  display: grid;
  gap: 18px;
}

.bars label {
  grid-template-columns: 130px 1fr 54px;
  align-items: center;
}

.bars i {
  height: 14px;
  background: linear-gradient(90deg, var(--purple), var(--yellow));
}

.teacher-feedback {
  min-height: 140px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  line-height: 1.8;
}

.rhythm-distribution {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.rhythm-distribution-item {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.rhythm-distribution-item strong {
  font-size: 30px;
}

.rhythm-distribution-item.perfect strong {
  color: var(--cyan);
}

.rhythm-distribution-item.good strong,
.rhythm-distribution-item.ok strong {
  color: var(--yellow);
}

.rhythm-distribution-item.miss strong {
  color: var(--red);
}

.rhythm-mistakes {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  color: var(--muted);
}

.auth-view {
  max-width: 1040px;
  margin: 0 auto;
}

.auth-grid,
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.auth-card {
  align-self: start;
}

.single-auth-card {
  width: min(560px, 100%);
  margin: 0 auto;
}

.auth-card > p,
.panel-heading-row p,
.profile-summary p {
  color: var(--muted);
  line-height: 1.6;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: var(--cyan);
}

.social-card {
  display: grid;
  gap: 14px;
}

.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.oauth-button.google {
  color: #252525;
  background: #fff;
}

.oauth-button.apple {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: #000;
}

.oauth-button.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.form-message {
  min-height: 24px;
  margin-top: 14px;
  color: var(--green);
  line-height: 1.5;
}

.form-message.error {
  color: #ff8f9a;
}

.account-grid {
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
}

.profile-summary {
  text-align: center;
}

.profile-summary .avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 999px;
  color: #17120a;
  background: linear-gradient(135deg, var(--yellow), var(--cyan));
  font-size: 40px;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(92, 216, 255, 0.28);
}

.panel-heading-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading-row h2,
.panel-heading-row p {
  margin-top: 0;
}

.session-list {
  display: grid;
  gap: 10px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.session-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.session-row small {
  max-width: 680px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  align-items: center;
  gap: 40px;
  min-height: 430px;
  margin-top: 24px;
  overflow: hidden;
}

.hero h1 {
  max-width: 760px;
  margin: 22px 0 16px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.04;
}

.hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-visual {
  display: grid;
  place-items: center;
  min-height: 310px;
  border-radius: 28px;
  background:
    radial-gradient(circle, rgba(255, 217, 61, 0.28), transparent 48%),
    conic-gradient(from 210deg, rgba(92, 216, 255, 0.3), rgba(108, 92, 231, 0.8), rgba(217, 70, 239, 0.36));
  transform: rotate(3deg);
}

.hero-visual span {
  font-size: 96px;
  font-weight: 900;
  text-shadow: 0 0 38px rgba(92, 216, 255, 0.8);
}

.filter-panel {
  margin-bottom: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.catalog-summary {
  min-height: 28px;
  color: var(--muted);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.course-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: var(--panel);
  transition: transform 160ms ease, border-color 160ms ease;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
}

.course-cover {
  position: relative;
  min-height: 190px;
  background: linear-gradient(135deg, rgba(92, 216, 255, 0.45), rgba(108, 92, 231, 0.82));
  background-position: center;
  background-size: cover;
}

.course-cover .badge {
  position: absolute;
  top: 14px;
  right: 14px;
}

.course-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.course-card h3 {
  margin: 0;
  font-size: 21px;
}

.course-meta,
.course-stats,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 14px;
}

.tag-list span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.course-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
}

.course-price {
  color: var(--yellow);
  font-size: 20px;
  font-weight: 900;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.back-link {
  display: inline-block;
  margin: 22px 0 14px;
  color: var(--cyan);
}

.course-detail-layout,
.learning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 20px;
}

.detail-main,
.detail-sidebar,
.learning-main,
.learning-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}

.preview-player,
.learning-player {
  width: 100%;
  border-radius: 14px;
  background: #03040b;
  aspect-ratio: 16 / 9;
}

.detail-hero h1,
.learning-layout h1 {
  margin: 8px 0;
  font-size: clamp(30px, 4vw, 52px);
}

.objective-list,
.action-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.objective-list li,
.action-item {
  padding: 13px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

.action-item.active {
  border-color: rgba(92, 216, 255, 0.72);
  background: rgba(92, 216, 255, 0.13);
}

.action-item.complete {
  background: rgba(66, 211, 146, 0.13);
}

.action-item.complete small {
  color: #42d392;
}

.purchase-panel {
  position: sticky;
  top: 110px;
}

.purchase-panel .primary,
.purchase-panel .secondary {
  width: 100%;
  margin-top: 10px;
}

.progress-control input {
  width: 100%;
}

.progress-value {
  color: var(--yellow);
  font-size: 28px;
  font-weight: 900;
}

.readonly-progress {
  margin: 10px 0;
}

.sync-status {
  color: var(--muted);
  font-size: 13px;
}

.sync-status.error {
  color: #ff7a90;
}

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

.certificate-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(4, 7, 24, 0.34);
}

.certificate-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 1.414 / 1;
  object-fit: cover;
  background: #111735;
}

.certificate-card-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.certificate-card-body p {
  margin: 0;
  color: var(--muted);
}

.certificate-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.certificate-card-heading h2 {
  margin: 12px 0 0;
}

.certificate-grade {
  color: var(--yellow);
  font-size: 38px;
}

.certificate-valid {
  color: #062a17;
  background: var(--green);
}

.certificate-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.certificate-actions .text-link {
  color: var(--cyan);
  font-weight: 700;
}

.certificate-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.certificate-result.earned {
  border-color: rgba(74, 222, 128, 0.72);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.14), rgba(31, 35, 61, 0.9));
}

.certificate-result h2,
.certificate-result p {
  margin: 10px 0 0;
}

.certificate-result p {
  color: var(--muted);
}

.verify-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 150px);
  padding: 30px 0 70px;
}

.verification-card {
  width: min(720px, 100%);
  text-align: center;
}

.verification-card.verification-valid {
  border-color: rgba(74, 222, 128, 0.72);
}

.verification-card.verification-invalid {
  border-color: rgba(255, 77, 94, 0.65);
}

.verification-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 999px;
  color: #06140c;
  background: var(--green);
  font-size: 42px;
  font-weight: 900;
}

.verification-invalid .verification-icon {
  color: white;
  background: var(--red);
}

.verification-eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.verification-card h1 {
  margin: 12px 0 28px;
  font-size: clamp(30px, 6vw, 52px);
}

.verification-card > code {
  display: block;
  margin: 22px auto;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.verification-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 1px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
  text-align: left;
}

.verification-details div {
  padding: 15px 17px;
  background: #181c3a;
}

.verification-details dt {
  color: var(--muted);
  font-size: 13px;
}

.verification-details dd {
  margin: 5px 0 0;
  font-weight: 800;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    margin-left: 0;
  }

  .grid.two,
  .exam-grid,
  .result-grid,
  .form-grid,
  .auth-grid,
  .account-grid,
  .hero,
  .course-detail-layout,
  .learning-layout {
    grid-template-columns: 1fr;
  }

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

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

  .certificate-result {
    align-items: stretch;
    flex-direction: column;
  }

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

  .purchase-panel {
    position: static;
  }

  .auth-controls {
    position: absolute;
    top: 14px;
    right: 0;
  }

  .language-control {
    align-self: flex-start;
  }

  .account-chip strong {
    display: none;
  }

  .table-head {
    display: none;
  }

  .course-row {
    grid-template-columns: 86px 1fr;
  }

  .course-row > :nth-child(n + 3) {
    grid-column: 2;
  }

  .thumb {
    width: 76px;
    height: 54px;
  }

  .assessment-toolbar label {
    width: 100%;
  }

  .metric-row,
  .rhythm-distribution {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-heading-row,
  .session-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .catalog-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-visual {
    min-height: 190px;
  }

  .course-cover {
    min-height: 165px;
  }

  .timeline-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .assessment-timelines {
    flex-basis: 100%;
    order: 3;
  }

  .stage-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .reference-mode-switch {
    width: 100%;
  }

  .reference-mode-switch button {
    flex: 1;
  }

  .score-bubble {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }

  .rhythm-live {
    width: calc(100% - 100px);
  }

  .bars label {
    grid-template-columns: 105px 1fr 42px;
  }

  .verification-details {
    grid-template-columns: 1fr;
  }

  .certificate-actions .primary,
  .certificate-actions .secondary {
    width: 100%;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  .video-stage {
    aspect-ratio: 4 / 3;
  }
}
