:root {
  --bg-main: #dce4f0;
  --bg-elev: #f4f7fc;
  --bg-elev-strong: #e8eef7;
  --line-soft: #b9c6da;
  --line-strong: #788cad;
  --text-main: #1a2436;
  --text-muted: #4f5d78;
  --accent-cyan: #5c8fbd;
  --accent-mint: #5f9f8a;
  --shadow-soft: 0 12px 26px rgba(34, 43, 63, 0.12);
}

[data-palette="ocean"] {
  --bg-main: #d8e4ed;
  --bg-elev: #f3f8fb;
  --bg-elev-strong: #e9f1f7;
  --line-soft: #bdd0dc;
  --line-strong: #7ca0b8;
  --text-main: #1f2f3a;
  --text-muted: #58707f;
  --accent-cyan: #4f8eb0;
  --accent-mint: #5f9f8a;
  --shadow-soft: 0 12px 26px rgba(29, 45, 56, 0.12);
}

[data-theme="dark"] {
  --bg-main: #121925;
  --bg-elev: #1a2333;
  --bg-elev-strong: #202b3f;
  --line-soft: #3b4a66;
  --line-strong: #60779d;
  --text-main: #edf3ff;
  --text-muted: #c2cee4;
  --accent-cyan: #7ea2d6;
  --accent-mint: #7db4a4;
  --shadow-soft: 0 14px 28px rgba(2, 6, 14, 0.45);
}

[data-theme="dark"][data-palette="ocean"] {
  --bg-main: #142026;
  --bg-elev: #1b2a33;
  --bg-elev-strong: #20333e;
  --line-soft: #36505e;
  --line-strong: #4f7284;
  --text-main: #e4edf2;
  --text-muted: #a6bbc7;
  --accent-cyan: #7aa5be;
  --accent-mint: #7eb5a0;
  --shadow-soft: 0 14px 28px rgba(4, 10, 12, 0.46);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1000px 420px at 15% -10%, rgba(123, 139, 171, 0.24) 0%, rgba(227, 233, 242, 0) 70%),
    radial-gradient(900px 380px at 85% -15%, rgba(118, 151, 165, 0.2) 0%, rgba(227, 233, 242, 0) 72%),
    var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

.topbar {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(6px);
  background: rgba(229, 237, 252, 0.9);
  min-width: 0;
  overflow: visible;
}

.topbar-brand-link {
  text-decoration: none;
  color: inherit;
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

.topbar-brand-link:hover h1 {
  text-decoration: underline;
}

@keyframes topbarBrandGlowShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.topbar h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #253149;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.topbar p {
  color: #445472;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: visible;
  flex: 0 0 auto;
}

.auth-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 0.35rem;
  min-width: 0;
  overflow: visible;
}

.auth-user-chip {
  border: 1px solid #b4c2d8;
  background: rgba(233, 239, 248, 0.85);
  color: #334462;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.1;
  box-shadow: none;
  cursor: default;
}

.auth-user-chip-link {
  text-decoration: none;
  border-color: #7d95bd;
  background: rgba(217, 228, 245, 0.96);
  color: #203454;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  min-height: 38px;
  font-size: 0.86rem;
}

.auth-user-chip-link:hover {
  border-color: #6886b8;
  background: rgba(227, 237, 251, 1);
}

.auth-user-chip-link.is-active {
  border-color: #79a2d4;
  background: linear-gradient(180deg, #5a7fb8 0%, #476798 100%);
  color: #f2f7ff;
}

.auth-link-btn {
  text-decoration: none;
  border: 1px solid #8094b4;
  background: #edf3fb;
  color: #24324d;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.86rem;
  line-height: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(34, 43, 63, 0.1);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-link-btn:hover {
  border-color: #6982a8;
  background: #f6f9ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(34, 43, 63, 0.14);
}

.auth-link-btn[data-nav]::before {
  display: none;
}

.auth-link-btn[data-nav="billing"]::before {
  content: "◆";
}

.auth-link-btn[data-nav="profile"]::before {
  content: "●";
}

.auth-link-btn[data-nav="feedback"]::before {
  content: "◉";
}

.auth-link-btn[data-nav="admin"]::before {
  content: "◈";
}

.auth-link-btn[data-nav="login"]::before {
  content: "→";
}

.auth-link-btn[data-nav="register"]::before {
  content: "+";
}

.auth-link-btn.is-active {
  border-color: #6f8bbd;
  background: linear-gradient(180deg, #5a769f 0%, #435d83 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 9px 18px rgba(31, 49, 87, 0.22);
  color: #f6f9ff;
}

.auth-link-btn-highlight {
  border-color: #7ca6b5;
  background: linear-gradient(180deg, #5c8f97 0%, #486f76 100%);
  color: #f4f9ff;
}

.auth-link-btn-highlight:hover {
  border-color: #93bac4;
  background: linear-gradient(180deg, #6a9ea5 0%, #537d83 100%);
}

.back-home-btn {
  position: relative;
}

.back-home-btn::before {
  content: "";
  margin-right: 0;
  display: none;
}

.back-home-btn.is-home {
  border-color: #87abb8;
  background: linear-gradient(180deg, rgba(88, 124, 132, 0.98) 0%, rgba(68, 97, 104, 0.98) 100%);
  color: #f3f9ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 20px rgba(19, 36, 58, 0.22), 0 0 0 1px rgba(133, 170, 185, 0.35);
}

#routineCurrentTitle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #1a2d4a;
  background: linear-gradient(120deg, rgba(124, 148, 214, 0.32), rgba(114, 199, 189, 0.22));
  border: 1px solid rgba(100, 140, 200, 0.6);
  font-weight: 600;
}

#routineCurrentTitle::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #8fb3ff;
  box-shadow: 0 0 0 4px rgba(143, 179, 255, 0.35);
}

.routine-current-highlight {
  animation: routineCurrentPulse 420ms ease-out;
}

@keyframes routineCurrentPulse {
  0% {
    transform: translateY(1px);
    opacity: 0.25;
  }
  40% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.topbar-theme-btn {
  min-height: 33px;
  padding: 0.42rem 0.68rem;
  font-size: 0.8rem;
}

.topbar-palette-btn {
  min-width: 118px;
}

.hidden {
  display: none !important;
}

.lang-flag-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #e8eef8;
  border: 1px solid #afbdd4;
  border-radius: 999px;
  padding: 0.2rem;
}

.lang-flag-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #465572;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.34rem 0.48rem;
  cursor: pointer;
}

.lang-flag-btn.active {
  background: #d3deed;
  box-shadow: inset 0 0 0 1px rgba(101, 119, 156, 0.42);
}

.topbar a {
  text-decoration: none;
}

h1,
h2 {
  margin: 0 0 0.5rem;
}

p {
  margin: 0;
}

.nav-back-wrap {
  padding: 0 1rem;
  margin: 0 0 0.5rem;
}

.nav-back-wrap .link-back {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-back-wrap .link-back:hover {
  color: var(--accent-cyan);
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}

.admin-page .layout {
  grid-template-columns: 1fr;
}

.admin-create-user-card .admin-create-user-role-row {
  align-items: flex-end;
}

.admin-create-user-card .admin-create-user-active {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.35rem;
}

.admin-create-user-card .admin-create-user-active-label {
  margin: 0;
  cursor: pointer;
}

.admin-page .card {
  gap: 0.95rem;
}

.admin-page h3 {
  margin: 0 0 0.35rem;
  color: #2f446d;
  font-size: 1rem;
}

.admin-page .profile-exercise-list {
  padding-left: 1rem;
  color: #2f4268;
}

.admin-page .profile-exercise-list li {
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.admin-page .profile-exercise-list li::marker {
  color: #6f85b3;
}

.admin-top-usage-card .admin-top-usage-desc {
  margin: 0 0 1rem;
  line-height: 1.45;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.admin-analytics-column-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main, #2f446d);
}

.admin-analytics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-analytics-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-analytics-item-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.admin-analytics-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, #2f446d);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.admin-analytics-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #5a6b8c);
  white-space: nowrap;
}

.admin-analytics-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(120, 140, 190, 0.22);
  overflow: hidden;
}

.admin-analytics-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(92, 143, 189, 0.95), rgba(120, 190, 210, 0.85));
  min-width: 2px;
  transition: width 0.35s ease;
}

.admin-analytics-empty {
  font-size: 0.88rem;
  color: var(--text-muted, #5a6b8c);
  padding: 0.25rem 0;
}

.progress-page .layout {
  grid-template-columns: 1fr;
  max-width: 1240px;
  margin: 0 auto;
}

/* Feedback: single centered column */
.feedback-page .layout {
  grid-template-columns: 1fr;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.feedback-page .card h2 {
  margin-top: 0;
}

.feedback-page .row {
  align-items: flex-start;
}

.feedback-page .row > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.feedback-page .row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.feedback-page .card > .primary {
  width: 100%;
  margin-top: 0.15rem;
}

/* Profile page: use full width so both cards sit side by side and fill the space */
.profile-page .layout {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1rem;
}

.profile-page .layout .card {
  min-width: 0;
}

.profile-page .layout > .page-status-message {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .profile-page .layout {
    grid-template-columns: 1fr;
  }
}

.progress-page .card {
  gap: 0.7rem;
}

.progress-page .admin-metrics-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.55rem;
}

.progress-charts-card .progress-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.progress-chart-wrap {
  position: relative;
  min-height: 220px;
}

.progress-chart-wrap canvas {
  max-height: 260px;
  width: 100% !important;
}

.progress-chart-label {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted, #888);
}

.progress-page .summary-table {
  min-width: 760px;
}

.progress-page .summary-table th,
.progress-page .summary-table td {
  font-size: 0.92rem;
  white-space: nowrap;
}

.progress-page .page-status-message {
  margin-top: 0.1rem;
}

.admin-page .summary-table button {
  min-height: 32px;
}

.admin-page .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.admin-metric {
  border: 1px solid #37457a;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: linear-gradient(180deg, rgba(24, 36, 70, 0.92) 0%, rgba(18, 27, 50, 0.92) 100%);
}

.admin-metric-label {
  display: block;
  font-size: 0.82rem;
  color: #b8c5f2;
}

.admin-metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.15rem;
  color: #ffffff;
}

.auth-layout {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.auth-card {
  min-height: 280px;
}

.auth-layout-single {
  max-width: 980px;
  margin: 0 auto;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 280px);
}

.auth-main-card {
  min-height: auto;
}

.auth-status-card {
  min-height: auto;
  padding: 0.85rem 0.95rem;
  gap: 0.45rem;
  align-self: start;
}

.status-error {
  color: #ff9ea1;
}

.auth-switch-line {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.auth-switch-line a {
  color: #4d6f9f;
  text-decoration: none;
  font-weight: 600;
}

.auth-switch-line a:hover {
  text-decoration: underline;
}

.auth-forgot-prominent {
  margin: 0.15rem 0 0.5rem;
}

.auth-forgot-prominent a,
.auth-forgot-prominent .auth-text-btn {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot-prominent a:hover,
.auth-forgot-prominent .auth-text-btn:hover {
  text-decoration: underline;
}

.auth-resend-panel {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.45rem;
}

.auth-resend-panel .small {
  margin: 0;
  font-size: 0.9rem;
}

.auth-resend-panel.is-emphasized {
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 45%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #38bdf8) 12%, transparent);
}

.auth-text-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.auth-remember-row {
  margin-bottom: 0.65rem;
}

.auth-password-expired-row {
  margin-top: 0.75rem;
  text-align: center;
}

.auth-password-expired-row.hidden {
  display: none;
}

.auth-page .consent-row {
  color: #2f4268;
}

[data-theme="dark"] .auth-page .consent-row,
body[data-theme="dark"] .auth-page .consent-row {
  color: #d4e2ff;
}

.form-status-message {
  margin: 0.3rem auto 0;
  text-align: center;
  width: 100%;
  max-width: 560px;
  font-size: 0.9rem;
}

.page-status-message {
  grid-column: 1 / -1;
  margin: -0.1rem auto 0.2rem;
  text-align: center;
  width: 100%;
  font-size: 0.93rem;
}

.auth-page .topbar h1 {
  margin-bottom: 0.3rem;
}

.auth-page .topbar p {
  color: #5d6f99;
}

.auth-page .auth-card h2 {
  margin-bottom: 0.2rem;
}

.auth-page button.primary,
.auth-page #logoutBtn {
  min-height: 38px;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
}

.routine-page .routine-layout {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  align-items: start;
}

.routine-page .routine-flow-card {
  grid-column: 1 / -1;
}

.card {
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98) 0%, rgba(236, 243, 255, 0.98) 100%);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-soft);
  overflow: visible;
  min-height: 0;
}

.nav-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lesson-item {
  border: 1px solid #b7c8ec;
  border-radius: 10px;
  padding: 0.7rem;
  cursor: pointer;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  color: #213057;
}

.lesson-item.active {
  border-color: #85a7df;
  background: linear-gradient(180deg, #eaf1ff 0%, #dde8ff 100%);
}

.routine-item {
  border: 1px solid #b3c5ec;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  padding: 0.7rem;
  cursor: pointer;
  color: #213057;
}

.routine-item.active {
  border-color: #79bca0;
  background: linear-gradient(180deg, #e7f6ef 0%, #d9eee4 100%);
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: end;
  flex-wrap: wrap;
}

.row > div {
  flex: 1;
  min-width: 150px;
}

input,
select,
textarea,
button {
  border-radius: 8px;
  border: 1px solid #9bb0d8;
  background: #f8fbff;
  color: #1f2d4a;
  padding: 0.55rem;
  width: 100%;
}

button {
  width: auto;
  cursor: pointer;
}

button:not(.lang-flag-btn) {
  transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:not(.lang-flag-btn):hover {
  transform: translateY(-1px);
  border-color: #5670c2;
  box-shadow: 0 8px 18px rgba(8, 12, 30, 0.28);
}

button:not(.lang-flag-btn):active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(8, 12, 30, 0.22);
}

button:not(.lang-flag-btn):focus-visible,
.auth-link-btn:focus-visible,
.hero-btn:focus-visible {
  outline: 2px solid rgba(112, 144, 202, 0.85);
  outline-offset: 2px;
}

button[disabled],
button[aria-disabled="true"] {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

button.primary {
  background: linear-gradient(180deg, #90ced8 0%, #76bac6 100%);
  color: #132736;
  border-color: #77b9c5;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(56, 102, 121, 0.22);
}

button.primary:hover {
  background: linear-gradient(180deg, #96ced7 0%, #7dbbc5 100%);
  border-color: #92c8d2;
}

button.btn-secondary {
  background: linear-gradient(180deg, rgba(56, 78, 138, 0.96) 0%, rgba(39, 57, 109, 0.96) 100%);
  color: #f2f6ff;
  border-color: #6883ce;
  box-shadow: 0 5px 14px rgba(10, 16, 40, 0.24);
}

button.btn-secondary:hover {
  background: linear-gradient(180deg, rgba(74, 101, 170, 0.98) 0%, rgba(52, 74, 132, 0.98) 100%);
  border-color: #95aeef;
}

button.btn-danger {
  background: linear-gradient(180deg, #ff8c97 0%, #ff6f7e 100%);
  color: #2b0e12;
  border-color: #ff8b98;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(88, 17, 31, 0.28);
}

button.btn-danger:hover {
  background: linear-gradient(180deg, #ff99a4 0%, #ff7d8b 100%);
  border-color: #ffacb5;
}

button.btn-compact {
  min-height: 38px;
  padding: 0.55rem 0.85rem;
  font-size: 0.86rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.objectives-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
  padding-bottom: 0.25rem;
  width: 100%;
}

.objectives-checkboxes .checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  cursor: pointer;
  line-height: 1.35;
  width: 100%;
  max-width: 100%;
}

.objectives-checkboxes .checkbox-label input[type="checkbox"] {
  flex: 0 0 1.125rem;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  vertical-align: middle;
}

.objectives-checkboxes .checkbox-label-text {
  flex: 1 1 0%;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Profile: keep objectives row compact and aligned */
.profile-page .objectives-checkboxes .checkbox-label {
  flex-wrap: nowrap;
}
.profile-page .objectives-checkboxes .checkbox-label-text {
  flex: 1 1 0%;
  min-width: 0;
}

.consent-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: #485b83;
}

.consent-row input[type="checkbox"] {
  width: auto;
  margin-top: 0.15rem;
}

.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.challenge-card {
  padding: 1rem 1.25rem;
}

.challenge-card.challenge-completed {
  border-left: 4px solid #2e7d32;
  background: #f1f8e9;
}

.challenge-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.1rem;
}

.challenge-progress-wrap {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.challenge-progress-bar {
  height: 100%;
  background: #1976d2;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.challenge-completed .challenge-progress-bar {
  background: #2e7d32;
}

.challenge-stats {
  margin: 0.25rem 0 0 0;
  color: #555;
}

.community-routines-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.community-routine-card {
  padding: 0.85rem 1rem;
}

.community-routine-title {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.routine-speed-group {
  margin-top: 0.2rem;
}

.routine-speed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.speed-pill {
  background: #eaf1ff;
  border: 1px solid #b5c8ee;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  color: #30426f;
}

.muted {
  color: var(--text-muted);
}

.billing-details {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  list-style: disc;
  line-height: 1.45;
}

.routine-view-card {
  grid-column: 1 / -1;
  padding: 0.7rem 0.8rem;
}

.routine-view-switch {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.routine-setup-panels {
  display: contents;
}

.index-page .topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(236, 243, 255, 0.92);
}

.home-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

@keyframes homeFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.home-hero {
  overflow: hidden;
  position: relative;
  animation: homeFadeUp 420ms ease-out both;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto -2rem -2rem -2rem;
  height: 180px;
  background: url("vra-pattern.svg") center bottom / cover no-repeat;
  opacity: 0.28;
  pointer-events: none;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(240px, 1fr);
  gap: 1rem;
  align-items: center;
}

.home-hero-copy {
  animation: homeFadeUp 520ms ease-out both;
}

.home-hero-copy h2 {
  margin: 0.1rem 0 0.45rem;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.25;
}

.hero-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(115, 228, 255, 0.5);
  background: rgba(41, 66, 129, 0.45);
  color: #dff7ff;
  padding: 0.3rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-btn {
  text-decoration: none;
  border: 1px solid #4a5c9e;
  border-radius: 10px;
  padding: 0.52rem 0.78rem;
  color: #eaf1ff;
  background: rgba(21, 31, 63, 0.88);
}

.hero-btn.primary {
  background: linear-gradient(180deg, #75e8ff 0%, #55d5f3 100%);
  color: #0b1830;
  border-color: #71e6ff;
  font-weight: 700;
}

.hero-chips {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hero-chip {
  border: 1px solid #3e4f8d;
  border-radius: 999px;
  background: rgba(19, 31, 62, 0.85);
  color: #cfddff;
  padding: 0.24rem 0.54rem;
  font-size: 0.8rem;
}

.home-hero-visual {
  position: relative;
  z-index: 1;
  animation: homeFadeIn 620ms ease-out both;
}

.home-hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #3a4d90;
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.home-hero-visual img:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 30px rgba(4, 9, 26, 0.35);
}

.home-section-head {
  display: grid;
  gap: 0.25rem;
  padding: 0.25rem 0.1rem 0;
  animation: homeFadeUp 560ms ease-out both;
}

.home-section-head h2 {
  margin: 0;
}

.home-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.95rem;
}

.home-nav-card h3 {
  margin: 0;
  font-size: 1.04rem;
}

.home-nav-card {
  animation: homeFadeUp 520ms ease-out both;
}

.home-nav-grid .home-nav-card:nth-child(1) {
  animation-delay: 80ms;
}

.home-nav-grid .home-nav-card:nth-child(2) {
  animation-delay: 120ms;
}

.home-nav-grid .home-nav-card:nth-child(3) {
  animation-delay: 160ms;
}

.home-nav-grid .home-nav-card:nth-child(4) {
  animation-delay: 200ms;
}

.home-nav-grid .home-nav-card:nth-child(5) {
  animation-delay: 240ms;
}

.home-nav-grid .home-nav-card:nth-child(6) {
  animation-delay: 280ms;
}

.home-nav-grid .home-nav-card:nth-child(7) {
  animation-delay: 320ms;
}

.home-nav-grid .home-nav-card:nth-child(8) {
  animation-delay: 360ms;
}

.card-icon {
  display: inline-flex;
  width: fit-content;
  border-radius: 10px;
  background: rgba(33, 50, 102, 0.78);
  border: 1px solid #4662b6;
  padding: 0.34rem 0.45rem;
  font-size: 1.1rem;
}

.small {
  font-size: 0.9rem;
}

.analysis-status,
.drill-output {
  min-height: 60px;
  border: 1px solid #bfd0ef;
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  line-height: 1.45;
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.98) 0%, rgba(232, 240, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.routine-page .analysis-status,
.routine-page .drill-output {
  border: 1px solid #b9c9ee;
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.97) 0%, rgba(231, 239, 253, 0.97) 100%);
  color: #213158;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.routine-quick-tip {
  margin-top: 0.5rem;
  border: 1px solid rgba(106, 155, 255, 0.4);
  border-radius: 8px;
  background: rgba(208, 225, 252, 0.9);
  color: #223562;
  padding: 0.42rem 0.55rem;
  line-height: 1.45;
}

.routine-timer {
  margin-top: 0.4rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: #40986d;
}

.card.focus-pulse {
  box-shadow: 0 0 0 2px #8cb1da;
}

#routineSoundStatus {
  align-self: center;
}

.profile-exercise-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #415783;
}

.profile-exercise-list li {
  margin-bottom: 0.35rem;
}

.table-scroll {
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.summary-table th,
.summary-table td {
  border: 1px solid #adbfdf;
  padding: 0.45rem 0.5rem;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.summary-table th {
  background: #e2ebfb;
}

.summary-table td:last-child {
  min-width: 260px;
  color: #2d3f68;
  line-height: 1.45;
}

.blueprint-panel {
  border: 1px solid #bfd0ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7faff 0%, #edf3ff 100%);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.blueprint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.6rem;
}

.blueprint-subtitle {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  color: #344870;
}

.routine-page .blueprint-subtitle {
  font-size: 1.04rem;
  font-weight: 700;
  color: #2a3d67;
}

.routine-actions button {
  min-height: 40px;
}

.language-row {
  margin-top: -0.15rem;
}

.language-select-wrap {
  max-width: 230px;
}

.exercise-explanation {
  border: 1px solid #b8caef;
  border-left: 4px solid #5eb7df;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.97) 0%, rgba(234, 242, 255, 0.97) 100%);
  padding: 0.75rem 0.85rem;
  line-height: 1.52;
  color: #2a385f;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.exercise-guide-trigger {
  margin-top: 0.25rem;
}

.exercise-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.exercise-guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 24, 0.72);
}

.exercise-guide-dialog {
  position: relative;
  margin: min(7vh, 56px) auto;
  width: min(920px, calc(100vw - 1.3rem));
  max-height: calc(100vh - min(14vh, 96px));
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #4a5f85;
  background: linear-gradient(180deg, rgba(37, 50, 75, 0.98) 0%, rgba(29, 40, 60, 0.98) 100%);
  box-shadow: 0 20px 42px rgba(3, 8, 16, 0.45);
  padding: 0.75rem;
}

.exercise-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  color: #e4eeff;
}

.exercise-guide-dialog .exercise-explanation {
  border-color: #7d96c4;
  border-left-color: #85c8e7;
  background: linear-gradient(180deg, rgba(225, 236, 255, 0.96) 0%, rgba(212, 227, 252, 0.96) 100%);
  color: #1e2d4d;
  font-size: 0.94rem;
}

.collapsible-card {
  padding: 0;
  overflow: hidden;
}

.collapsible-card-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(75, 96, 162, 0.28);
  background: rgba(236, 244, 255, 0.88);
}

.collapsible-card-summary::-webkit-details-marker {
  display: none;
}

.collapsible-card-head {
  display: grid;
  gap: 0.2rem;
}

.collapsible-card-head strong {
  font-size: 1.05rem;
  color: #2a3d67;
}

.collapsible-card-body {
  padding: 0.85rem;
}

.exercise-explanation-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.exercise-explanation-head strong {
  font-size: 1rem;
  color: #22335c;
}

.exercise-explanation-head span {
  font-size: 0.9rem;
  color: #48608f;
}

.exercise-explanation-focus {
  margin-bottom: 0.45rem;
  color: #30466f;
  line-height: 1.5;
}

.exercise-reference {
  margin: 0.2rem 0 0.5rem;
  border: 1px solid rgba(130, 154, 211, 0.48);
  border-radius: 8px;
  background: rgba(225, 236, 255, 0.88);
  padding: 0.45rem 0.55rem;
  color: #2f4269;
  line-height: 1.48;
}

.exercise-technical-guidance {
  margin: 0.2rem 0 0.5rem;
  border: 1px solid rgba(130, 158, 217, 0.52);
  border-radius: 8px;
  background: rgba(221, 234, 255, 0.9);
  padding: 0.45rem 0.55rem;
  color: #2f446f;
  line-height: 1.48;
  display: grid;
  gap: 0.24rem;
}

.exercise-explanation-tips strong {
  color: #2d456f;
  font-size: 0.93rem;
}

.exercise-explanation-tips ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.25rem;
}

.step-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.42rem;
}

.step-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid #bccded;
  border-radius: 999px;
  background: rgba(236, 243, 255, 0.96);
  padding: 0.32rem 0.56rem;
  color: #2d3f68;
  font-size: 0.9rem;
}

.step-meta-pill strong {
  color: #3f5f95;
  font-weight: 600;
}

.step-meta-wide {
  border-radius: 9px;
  justify-content: flex-start;
}

.vowel-listen-btn {
  margin-left: 0.25rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
}
.vowel-listen-btn:hover {
  background: var(--accent-cyan);
  color: #fff;
  border-color: var(--accent-cyan);
}

.step-meta-focus {
  margin-top: 0.55rem;
  border-top: 1px solid rgba(142, 164, 214, 0.48);
  padding-top: 0.5rem;
  color: #2f426a;
  line-height: 1.52;
}

#routineStepTitle {
  display: inline-block;
  color: #0f1f38;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: rgba(34, 53, 95, 0.12);
  border: 1px solid rgba(34, 53, 95, 0.28);
}

#routineStepMeta {
  margin-top: 0.35rem;
  border: 1px solid #bfd0ef;
  border-left: 4px solid #80c3a5;
  border-radius: 9px;
  background: rgba(237, 245, 255, 0.96);
  padding: 0.62rem 0.72rem;
  color: #30456f;
  font-size: 0.96rem;
  line-height: 1.56;
}

#routineStatus {
  border: 1px solid #b6c9eb;
  border-radius: 9px;
  background: rgba(231, 241, 255, 0.9);
  padding: 0.5rem 0.65rem;
  color: #31466f;
}

.routine-secondary-actions {
  align-items: center;
}

.chromatic-panel {
  border: 1px solid #b7c8ec;
  border-radius: 10px;
  background: linear-gradient(180deg, #f2f8ff 0%, #e8f0ff 100%);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chromatic-row {
  display: flex;
  gap: 0.55rem;
  align-items: end;
  flex-wrap: wrap;
}

.chromatic-row > div {
  flex: 1;
  min-width: 120px;
}

.chromatic-direction-btn.active {
  border-color: #8af7b7;
  box-shadow: 0 0 0 1px rgba(138, 247, 183, 0.35);
}

.chromatic-key-status {
  border: 1px dashed #8ea8dd;
  border-radius: 8px;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0.5rem 0.6rem;
  background: rgba(236, 244, 255, 0.55);
  color: #2c3c65;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.training-list li,
.training-reference,
.exercise-explanation ul,
.exercise-explanation li {
  color: #3f527f;
}

.training-list {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.training-list li {
  margin-bottom: 0.35rem;
  color: #2f446f;
  line-height: 1.48;
  font-size: 0.95rem;
}

.training-reference {
  margin-top: 0.22rem;
  color: #35507f;
  line-height: 1.46;
  font-size: 0.9rem;
}

.routine-page .collapsible-card-head .muted,
.routine-page .collapsible-card-summary .muted {
  color: #3b5481;
}

.routine-page label {
  color: #2f456f;
  font-weight: 600;
}

.routine-page .summary-table th,
.routine-page .summary-table td {
  font-size: 0.95rem;
  padding: 0.58rem 0.62rem;
  line-height: 1.5;
}

.routine-page .summary-table td {
  color: #263d67;
}

.routine-page .summary-table th {
  color: #2c436d;
  font-weight: 700;
}

.routine-page .summary-table tbody tr:nth-child(odd) td {
  background: rgba(232, 241, 255, 0.85);
}

.routine-page .summary-table tbody tr:nth-child(even) td {
  background: rgba(223, 235, 252, 0.78);
}

.routine-page .summary-table td:first-child {
  font-weight: 700;
  color: #223b64;
}

.routine-page .summary-table td:last-child {
  min-width: 290px;
  color: #24406d;
}

.routine-page .voice-card .analysis-status {
  border-color: #87a3d6;
  background: linear-gradient(180deg, rgba(232, 242, 255, 0.96) 0%, rgba(221, 234, 253, 0.96) 100%);
  color: #233a62;
}

.routine-page .voice-card .profile-exercise-list {
  color: #2d446f;
}

.routine-page .voice-card .profile-exercise-list li::marker {
  color: #5f7fb8;
}

.piano-roll-panel {
  border: 1px solid #bfd0ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f6faff 0%, #eaf1ff 100%);
  padding: 0.65rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.piano-roll-panel.practice-piano .piano-roll {
  min-height: 120px;
  padding: 0.4rem;
}

.piano-roll-panel.practice-piano .piano-keyboard {
  height: 100px;
}

.piano-roll-panel.practice-piano .piano-key.white {
  min-height: 98px;
}

.piano-roll-panel.practice-piano .piano-key.black {
  height: 58px;
}

.root-key-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.root-key-row .btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid #2a3357;
  background: #e8edf7;
  color: #1f2a45;
  cursor: pointer;
}

.root-key-row .btn-icon:hover {
  background: #d0daf0;
}

.root-key-display {
  font-weight: 700;
  min-width: 2.5rem;
  text-align: center;
}

.root-key-row select {
  min-width: 5rem;
}

.piano-roll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.piano-roll {
  min-height: 164px;
  border: 1px solid #c2d3f2;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff5ff 0%, #e4edff 100%);
  display: block;
  padding: 0.55rem;
  overflow: hidden;
}

.piano-keyboard {
  position: relative;
  width: 100%;
  height: 148px;
}

.piano-white-keys {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--white-key-count, 24), minmax(0, 1fr));
  gap: 1px;
}

.piano-black-keys {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.piano-key {
  border: 1px solid #2a3357;
  border-radius: 0 0 6px 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
  transition: background 90ms ease, border-color 90ms ease, box-shadow 90ms ease;
  user-select: none;
}

.piano-key-label {
  display: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 0.12rem;
}

.piano-key.white {
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #e8edf7 100%);
  color: #1f2a45;
  padding-bottom: 0.3rem;
  box-shadow: inset 0 -12px 12px rgba(35, 45, 72, 0.12);
}

.piano-key.black {
  position: absolute;
  top: 0;
  height: 58%;
  transform: translateX(-50%);
  border-color: #0a1023;
  background: linear-gradient(180deg, #1a2130 0%, #04070e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -10px 10px rgba(0, 0, 0, 0.7), 0 6px 8px rgba(0, 0, 0, 0.45);
  z-index: 3;
  pointer-events: none;
}

.piano-key.in-pattern:not(.active) {
  box-shadow: inset 0 -6px 0 rgba(122, 165, 255, 0.22);
}

.piano-key.white.active {
  border-color: #6cb7ff;
  background: linear-gradient(180deg, #f7fbff 0%, #cfe4ff 100%);
  box-shadow: 0 0 0 1px rgba(108, 183, 255, 0.7), 0 0 12px rgba(91, 154, 255, 0.28);
}

.piano-key.white.active .piano-key-label,
.piano-key.white.show-label .piano-key-label {
  display: inline;
  color: #111a2e;
}

.piano-key.black.active {
  border-color: #6cb7ff;
  background: linear-gradient(180deg, #355488 0%, #1a2a4b 100%);
  box-shadow: 0 0 0 1px rgba(108, 183, 255, 0.55), 0 0 10px rgba(108, 183, 255, 0.3);
}

.piano-key.black.active .piano-key-label {
  display: inline;
  color: #f5f8ff;
}

.piano-roll-panel.practice-piano .piano-key-label {
  font-size: 0.62rem;
}

footer {
  border-top: 1px solid #2a3052;
  padding: 1rem;
  text-align: center;
  color: #93a0d7;
}

[data-theme="dark"] body,
body[data-theme="dark"] {
  background: radial-gradient(1000px 420px at 15% -10%, rgba(93, 114, 154, 0.24) 0%, rgba(20, 26, 36, 0) 70%),
    radial-gradient(900px 380px at 85% -15%, rgba(88, 123, 130, 0.18) 0%, rgba(20, 26, 36, 0) 72%),
    var(--bg-main);
}

[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar {
  background: rgba(20, 29, 42, 0.95);
}

[data-theme="dark"] .topbar h1,
body[data-theme="dark"] .topbar h1 {
  color: #eff4ff;
  text-shadow: 0 1px 8px rgba(24, 36, 56, 0.4);
}

[data-theme="dark"] .topbar p,
body[data-theme="dark"] .topbar p {
  color: #ccd8ee;
}

[data-theme="dark"] .card,
body[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(30, 40, 58, 0.98) 0%, rgba(23, 33, 49, 0.98) 100%);
  border-color: #445876;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] button,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] button {
  border-color: #58719a;
  background: #1f2b40;
  color: #edf3ff;
}

[data-theme="dark"] button.primary,
body[data-theme="dark"] button.primary {
  border-color: #7cb9c3;
  background: linear-gradient(180deg, #8fcad4 0%, #73b5bf 100%);
  color: #102232;
}

[data-theme="dark"] button.btn-secondary,
body[data-theme="dark"] button.btn-secondary {
  border-color: #7893d7;
  background: linear-gradient(180deg, #4a6091 0%, #3b4f79 100%);
  color: #edf3ff;
}

[data-theme="dark"] button.btn-danger,
body[data-theme="dark"] button.btn-danger {
  border-color: #f19aa5;
  background: linear-gradient(180deg, #f68a97 0%, #e87181 100%);
  color: #2b0d12;
}

[data-theme="dark"] .auth-link-btn,
body[data-theme="dark"] .auth-link-btn {
  border-color: #465775;
  background: #1f2a3d;
  color: #deebff;
  box-shadow: 0 2px 10px rgba(7, 12, 20, 0.28);
}

[data-theme="dark"] .auth-link-btn:hover,
body[data-theme="dark"] .auth-link-btn:hover {
  border-color: #5c7197;
  background: #27344c;
}

[data-theme="dark"] .auth-link-btn.is-active,
body[data-theme="dark"] .auth-link-btn.is-active {
  border-color: #7c90b6;
  background: linear-gradient(180deg, #4f6489 0%, #3e5274 100%);
  color: #f1f5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 9px 18px rgba(8, 14, 26, 0.3);
}

[data-theme="dark"] .auth-link-btn-highlight,
body[data-theme="dark"] .auth-link-btn-highlight {
  border-color: #7aa7b2;
  background: linear-gradient(180deg, #517d84 0%, #42666d 100%);
  color: #eff7ff;
}

[data-theme="dark"] .auth-link-btn-highlight:hover,
body[data-theme="dark"] .auth-link-btn-highlight:hover {
  border-color: #94b8c1;
  background: linear-gradient(180deg, #5d8f95 0%, #4b767c 100%);
}

[data-theme="dark"] .auth-forgot-prominent a,
body[data-theme="dark"] .auth-forgot-prominent a,
[data-theme="dark"] .auth-forgot-prominent .auth-text-btn,
body[data-theme="dark"] .auth-forgot-prominent .auth-text-btn {
  color: #9ed4ff;
}

[data-theme="dark"] .auth-switch-line a,
body[data-theme="dark"] .auth-switch-line a {
  color: #a8c4ff;
}

[data-theme="dark"] .auth-user-chip,
body[data-theme="dark"] .auth-user-chip {
  border-color: #5a6e92;
  background: rgba(42, 55, 79, 0.62);
  color: #d7e3fb;
}

[data-theme="dark"] .auth-user-chip-link,
body[data-theme="dark"] .auth-user-chip-link {
  border-color: #7592c6;
  background: rgba(56, 74, 110, 0.88);
  color: #e8f1ff;
}

[data-theme="dark"] .auth-user-chip-link:hover,
body[data-theme="dark"] .auth-user-chip-link:hover {
  border-color: #8ca9dd;
  background: rgba(66, 87, 127, 0.94);
}

[data-theme="dark"] .auth-user-chip-link.is-active,
body[data-theme="dark"] .auth-user-chip-link.is-active {
  border-color: #96b4e8;
  background: linear-gradient(180deg, #5f80ba 0%, #4a6799 100%);
  color: #f5f9ff;
}

[data-theme="dark"] .back-home-btn.is-home,
body[data-theme="dark"] .back-home-btn.is-home {
  border-color: #84a8bb;
  background: linear-gradient(180deg, rgba(72, 103, 112, 0.98) 0%, rgba(56, 82, 89, 0.98) 100%);
  color: #f1f8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 20px rgba(8, 14, 24, 0.3), 0 0 0 1px rgba(132, 168, 187, 0.28);
}

[data-theme="dark"] .lang-flag-switch,
body[data-theme="dark"] .lang-flag-switch {
  background: #232c3c;
  border-color: #4b5c79;
}

[data-theme="dark"] .lang-flag-btn,
body[data-theme="dark"] .lang-flag-btn {
  color: #c4d0e7;
}

[data-theme="dark"] .lang-flag-btn.active,
body[data-theme="dark"] .lang-flag-btn.active {
  background: #3a4a66;
  box-shadow: inset 0 0 0 1px rgba(132, 156, 196, 0.5);
}

[data-theme="dark"] .analysis-status,
[data-theme="dark"] .drill-output,
[data-theme="dark"] .blueprint-panel,
[data-theme="dark"] .exercise-explanation,
[data-theme="dark"] .chromatic-panel,
[data-theme="dark"] .piano-roll-panel,
[data-theme="dark"] .piano-roll,
body[data-theme="dark"] .analysis-status,
body[data-theme="dark"] .drill-output,
body[data-theme="dark"] .blueprint-panel,
body[data-theme="dark"] .exercise-explanation,
body[data-theme="dark"] .chromatic-panel,
body[data-theme="dark"] .piano-roll-panel,
body[data-theme="dark"] .piano-roll {
  border-color: #50658a;
  background: linear-gradient(180deg, rgba(36, 49, 72, 0.98) 0%, rgba(29, 41, 61, 0.98) 100%);
  color: #eaf1ff;
}

[data-theme="dark"] .routine-page .collapsible-card-summary,
body[data-theme="dark"] .routine-page .collapsible-card-summary {
  background: rgba(44, 58, 85, 0.78);
  border-bottom-color: rgba(120, 147, 196, 0.45);
}

[data-theme="dark"] .routine-page .collapsible-card-head strong,
body[data-theme="dark"] .routine-page .collapsible-card-head strong {
  color: #eef4ff;
}

[data-theme="dark"] .routine-page .blueprint-subtitle,
body[data-theme="dark"] .routine-page .blueprint-subtitle {
  color: #eef4ff;
}

[data-theme="dark"] .routine-page .collapsible-card-head .muted,
[data-theme="dark"] .routine-page .collapsible-card-summary .muted,
body[data-theme="dark"] .routine-page .collapsible-card-head .muted,
body[data-theme="dark"] .routine-page .collapsible-card-summary .muted {
  color: #cbdaf3;
}

[data-theme="dark"] .routine-page label,
body[data-theme="dark"] .routine-page label {
  color: #dce8ff;
}

[data-theme="dark"] .routine-page .training-list li,
body[data-theme="dark"] .routine-page .training-list li {
  color: #deebff;
}

[data-theme="dark"] .routine-page .training-reference,
body[data-theme="dark"] .routine-page .training-reference {
  color: #bdd2f6;
}

[data-theme="dark"] .routine-page .summary-table th,
[data-theme="dark"] .routine-page .summary-table td,
body[data-theme="dark"] .routine-page .summary-table th,
body[data-theme="dark"] .routine-page .summary-table td {
  color: #e5efff;
}

[data-theme="dark"] .routine-page .summary-table tbody tr:nth-child(odd) td,
body[data-theme="dark"] .routine-page .summary-table tbody tr:nth-child(odd) td {
  background: rgba(56, 72, 104, 0.72);
}

[data-theme="dark"] .routine-page .summary-table tbody tr:nth-child(even) td,
body[data-theme="dark"] .routine-page .summary-table tbody tr:nth-child(even) td {
  background: rgba(47, 62, 92, 0.72);
}

[data-theme="dark"] .routine-page .summary-table th,
body[data-theme="dark"] .routine-page .summary-table th {
  background: #445884;
  color: #eef4ff;
}

[data-theme="dark"] .routine-page .summary-table td:first-child,
body[data-theme="dark"] .routine-page .summary-table td:first-child {
  color: #f0f6ff;
}

[data-theme="dark"] .routine-page .summary-table td:last-child,
body[data-theme="dark"] .routine-page .summary-table td:last-child {
  color: #d9e8ff;
}

[data-theme="dark"] .routine-page .voice-card .analysis-status,
body[data-theme="dark"] .routine-page .voice-card .analysis-status {
  border-color: #6f88b7;
  background: linear-gradient(180deg, rgba(45, 60, 89, 0.98) 0%, rgba(37, 51, 77, 0.98) 100%);
  color: #e4eeff;
}

[data-theme="dark"] .routine-page .voice-card .profile-exercise-list,
body[data-theme="dark"] .routine-page .voice-card .profile-exercise-list {
  color: #d9e7ff;
}

[data-theme="dark"] .routine-page .voice-card .profile-exercise-list li::marker,
body[data-theme="dark"] .routine-page .voice-card .profile-exercise-list li::marker {
  color: #9bb4e6;
}

[data-theme="dark"] .lesson-item,
[data-theme="dark"] .routine-item,
body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .routine-item {
  border-color: #5d739b;
  background: linear-gradient(180deg, rgba(44, 58, 84, 0.96) 0%, rgba(35, 47, 71, 0.96) 100%);
  color: #edf3ff;
}

[data-theme="dark"] .lesson-item .muted,
[data-theme="dark"] .routine-item .muted,
body[data-theme="dark"] .lesson-item .muted,
body[data-theme="dark"] .routine-item .muted {
  color: #c8d6f0;
}

[data-theme="dark"] .lesson-item.active,
[data-theme="dark"] .routine-item.active,
body[data-theme="dark"] .lesson-item.active,
body[data-theme="dark"] .routine-item.active {
  border-color: #79a4da;
  background: linear-gradient(180deg, rgba(72, 97, 140, 0.98) 0%, rgba(56, 78, 118, 0.98) 100%);
  color: #f4f8ff;
}

[data-theme="dark"] #routineStatus,
body[data-theme="dark"] #routineStatus {
  color: #d8e5ff;
}

[data-theme="dark"] #routineCurrentTitle,
body[data-theme="dark"] #routineCurrentTitle {
  color: #e2edff;
  background: linear-gradient(120deg, rgba(80, 120, 180, 0.35), rgba(70, 160, 150, 0.25));
  border-color: rgba(120, 160, 220, 0.5);
}

[data-theme="dark"] #routineStepTitle,
body[data-theme="dark"] #routineStepTitle {
  color: #e8f0ff;
  background: rgba(50, 75, 120, 0.35);
  border-color: rgba(80, 120, 180, 0.45);
}

[data-theme="dark"] .exercise-guide-dialog,
body[data-theme="dark"] .exercise-guide-dialog {
  border-color: #6078a6;
  background: linear-gradient(180deg, rgba(33, 46, 71, 0.99) 0%, rgba(26, 36, 58, 0.99) 100%);
}

[data-theme="dark"] .exercise-guide-header,
body[data-theme="dark"] .exercise-guide-header {
  color: #e3edff;
}

[data-theme="dark"] .exercise-guide-dialog .exercise-explanation,
body[data-theme="dark"] .exercise-guide-dialog .exercise-explanation {
  background: linear-gradient(180deg, rgba(226, 238, 255, 0.97) 0%, rgba(214, 229, 252, 0.97) 100%);
  border-color: #86a1d0;
  border-left-color: #8ecde8;
  color: #1c2b49;
}

[data-theme="dark"] .chromatic-key-status,
body[data-theme="dark"] .chromatic-key-status {
  border-color: #6f8fc8;
  background: rgba(38, 52, 78, 0.78);
  color: #cfe0ff;
  text-shadow: 0 1px 0 rgba(6, 10, 18, 0.45);
}

[data-theme="dark"] .summary-table th,
[data-theme="dark"] .summary-table td,
body[data-theme="dark"] .summary-table th,
body[data-theme="dark"] .summary-table td {
  border-color: #4a5976;
  color: #d7e0f2;
}

[data-theme="dark"] .summary-table th,
body[data-theme="dark"] .summary-table th {
  background: #32405e;
}

[data-theme="dark"] .admin-page h3,
body[data-theme="dark"] .admin-page h3 {
  color: #dce7ff;
}

[data-theme="dark"] .admin-analytics-column-title,
body[data-theme="dark"] .admin-analytics-column-title {
  color: #e4edff;
}

[data-theme="dark"] .admin-analytics-label,
body[data-theme="dark"] .admin-analytics-label {
  color: #e8f0ff;
}

[data-theme="dark"] .admin-analytics-meta,
body[data-theme="dark"] .admin-analytics-meta {
  color: #a9bbe6;
}

[data-theme="dark"] .admin-analytics-bar-track,
body[data-theme="dark"] .admin-analytics-bar-track {
  background: rgba(90, 110, 160, 0.35);
}

[data-theme="dark"] .admin-analytics-empty,
body[data-theme="dark"] .admin-analytics-empty {
  color: #a9bbe6;
}

[data-theme="dark"] .progress-page .summary-table th,
[data-theme="dark"] .progress-page .summary-table td,
body[data-theme="dark"] .progress-page .summary-table th,
body[data-theme="dark"] .progress-page .summary-table td {
  color: #e3edff;
}

[data-theme="dark"] .progress-page .admin-metric,
body[data-theme="dark"] .progress-page .admin-metric {
  border-color: #5a7097;
  background: linear-gradient(180deg, rgba(47, 61, 88, 0.96) 0%, rgba(38, 51, 76, 0.96) 100%);
}

[data-theme="dark"] .admin-page .profile-exercise-list,
body[data-theme="dark"] .admin-page .profile-exercise-list {
  color: #c9d8f3;
}

[data-theme="dark"] .admin-page .profile-exercise-list li::marker,
body[data-theme="dark"] .admin-page .profile-exercise-list li::marker {
  color: #90a7d6;
}

@media (prefers-reduced-motion: reduce) {
  .topbar h1 {
    animation: none !important;
    background-position: 0 0 !important;
  }

  .home-hero,
  .home-hero-copy,
  .home-hero-visual,
  .home-section-head,
  .home-nav-card {
    animation: none !important;
  }

  .home-hero-visual img,
  .nav-card,
  button:not(.lang-flag-btn),
  .auth-link-btn,
  .hero-btn {
    transition: none !important;
  }

  .home-hero-visual img:hover,
  .nav-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-soft);
  }

  button:not(.lang-flag-btn):hover,
  .auth-link-btn:hover,
  .hero-btn:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .admin-analytics-bar-fill {
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 0.8rem;
  }

  .topbar-actions,
  .auth-controls {
    justify-content: flex-start;
  }

  .auth-controls {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .topbar-actions {
    width: 100%;
    row-gap: 0.5rem;
    column-gap: 0.5rem;
  }

  .topbar-actions > a {
    display: inline-flex;
  }

  .auth-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, max-content));
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .auth-controls > * {
    min-width: 132px;
  }

  .auth-controls .auth-user-chip-link {
    min-width: 160px;
    justify-content: center;
  }

  .auth-layout-single {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .home-main {
    padding: 0.75rem;
    gap: 0.8rem;
  }

  .home-hero-grid {
    grid-template-columns: 1fr;
  }

  .home-hero::after {
    height: 120px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-btn {
    text-align: center;
  }

  .home-nav-grid {
    grid-template-columns: 1fr;
  }

  .routine-page .routine-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .routine-flow-card {
    order: 1;
  }

  .voice-card {
    order: 2;
  }

  .profile-card {
    order: 3;
  }

  .card {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .row > div {
    min-width: 100%;
  }

  .row button {
    width: 100%;
  }

  .routine-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .routine-actions button {
    width: 100%;
    min-height: 42px;
  }

  .exercise-guide-dialog {
    margin: 1rem auto;
    width: calc(100vw - 0.9rem);
    max-height: calc(100vh - 2rem);
    padding: 0.55rem;
  }

  .exercise-guide-header {
    margin-bottom: 0.42rem;
  }

  .exercise-guide-dialog .exercise-explanation {
    padding: 0.56rem 0.6rem 0.66rem;
    font-size: 0.91rem;
  }

  .exercise-explanation-head {
    flex-direction: column;
    gap: 0.22rem;
    align-items: flex-start;
  }

  .routine-secondary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .piano-roll {
    min-height: 138px;
    padding: 0.45rem;
  }

  .piano-keyboard {
    height: 124px;
  }

  .piano-key.white {
    height: 100%;
  }

  .piano-key.black {
    height: 56%;
  }

  .chromatic-row {
    flex-direction: column;
    align-items: stretch;
  }

  .blueprint-grid {
    grid-template-columns: 1fr;
  }

  #routineSoundStatus {
    align-self: flex-start;
  }
}

@media (max-width: 680px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar-actions .lang-flag-switch {
    justify-self: start;
  }

  .topbar-actions > a {
    width: 100%;
  }

  .topbar-actions > a > button {
    width: 100%;
  }

  .auth-controls {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .auth-controls > * {
    min-width: 0;
    width: 100%;
  }

  .auth-controls .auth-user-chip-link {
    grid-column: 1 / -1;
  }

  .auth-controls .auth-link-btn,
  .auth-controls button {
    justify-content: center;
    width: 100%;
  }

  .progress-page .admin-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .progress-page .summary-table {
    min-width: 620px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-brand-link {
    flex: 1 1 100%;
    min-width: 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .auth-controls {
    flex-wrap: wrap;
    max-width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .auth-controls > * {
    flex: 0 0 auto;
  }

  .auth-user-chip {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .auth-link-btn {
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 900px) {
  .auth-controls {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

@media (max-width: 460px) {
  .auth-controls {
    grid-template-columns: 1fr;
  }

  .progress-page .admin-metrics-grid {
    grid-template-columns: 1fr;
  }

  .progress-page .summary-table {
    min-width: 560px;
  }
}

/* Voice preparation page */
.voice-prep-page .layout {
  padding: 1.25rem 1rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}
.voice-prep-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.voice-prep-hero {
  padding: 1.5rem 1.25rem;
}
.voice-prep-hero-inner {
  max-width: 56ch;
}
.voice-prep-hero h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: var(--text-main);
}
.voice-prep-hero-desc {
  margin: 0 0 1rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.voice-prep-cta {
  display: inline-block;
  margin-top: 0.25rem;
  text-decoration: none;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.voice-prep-cta.hero-btn.primary {
  background: linear-gradient(180deg, #0d3d56 0%, #0a2d42 100%);
  color: #e8f6fa;
  border: 1px solid #165a7a;
  box-shadow: 0 4px 14px rgba(13, 61, 86, 0.35);
}
.voice-prep-cta.hero-btn.primary:hover {
  background: linear-gradient(180deg, #114a66 0%, #0d384d 100%);
  color: #f0f9fc;
  border-color: #1e6b8f;
  box-shadow: 0 6px 20px rgba(13, 61, 86, 0.45);
}
.voice-prep-section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text-main);
}
.voice-prep-tips-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.voice-prep-tips-grid li {
  margin: 0;
  padding: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}
.voice-prep-tips-grid li strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
  color: var(--text-main);
}
.voice-prep-tips-grid li span {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.voice-prep-tip-visual {
  margin: 0.4rem 0 0.55rem;
  padding: 0.45rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-elev-strong);
}
.voice-prep-tip-thumb-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.voice-prep-tip-thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: zoom-in;
  outline: none;
}
.voice-prep-tip-thumb:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-cyan);
}
.voice-prep-tip-expand {
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
  width: 100%;
}
.voice-prep-tip-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.voice-prep-tip-visual small {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-dim);
}
.voice-prep-routines-intro {
  margin: 0 0 1rem;
  line-height: 1.5;
}
.voice-prep-intervals {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.voice-prep-intervals p {
  margin: 0;
  max-width: 42rem;
  line-height: 1.5;
}
.voice-prep-routine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.voice-prep-routine-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.voice-prep-routine-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-elev-strong);
  box-shadow: var(--shadow-soft);
}
.voice-prep-routine-card strong {
  font-size: 0.95rem;
  color: var(--text-main);
}
.voice-prep-routine-duration {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-cyan);
}
.voice-prep-routine-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.voice-prep-routine-card-featured {
  border-color: var(--accent-cyan);
  background: linear-gradient(180deg, rgba(92, 143, 189, 0.08) 0%, rgba(92, 143, 189, 0.04) 100%);
}

.voice-prep-image-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(5vh, 2rem) min(1rem, 3vw);
  overflow: auto;
}
.voice-prep-image-modal.hidden {
  display: none;
}
.voice-prep-image-modal-backdrop {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: rgba(9, 14, 24, 0.78);
  backdrop-filter: blur(4px);
  z-index: 0;
}
.voice-prep-image-modal-dialog {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  max-height: min(92vh, 1200px);
  margin-top: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg-elev-strong);
  box-shadow: var(--shadow-soft, 0 20px 42px rgba(3, 8, 16, 0.45));
  overflow: hidden;
}
.voice-prep-image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-elev);
}
.voice-prep-image-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}
.voice-prep-image-modal-close {
  flex-shrink: 0;
  font-size: 0.85rem;
}
.voice-prep-image-modal-body {
  padding: 0.65rem;
  overflow: auto;
  max-height: calc(92vh - 4rem);
  background: var(--bg-page);
}
.voice-prep-image-modal-body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(78vh, 1100px);
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
}
.voice-prep-routine-card-featured:hover {
  background: linear-gradient(180deg, rgba(92, 143, 189, 0.14) 0%, rgba(92, 143, 189, 0.08) 100%);
}

[data-theme="dark"] .voice-prep-cta.hero-btn.primary,
body[data-theme="dark"] .voice-prep-cta.hero-btn.primary {
  background: linear-gradient(180deg, #7ea2d6 0%, #5c8fbd 100%);
  color: #0d1520;
  border-color: #8fb0e0;
}
[data-theme="dark"] .voice-prep-cta.hero-btn.primary:hover,
body[data-theme="dark"] .voice-prep-cta.hero-btn.primary:hover {
  background: linear-gradient(180deg, #8fafe0 0%, #6d9bca 100%);
  color: #0a1118;
}

/* Import page result */
.import-url-input {
  width: 100%;
  max-width: 480px;
}
.import-supported-hint {
  margin-top: 0.25rem;
  font-size: 0.9rem;
}
.import-or-divider {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
}
.import-file-input {
  max-width: 100%;
  font-size: 0.9rem;
}
.import-url-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
}
.import-result-list {
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.5rem;
  align-items: baseline;
}
.import-result-list dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
}
.import-result-list dd {
  margin: 0;
  color: var(--text-muted);
}

/* Import page – practice controls (Transpose / Pitch / Speed / Loop) */
/* Import page – embedded video/audio */
.import-popup-card {
  margin-top: 1rem;
}
.import-popup-desc {
  margin-bottom: 1rem;
  line-height: 1.45;
}
.import-open-popup-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
}
.import-rubberband-card {
  margin-top: 1rem;
}
.import-rubberband-desc {
  margin-bottom: 0.75rem;
  line-height: 1.45;
}
.import-rubberband-player-wrap {
  margin: 0.75rem 0;
}
.import-rubberband-player-wrap.hidden {
  display: none;
}
.import-rubberband-play-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
}
.import-rubberband-status {
  margin-top: 0.5rem;
  min-height: 1.2em;
}
.import-popup-youtube-hint {
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 520px;
}
.import-controls-hint-card {
  margin-top: 1rem;
}
.import-controls-hint {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.import-embed-card {
  margin-top: 1rem;
}
.import-embed-desc {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.import-embed-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.import-embed-container iframe,
.import-embed-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.import-embed-container audio {
  width: 100%;
  padding: 0.5rem;
  display: block;
}
.import-embed-fallback {
  margin-top: 0.5rem;
}

.import-controls-card {
  margin-top: 1rem;
}
.import-controls-desc {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.import-controls-help {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Studio-style layout: one row of controls, timeline, playback bar */
.import-studio-layout .import-studio-row {
  margin-bottom: 1rem;
}
.import-studio-controls-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.import-studio-block {
  padding: 0.6rem 0.85rem;
}
.import-studio-block .import-control-label {
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.import-studio-block .import-slider {
  max-width: 140px;
}
.import-studio-timeline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.import-timeline-wrap {
  flex: 1;
  min-width: 200px;
}
.import-timeline-label {
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.import-timeline-bar-wrap {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
  background: var(--slider-track, #c8d4e8);
  border-radius: 4px;
  padding: 0 2px;
}
.import-timeline-seek {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-radius: 4px;
}
.import-timeline-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-gold, #c9a227);
  cursor: pointer;
  border: 2px solid var(--bg-main, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.import-timeline-seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-gold, #c9a227);
  cursor: pointer;
  border: 2px solid var(--bg-main, #fff);
}
.import-timeline-loop-range {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: rgba(13, 148, 136, 0.35);
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}
.import-timeline-times {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.import-time-display {
  font-variant-numeric: tabular-nums;
}
.import-time-sep {
  margin: 0 0.25rem;
  color: var(--text-muted);
}
.import-loop-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.import-loop-inline .import-time-inline {
  width: 4.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
}
.import-analyze-block {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.import-backend-hint {
  width: 100%;
  margin: 0 0 0.25rem 0;
}
.import-backend-hint:not(.hidden) {
  color: var(--color-warning, #b8860b);
}
.import-analyze-block .import-analyze-btn {
  flex-shrink: 0;
}
.import-analyze-status {
  flex-shrink: 0;
}
.import-analyze-result {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
}
.import-analyze-result .import-analyze-key,
.import-analyze-result .import-analyze-tempo,
.import-analyze-result .import-analyze-segment {
  margin: 0;
}
.import-studio-playback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-subtle, #e0e6f0);
}
.import-playback-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.import-playback-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--card-bg-secondary, #f0f4fb);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.import-playback-btn:hover {
  background: var(--accent-cyan, #0d9488);
  color: #fff;
  border-color: var(--accent-cyan);
}
.import-playback-play {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  background: linear-gradient(180deg, #5eead4 0%, #2dd4bf 100%);
  color: #13403c;
  border-color: var(--accent-cyan);
}
.import-playback-play:hover {
  background: linear-gradient(180deg, #67ebe0 0%, #34e0cc 100%);
  color: #0f2927;
}
.import-playback-time {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.import-control-row {
  margin-bottom: 1rem;
}
.import-control-block {
  background: var(--card-bg-secondary, #f0f4fb);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle, #e0e6f0);
}
[data-theme="dark"] .import-control-block {
  background: var(--card-bg-secondary);
  border-color: var(--border-subtle);
}
.import-control-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.import-control-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.import-control-value {
  min-width: 2.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}
.import-slider {
  flex: 1;
  min-width: 80px;
  max-width: 200px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--slider-track, #c8d4e8);
  border-radius: 3px;
}
.import-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-gold, #c9a227);
  cursor: pointer;
  border: 2px solid var(--bg-main, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.import-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-gold, #c9a227);
  cursor: pointer;
  border: 2px solid var(--bg-main, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.import-btn-inc {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #c8d4e8);
  background: var(--bg-main, #fff);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.import-btn-inc:hover {
  background: var(--card-bg-secondary, #e8ecf4);
  border-color: var(--accent-cyan, #0d9488);
}
.import-btn-reset {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.import-btn-reset:hover {
  background: var(--card-bg-secondary);
  color: var(--text-main);
}
.import-loop-row .import-control-block {
  padding: 1rem;
}
.import-loop-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.import-loop-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
}
.import-loop-checkbox {
  width: 1.1rem;
  height: 1.1rem;
}
.import-loop-times {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.import-loop-time-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.import-loop-time-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.import-time-input {
  width: 5.5rem;
  padding: 0.35rem 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--text-main);
}
.import-loop-sep {
  color: var(--text-muted);
  margin-top: 1.1rem;
}
.import-use-segment-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}
.import-controls-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}
.import-practice-link-desc {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 520px;
}

/* Import page: "Abrir no Studio de Prática" as prominent button */
.import-controls-actions .btn.primary,
.import-controls-actions a.primary,
#importOpenPracticeLink.btn.primary {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--accent-cyan, #0d9488);
  background: linear-gradient(180deg, #5eead4 0%, #2dd4bf 100%);
  color: #13403c;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.import-controls-actions .btn.primary:hover,
.import-controls-actions a.primary:hover,
#importOpenPracticeLink.btn.primary:hover {
  background: linear-gradient(180deg, #67ebe0 0%, #34e0cc 100%);
  border-color: #0d9488;
  color: #0f2927;
  text-decoration: none;
  transform: translateY(-1px);
}
[data-theme="dark"] .import-controls-actions .btn.primary,
[data-theme="dark"] .import-controls-actions a.primary,
body[data-theme="dark"] #importOpenPracticeLink.btn.primary {
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%);
  color: #ccfbf1;
  border-color: #14b8a6;
}
[data-theme="dark"] .import-controls-actions .btn.primary:hover,
[data-theme="dark"] .import-controls-actions a.primary:hover,
body[data-theme="dark"] #importOpenPracticeLink.btn.primary:hover {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  color: #f0fdfa;
}

/* Import page: Settings (collapsible) */
.import-settings-card {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, #e0e6f0);
}
.import-settings-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  list-style: none;
}
.import-settings-summary::-webkit-details-marker {
  display: none;
}
.import-settings-summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  transition: transform 0.2s;
}
.import-settings-card[open] .import-settings-summary::before {
  transform: rotate(90deg);
}
.import-settings-inner {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.import-setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  align-items: center;
}
.import-setting-label,
.import-setting-toggle-label {
  font-weight: 500;
  color: var(--text-main);
}
.import-setting-desc {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}
.import-setting-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.import-setting-toggle {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent-cyan, #0d9488);
}
.import-setting-select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-subtle, #e0e6f0);
  border-radius: 6px;
  background: var(--bg-elevated, #fff);
  color: var(--text-main);
  font-size: 0.9rem;
}

/* Import page: single-column layout so result + embed + controls stack (no misalignment) */
.import-page-layout {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}
.import-page-layout .card {
  width: 100%;
}

/* Result of analysis inline inside the analyze card */
.import-result-inline {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, #e0e6f0);
}
.import-result-inline-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text-main);
}

.import-embed-unavailable-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* When embed may be unavailable (e.g. YouTube): show alternative and CTA */
.import-embed-when-unavailable {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-elevated, #f1f5f9);
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
}
[data-theme="dark"] .import-embed-when-unavailable {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}
.import-embed-when-unavailable .import-embed-unavailable-hint {
  margin-top: 0;
}
.import-embed-when-unavailable .import-embed-upload-hint {
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-main);
}
.import-upload-trigger {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Drills page result */
.drills-result-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-main);
  line-height: 1.6;
}
.drills-result-list li {
  margin-bottom: 0.5rem;
}

/* Lessons page layout and style grid */
.lessons-page .layout {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: minmax(280px, 0.38fr) 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem 1rem 2rem;
}
.lessons-page .layout > .card:first-child {
  min-width: 0;
}
.lessons-page .layout > .page-status-message {
  grid-column: 1 / -1;
}
.lessons-page .lessons-style-grid {
  min-width: 0;
}
@media (max-width: 820px) {
  .lessons-page .layout {
    grid-template-columns: 1fr;
  }
}

.lessons-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0;
}
.lessons-style-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  text-decoration: none;
  color: var(--text-main);
}
.lessons-style-card:hover {
  border-color: var(--accent-cyan);
}
.lessons-style-name {
  font-size: 1rem;
}
.lessons-style-desc {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}
.lessons-style-cta {
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

/* Pitch tuner & interval training */
.pitch-meter-wrap {
  margin: 1rem 0 1.25rem;
  text-align: center;
}
.pitch-meter-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b7cfa 0%, #94a3b8 45%, #22c55e 50%, #94a3b8 55%, #f59e0b 100%);
  opacity: 0.85;
  margin: 0 auto;
  max-width: 420px;
}
.pitch-meter-center {
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  transform: translateX(-50%);
}
.pitch-meter-needle {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 24px;
  margin-left: -2px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: left 0.08s linear, background 0.15s ease;
}
.pitch-meter-needle.in-tune {
  background: #22c55e;
}
.pitch-meter-needle.sharp {
  background: #f59e0b;
}
.pitch-meter-needle.flat {
  background: #60a5fa;
}
.pitch-meter-labels {
  display: flex;
  justify-content: space-between;
  max-width: 420px;
  margin: 0.35rem auto 0;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}
.pitch-readout {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.85rem;
  align-items: center;
}
.pitch-note-display {
  font-size: 2rem;
  letter-spacing: 0.02em;
}
.pitch-intune-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  font-size: 0.85rem;
  font-weight: 600;
}
.pitch-ref-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pitch-ref-key {
  min-width: 2.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: inherit;
  cursor: pointer;
  font-size: 0.8rem;
}
.pitch-ref-key:hover {
  border-color: var(--accent-cyan, #22d3ee);
}
.pitch-ref-key.blackish {
  background: rgba(30, 41, 59, 0.85);
}
.pitch-feedback-panel {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.25);
}
.pitch-feedback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
}
.pitch-feedback-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.interval-prompt {
  font-size: 1.35rem;
  font-weight: 650;
  margin: 0 0 0.5rem;
  line-height: 1.35;
  text-align: center;
  min-height: 2.4em;
}
.interval-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin: 0.85rem 0 0.25rem;
  min-height: 3rem;
}
.interval-choice-btn {
  padding: 0.75rem 0.9rem;
  min-height: 2.75rem;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--bg-elev-strong);
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
}
.interval-choice-btn:hover {
  border-color: var(--line-strong);
}
.interval-choice-btn.correct {
  border-color: var(--accent-mint);
  background: rgba(95, 159, 138, 0.18);
}
.interval-choice-btn.wrong {
  border-color: #c07070;
  background: rgba(192, 112, 112, 0.12);
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.interval-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 0.75rem;
}
.interval-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem 0.65rem;
}
.interval-pick-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.2rem;
}
.interval-pick-item input {
  accent-color: var(--accent-cyan);
}
.interval-audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}
.interval-volume-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.interval-volume-label input[type="range"] {
  width: 120px;
}
.root-pad-toggle {
  margin-top: 0.65rem;
}
@media (max-width: 640px) {
  .pitch-note-display {
    font-size: 1.6rem;
  }
}

/* Pitch / interval practice-first layout */
.pitch-layout,
.interval-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  align-items: start;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.interval-stage-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.interval-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid var(--line-soft);
}
.interval-mode-tab {
  border: 0;
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}
.interval-mode-tab.is-active {
  background: var(--bg-elev);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
}
.interval-stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.35rem 0 0.15rem;
}
.interval-stage .pitch-meter-wrap {
  margin: 0.35rem 0;
}
.interval-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 0.65rem;
}
.interval-play-btn {
  min-width: 8.5rem;
  min-height: 2.75rem;
  font-size: 1.05rem;
}
.interval-mic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px dashed var(--line-soft);
  background: rgba(15, 23, 42, 0.18);
}
.interval-session-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}
.interval-score-row {
  margin: 0;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}
.interval-score-row strong {
  font-size: 1.2rem;
}
.interval-breakdown-details,
.interval-settings {
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(15, 23, 42, 0.16);
  padding: 0.55rem 0.75rem;
}
.interval-breakdown-details summary,
.interval-settings summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  list-style: none;
}
.interval-breakdown-details summary::-webkit-details-marker,
.interval-settings summary::-webkit-details-marker {
  display: none;
}
.interval-breakdown-details summary::before,
.interval-settings summary::before {
  content: "▸";
  color: var(--accent-cyan);
}
.interval-breakdown-details[open] summary::before,
.interval-settings[open] summary::before {
  content: "▾";
}
.interval-breakdown-details[open] summary,
.interval-settings[open] summary {
  margin-bottom: 0.65rem;
}
.interval-breakdown-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.interval-breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.28);
}
.interval-breakdown-list li.needs-work {
  border-left: 3px solid #c9a227;
}
.interval-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.interval-settings-subhead {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.98rem;
}
.interval-runs-tip,
.interval-privacy {
  margin: 0.65rem 0 0;
}
.pitch-main-card .pitch-meter-wrap {
  margin: 0.75rem 0 1rem;
}
.pitch-main-card .pitch-readout {
  margin-top: 0.75rem;
}
.pitch-main-card .button-row {
  justify-content: center;
  margin-top: 0.25rem;
}
.home-nav-group {
  margin: 0 0 1.25rem;
}
.home-nav-group .home-section-head {
  margin-bottom: 0.75rem;
}
.home-nav-group .home-section-head h2 {
  font-size: 1.15rem;
}
@media (max-width: 900px) {
  .pitch-layout,
  .interval-layout {
    grid-template-columns: 1fr;
  }
  .interval-settings-grid {
    grid-template-columns: 1fr;
  }
  .interval-choices {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.65rem;
  }
  .interval-choice-btn {
    min-height: 3.15rem;
    padding: 0.9rem 1rem;
    font-size: 1rem;
  }
  .interval-mode-tab {
    min-height: 2.85rem;
    padding: 0.75rem 0.65rem;
  }
  .interval-settings-card {
    position: sticky;
    bottom: 0.5rem;
    z-index: 5;
  }
  .interval-settings {
    box-shadow: 0 -8px 28px rgba(2, 8, 23, 0.35);
  }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 920px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pricing-card-pro {
  border-color: rgba(34, 211, 238, 0.45);
}
.pricing-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.pricing-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  flex: 1;
}
.billing-pricing-grid {
  margin: 0.75rem 0 0;
  padding: 0;
  max-width: none;
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.9rem;
}
.site-footer a {
  color: inherit;
  opacity: 0.85;
}
.legal-layout {
  max-width: 720px;
  margin: 0 auto;
}
.legal-card h2 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

/* Marketing landing — Free vs Pro */
.landing-page .landing-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}
.landing-hero {
  text-align: center;
  padding: 2.25rem 1rem 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(126, 162, 214, 0.18), transparent 70%),
    var(--bg-elev);
  border: 1px solid var(--line-soft);
}
.landing-hero h2 {
  margin: 0.65rem auto 0.75rem;
  max-width: 18ch;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.landing-hero-sub {
  max-width: 42rem;
  margin: 0 auto 1.35rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
.landing-hero-actions {
  justify-content: center;
}
.landing-section {
  margin: 2rem 0 2.5rem;
}
.landing-section-title {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  text-align: center;
}
.landing-section-sub {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 1.25rem;
}
.landing-compare {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-elev);
}
.landing-compare-head,
.landing-compare-row,
.landing-compare-cta-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}
.landing-compare-head {
  background: var(--bg-elev-strong);
  font-weight: 650;
  border-bottom: 1px solid var(--line-soft);
}
.landing-compare-feature,
.landing-compare-plan {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
}
.landing-compare-head .landing-compare-feature,
.landing-compare-head .landing-compare-plan {
  border-bottom-color: var(--line-strong);
}
.landing-compare-pro {
  background: rgba(126, 162, 214, 0.08);
}
.landing-compare-row:last-of-type .landing-compare-feature,
.landing-compare-row:last-of-type .landing-compare-plan {
  border-bottom: 0;
}
.landing-compare-cta-row .landing-compare-feature,
.landing-compare-cta-row .landing-compare-plan {
  border-bottom: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  align-items: stretch;
}
.landing-compare-cta-row .hero-btn {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.landing-try-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.landing-try-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  padding: 1rem 1.1rem;
  transition: border-color 0.15s ease;
}
.landing-try-card:hover {
  border-color: var(--line-strong);
}
.landing-workspace-link {
  text-align: center;
  margin: 1.25rem 0 0;
}
.landing-workspace-link a {
  color: var(--accent-cyan);
}
.landing-plan-label {
  display: none;
}
@media (max-width: 700px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .landing-compare-head {
    display: none;
  }
  .landing-compare-row,
  .landing-compare-cta-row {
    grid-template-columns: 1fr;
  }
  .landing-compare-row .landing-compare-feature {
    font-weight: 600;
    border-bottom: 0;
    padding-bottom: 0.2rem;
  }
  .landing-compare-row .landing-compare-plan {
    padding-top: 0.25rem;
    gap: 0.45rem;
  }
  .landing-plan-label {
    display: inline;
    font-weight: 650;
    color: var(--text-muted);
    margin-right: 0.35rem;
  }
  .landing-plan-label::after {
    content: ":";
  }
  .landing-try-grid {
    grid-template-columns: 1fr;
  }
}
