:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #63716b;
  --line: #dce4df;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --mint: #1e8a75;
  --mint-dark: #126654;
  --coral: #df5d49;
  --amber: #d5962c;
  --blue: #276f98;
  --soft-mint: #e6f3ef;
  --soft-coral: #fae9e5;
  --soft-amber: #fff2d6;
  --shadow: 0 18px 48px rgba(22, 35, 30, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(30, 138, 117, 0.08), transparent 32%),
    linear-gradient(180deg, #f7faf7 0%, #eef5f1 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(340px, 1fr) minmax(300px, 380px);
  gap: 18px;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.rail,
.coach-panel {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--mint);
  color: white;
  font-weight: 900;
  font-size: 25px;
}

h1,
p {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.1;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.today-panel,
.account-panel,
.tool-block,
.lesson-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(22, 35, 30, 0.06);
}

.today-panel {
  padding: 14px;
}

.payment-entry {
  margin-top: 10px;
}

/* 会员入口降级为中性描边，把红色留给"此刻该点"的练习主按钮 */
.payment-entry.primary-action {
  border: 1px solid rgba(213, 150, 44, 0.5);
  background: var(--soft-amber);
  color: var(--amber);
}

.payment-entry.primary-action:hover {
  border-color: var(--amber);
  background: #ffe9bd;
}

/* 今日任务是侧栏主线，给它主色以形成单一视觉重心 */
#startDailyBtn.secondary-action {
  border-color: transparent;
  background: var(--mint);
  color: white;
}

#startDailyBtn.secondary-action:hover {
  background: var(--mint-dark);
}

.account-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
}

.account-summary {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.account-summary strong {
  font-size: 15px;
}

.account-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f2f6f3;
}

.auth-mode {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-mode.active {
  background: var(--mint);
  color: white;
}

.auth-mode-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-form,
.account-list {
  display: grid;
  gap: 8px;
}

.account-form input,
.account-form select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
  font: inherit;
}

.account-list {
  max-height: 150px;
  overflow: auto;
}

.account-sync {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.account-sync > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-sync > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-sync .secondary-action {
  min-height: 36px;
  font-size: 12px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 7px;
}

.account-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
}

.account-chip.active {
  border-color: rgba(30, 138, 117, 0.45);
  background: var(--soft-mint);
}

.account-chip strong,
.account-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip span {
  color: var(--muted);
  font-size: 12px;
}

.account-chip b {
  color: var(--mint-dark);
  font-size: 12px;
}

.account-delete {
  border: 1px solid rgba(223, 93, 73, 0.24);
  border-radius: 8px;
  background: var(--soft-coral);
  color: #8a2d20;
  font-size: 12px;
  font-weight: 900;
}

.role-dashboard {
  display: grid;
  gap: 10px;
}

.role-dashboard-summary,
.cloud-snapshot-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.role-dashboard-summary strong,
.cloud-snapshot-box strong {
  color: var(--ink);
}

.role-dashboard-cards {
  display: grid;
  gap: 8px;
}

.role-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.role-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.role-card strong,
.role-card span,
.role-card p {
  min-width: 0;
}

.role-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.role-card .tag-row {
  margin: 0;
}

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

.role-metrics span {
  min-width: 0;
  padding: 6px;
  border-radius: 8px;
  background: var(--soft-mint);
  color: var(--muted);
  font-size: 11px;
}

.role-metrics b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
}

.assignment-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(39, 111, 152, 0.22);
  border-radius: 8px;
  background: #f7faf7;
}

.assignment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assignment-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.assignment-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.assignment-actions,
.assignment-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

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

.assignment-list {
  display: grid;
  gap: 7px;
}

.assignment-card {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: white;
}

.assignment-card.done {
  border-left-color: var(--mint);
}

.assignment-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.assignment-card header strong {
  color: var(--ink);
  font-size: 13px;
}

.assignment-card header span {
  flex: 0 0 auto;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
}

.assignment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.coach-prescription {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(22, 35, 30, 0.06);
}

.prescription-focus {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.prescription-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 64px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--ink);
  text-align: left;
}

.prescription-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: white;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 900;
}

.prescription-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.prescription-copy strong,
.prescription-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prescription-copy strong {
  font-size: 13px;
}

.prescription-copy small {
  color: var(--muted);
  font-size: 12px;
}

.prescription-item b {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--soft-mint);
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.prescription-item.urgent {
  border-color: rgba(223, 93, 73, 0.34);
  background: linear-gradient(90deg, var(--soft-coral), #fff);
}

.prescription-item.warm {
  border-color: rgba(213, 150, 44, 0.34);
  background: linear-gradient(90deg, var(--soft-amber), #fff);
}

.prescription-item.blue {
  border-color: rgba(39, 111, 152, 0.28);
  background: linear-gradient(90deg, rgba(39, 111, 152, 0.11), #fff);
}

.prescription-item.urgent .prescription-rank,
.prescription-item.urgent b {
  background: var(--soft-coral);
  color: #8a2d20;
}

.prescription-item.warm .prescription-rank,
.prescription-item.warm b {
  background: var(--soft-amber);
  color: #7a4b0c;
}

.prescription-item.blue .prescription-rank,
.prescription-item.blue b {
  background: rgba(39, 111, 152, 0.13);
  color: var(--blue);
}

.practice-loop-panel {
  border-color: rgba(30, 138, 117, 0.2);
  background:
    linear-gradient(180deg, rgba(230, 243, 239, 0.72), rgba(255, 255, 255, 0.95)),
    white;
}

.loop-focus {
  display: grid;
  gap: 10px;
}

.loop-current {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(30, 138, 117, 0.18);
  border-radius: 8px;
  background: white;
}

.loop-current span,
.loop-current small,
.loop-focus p,
.loop-last {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.loop-current strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

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

.loop-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  text-align: center;
}

.loop-metrics b {
  color: var(--mint-dark);
  font-size: 16px;
}

.loop-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.loop-timeline {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.loop-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 4px 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
}

.loop-step span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #edf4f1;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
}

.loop-step strong,
.loop-step small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loop-step strong {
  font-size: 13px;
}

.loop-step small {
  color: var(--muted);
  font-size: 12px;
}

.loop-step.active {
  border-color: rgba(30, 138, 117, 0.42);
  box-shadow: inset 3px 0 0 var(--mint);
}

.loop-step.done span {
  background: var(--mint);
  color: white;
}

.oral-sprint-panel {
  border-color: rgba(39, 111, 152, 0.24);
  background:
    linear-gradient(180deg, rgba(39, 111, 152, 0.08), rgba(255, 255, 255, 0.96)),
    white;
}

.oral-sprint-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.oral-sprint-stats span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  text-align: center;
}

.oral-sprint-stats b,
.oral-sprint-stats small {
  display: block;
}

.oral-sprint-stats b {
  color: var(--blue);
  font-size: 17px;
}

.oral-sprint-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.oral-sprint-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.oral-sprint-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid rgba(39, 111, 152, 0.55);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.oral-sprint-card:hover {
  border-color: rgba(39, 111, 152, 0.45);
  background: rgba(39, 111, 152, 0.08);
}

.oral-sprint-card span,
.oral-sprint-card small,
.oral-sprint-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.oral-sprint-card span {
  font-weight: 900;
}

.oral-sprint-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.oral-sprint-card small {
  overflow-wrap: anywhere;
}

.oral-sprint-card em {
  font-style: normal;
  font-weight: 900;
}

.phrase-panel {
  border-color: rgba(30, 138, 117, 0.24);
  background:
    linear-gradient(180deg, rgba(30, 138, 117, 0.08), rgba(255, 255, 255, 0.98)),
    white;
}

.phrase-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.phrase-stats span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: center;
}

.phrase-stats b,
.phrase-stats small {
  display: block;
}

.phrase-stats b {
  color: var(--green);
  font-size: 16px;
}

.phrase-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.phrase-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.phrase-filter {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.phrase-filter.active {
  border-color: rgba(30, 138, 117, 0.5);
  background: var(--soft-mint);
  color: var(--green);
}

.phrase-list {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding-right: 2px;
}

.phrase-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.phrase-card.active {
  border-color: rgba(30, 138, 117, 0.55);
  background: var(--soft-mint);
}

.phrase-card span,
.phrase-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.phrase-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.phrase-preview {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(30, 138, 117, 0.2);
  border-radius: 8px;
  background: white;
}

.phrase-preview strong {
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.phrase-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.phrase-swap-row,
.phrase-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phrase-swap-row button,
.phrase-tag-row span {
  padding: 5px 8px;
  border: 1px solid rgba(30, 138, 117, 0.2);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.phrase-swap-row button:hover {
  border-color: rgba(30, 138, 117, 0.45);
  color: var(--green);
}

.learning-plan {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(22, 35, 30, 0.06);
}

.plan-goal {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.plan-steps {
  display: grid;
  gap: 8px;
}

.plan-step {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--ink);
  text-align: left;
}

.plan-step span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: white;
  color: var(--mint-dark);
  font-weight: 900;
  font-size: 12px;
}

.plan-step strong,
.plan-step small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-step strong {
  font-size: 13px;
}

.plan-step small {
  color: var(--muted);
  font-size: 12px;
}

.plan-step.active {
  border-color: rgba(223, 93, 73, 0.42);
  background: var(--soft-coral);
}

.plan-step.done span {
  background: var(--mint);
  color: white;
}

.today-panel > div:first-child,
.block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--amber));
  transition: width 220ms ease;
}

.mini-stats,
.report-grid {
  display: grid;
  gap: 8px;
}

.mini-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.mini-stats span,
.report-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 12px;
}

.mini-stats b,
.report-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.difficulty-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 14px;
}

.filter-button,
.difficulty-filter,
.secondary-action,
.primary-action,
.icon-button,
.mini-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
}

.mini-action {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.filter-button {
  padding: 0 8px;
  font-size: 13px;
}

.difficulty-filter {
  min-width: 0;
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.filter-button.active,
.difficulty-filter.active {
  border-color: rgba(30, 138, 117, 0.45);
  background: var(--soft-mint);
  color: var(--mint-dark);
}

.search-wrap input,
.custom-form input,
.chat-input-row input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

.search-wrap input,
.custom-form input,
.chat-input-row input {
  height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 82px;
  padding: 10px 12px;
}

.lesson-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 196px);
  margin-top: 14px;
  overflow: auto;
  padding-right: 4px;
}

.empty-list {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lesson-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.lesson-item.active {
  outline: 2px solid rgba(30, 138, 117, 0.36);
}

.lesson-thumb {
  width: 58px;
  height: 70px;
  overflow: hidden;
  border-radius: 8px;
  background: #d7e9e1;
}

.lesson-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lesson-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #c6d3cc;
}

.status-dot.done {
  background: var(--mint);
}

.status-dot.weak {
  background: var(--coral);
}

.practice-area {
  display: grid;
  align-items: start;
  justify-items: center;
  min-width: 0;
}

.phone-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  width: min(440px, 100%);
  height: min(840px, calc(100vh - 36px));
  min-height: 620px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: #101a17;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lesson-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  color: white;
}

.lesson-image {
  position: absolute;
  inset: 0;
  background: #1d2b26;
}

.lesson-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95) contrast(1.03);
}

.lesson-image::after {
  content: "";
  position: absolute;
  inset: 0;
  /* 底图先整体压暗一层，再叠自下而上的渐变，保证白字在任何照片上都够对比 */
  background:
    linear-gradient(180deg, rgba(6, 10, 9, 0.32) 0%, rgba(6, 10, 9, 0.52) 46%, rgba(6, 10, 9, 0.92) 100%),
    rgba(6, 10, 9, 0.18);
}

.card-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 14px;
  height: 100%;
  padding: 22px;
  overflow: auto;
  scrollbar-width: none;
}

.card-content::-webkit-scrollbar {
  display: none;
}

.scenario-card-content {
  align-content: start;
  gap: 14px;
}

.scenario-card-content .english-line {
  font-size: 28px;
}

.scenario-card-brief {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 16, 14, 0.32);
  backdrop-filter: blur(8px);
}

.scenario-card-brief span,
.scenario-card-brief strong {
  overflow-wrap: anywhere;
}

.scenario-card-brief span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.scenario-card-brief strong {
  color: white;
  font-size: 13px;
  line-height: 1.4;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-topline > span {
  flex: 0 0 auto;
  max-width: 120px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-mode-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(280px, 100%);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.card-mode-switch button {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 900;
}

.speech-card-content .english-line {
  font-size: 25px;
}

.card-mode-switch button.active {
  background: rgba(255, 255, 255, 0.9);
  color: #17211d;
}

.tag {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 800;
}

.difficulty-tag.basic {
  border-color: rgba(30, 138, 117, 0.42);
  background: rgba(230, 243, 239, 0.24);
}

.difficulty-tag.practical {
  border-color: rgba(213, 150, 44, 0.5);
  background: rgba(255, 242, 214, 0.26);
}

.difficulty-tag.challenge {
  border-color: rgba(223, 93, 73, 0.5);
  background: rgba(250, 233, 229, 0.24);
}

.card-content h2 {
  margin: 0;
  font-size: 20px;
}

.english-line {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 900;
  /* 跟读的核心是看清每个词，加一层文字阴影兜底可读性 */
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.65);
}

.chinese-line {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.english-line.medium-line {
  font-size: 28px;
  line-height: 1.15;
}

.english-line.long-line {
  font-size: 24px;
  line-height: 1.18;
}

.chinese-line {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.word-token {
  display: inline;
  padding: 0 1px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-align: inherit;
  cursor: pointer;
}

.word-token:hover,
.word-token:focus-visible {
  outline: none;
  background: rgba(255, 244, 216, 0.16);
  color: #fff4d8;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.chip .word-token:hover,
.chip .word-token:focus-visible,
.scenario-line .word-token:hover,
.scenario-line .word-token:focus-visible {
  background: rgba(30, 138, 117, 0.12);
  color: var(--mint-dark);
}

.word-lookup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 244, 216, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.word-lookup-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.word-lookup-copy span,
.word-lookup-copy small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.word-lookup-copy strong {
  color: #fff4d8;
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.word-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 6px;
}

.word-actions button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f1c19;
  font-size: 12px;
  font-weight: 900;
}

.word-actions button:hover {
  border-color: rgba(255, 244, 216, 0.65);
  background: #fff4d8;
}

.dialog-prompt {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.dialog-prompt > span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.dialog-prompt p {
  margin-top: 4px;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
}

.line-translation {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dialog-prompt .line-translation {
  color: rgba(255, 255, 255, 0.74);
}

.chunks {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chunk-button {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
}

.chunk-button:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
}

.chunks b {
  min-width: 0;
  color: #fff4d8;
  overflow-wrap: anywhere;
}

.chunks span {
  min-width: 0;
  text-align: left;
  color: rgba(255, 255, 255, 0.7);
  overflow-wrap: anywhere;
}

.card-practice-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.card-practice-stats span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.card-practice-stats b,
.card-practice-stats small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-practice-stats b {
  color: white;
  font-size: 14px;
  font-weight: 900;
}

.card-practice-stats small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 800;
}

.next-card-hint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.next-card-hint span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 900;
}

.next-card-hint strong {
  min-width: 0;
  overflow: hidden;
  color: white;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-controls {
  display: grid;
  grid-template-columns: 48px 58px minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 12px;
  background: #101a17;
}

.drill-panel {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  background: #101a17;
  color: white;
}

.drill-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drill-steps,
.caption-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.drill-panel .mini-action,
.caption-tools .mini-action {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
}

.drill-panel .mini-action.active {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(223, 93, 73, 0.84);
  color: white;
}

.practice-nudge {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.45;
}

.masked-line {
  display: inline-block;
  min-height: 1.1em;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0;
  filter: blur(3px);
}

.primary-action {
  border-color: transparent;
  background: var(--coral);
  color: white;
}

.primary-action:hover {
  background: #c84e3d;
}

.secondary-action:hover,
.icon-button:hover,
.filter-button:hover {
  border-color: rgba(30, 138, 117, 0.45);
}

.wide {
  width: 100%;
}

.coach-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding-right: 2px;
}

.tool-block {
  padding: 14px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 16px auto;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--mint) 0deg, var(--mint) 0deg, #e7eee9 0deg);
}

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

.recorder-actions,
.reply-chips,
.custom-form {
  display: grid;
  gap: 8px;
}

.recorder-actions {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}

.feedback-box {
  min-height: 72px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-amber);
  color: #5f4514;
  line-height: 1.5;
  font-size: 14px;
}

.feedback-box.compact {
  min-height: 44px;
}

.speech-feedback,
.feedback-lines {
  display: grid;
  gap: 9px;
}

.word-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-mark {
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #5f4514;
  font-size: 12px;
  font-weight: 900;
}

.word-mark.hit {
  background: rgba(30, 138, 117, 0.14);
  color: var(--mint-dark);
}

.word-mark.miss {
  background: rgba(223, 93, 73, 0.16);
  color: #8a2d20;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feedback-lines p {
  margin: 0;
}

.teacher-feedback {
  display: grid;
  gap: 10px;
}

.teacher-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.teacher-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.teacher-summary span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #5f4514;
  font-size: 12px;
  font-weight: 900;
}

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

.metric-grid.pronunciation-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid span {
  min-width: 0;
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 12px;
}

.metric-grid b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
}

.feedback-drill {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
}

.teacher-feedback p,
.teacher-feedback ul {
  margin: 0;
}

.teacher-feedback ul {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.teacher-feedback li {
  padding-left: 2px;
}

.teacher-feedback.pass .teacher-summary span {
  color: var(--mint-dark);
}

.teacher-feedback.retry .teacher-summary span {
  color: #8a2d20;
}

.quiz-prompt {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-mint);
  font-weight: 900;
  line-height: 1.45;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.word-chip {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
}

.review-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.review-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.review-item strong,
.review-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-item span {
  color: var(--muted);
  font-size: 12px;
}

.score-pill {
  align-self: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--soft-coral);
  color: #8a2d20;
  font-size: 12px;
  font-weight: 900;
}

.speech-topic-list,
.speech-segment-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.speech-topic,
.speech-segment {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--ink);
  text-align: left;
}

.speech-topic.active,
.speech-segment.active {
  border-color: rgba(30, 138, 117, 0.44);
  background: var(--soft-mint);
}

.speech-topic strong,
.speech-segment strong {
  font-size: 13px;
  line-height: 1.35;
}

.speech-topic span,
.speech-segment span,
.speech-segment small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.speech-phrase-pack {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.speech-phrase-pack button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(30, 138, 117, 0.22);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.speech-phrase-pack button:hover {
  border-color: rgba(30, 138, 117, 0.45);
  background: #f7faf7;
}

.speech-phrase-pack b {
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.speech-phrase-pack small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.weak-words-box {
  min-height: 32px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.weak-words-box b {
  display: inline-block;
  margin: 4px 5px 0 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft-coral);
  color: #8a2d20;
}

.membership-active {
  color: var(--mint-dark);
}

.membership-detail {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.membership-detail strong {
  font-size: 15px;
}

.membership-detail span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.payment-plans {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.payment-section {
  border-color: rgba(223, 93, 73, 0.28);
}

.legal-section {
  border-color: rgba(39, 111, 152, 0.24);
}

.payment-section.attention,
.legal-section.attention {
  animation: paymentPulse 1.8s ease;
}

@keyframes paymentPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(22, 35, 30, 0.06);
  }

  35% {
    box-shadow: 0 0 0 4px rgba(223, 93, 73, 0.16), 0 16px 36px rgba(223, 93, 73, 0.18);
  }
}

.payment-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
}

.payment-plan.featured {
  border-color: rgba(30, 138, 117, 0.45);
  background: var(--soft-mint);
}

.payment-plan span,
.payment-plan em {
  min-width: 0;
}

.payment-plan b,
.payment-plan small,
.payment-plan em {
  display: block;
}

.payment-plan small,
.payment-plan em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.payment-plan strong {
  color: var(--coral);
  font-size: 18px;
}

.payment-plan em {
  grid-column: 1 / -1;
  font-style: normal;
}

.payment-orders {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.legal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.legal-summary div,
.legal-summary p {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.legal-summary p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.legal-summary span,
.legal-item small,
.legal-item em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.legal-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.legal-checklist {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.legal-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.legal-item.accepted {
  border-color: rgba(30, 138, 117, 0.35);
  background: var(--soft-mint);
}

.legal-item input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

.legal-item span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.legal-item strong {
  color: var(--ink);
  font-size: 14px;
}

.legal-item em {
  font-style: normal;
  color: var(--mint-dark);
  font-weight: 800;
}

.launch-section {
  border-color: rgba(39, 111, 152, 0.22);
}

.launch-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.launch-summary div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.launch-summary span,
.launch-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.launch-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 18px;
}

.launch-checklist {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.launch-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: white;
}

.launch-item.ready {
  border-left-color: var(--mint);
}

.launch-item.partial {
  border-left-color: var(--amber);
}

.launch-item.blocked {
  border-left-color: var(--coral);
}

.launch-item strong {
  color: var(--ink);
  font-size: 14px;
}

.launch-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.launch-next-steps {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft-mint);
  color: var(--mint-dark);
}

.launch-next-steps strong {
  display: block;
  margin-bottom: 6px;
}

.launch-next-steps ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
}

.preflight-section {
  border-color: rgba(31, 126, 91, 0.22);
}

.preflight-checklist {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.preflight-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: white;
}

.preflight-item.ready {
  border-left-color: var(--mint);
}

.preflight-item.partial {
  border-left-color: var(--amber);
}

.preflight-item.blocked {
  border-left-color: var(--coral);
}

.preflight-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.preflight-item em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f5f1e7;
  color: var(--muted);
  font-style: normal;
}

.preflight-item.critical em {
  background: #ffe9e1;
  color: #9b3827;
}

.preflight-item strong {
  color: var(--ink);
  font-size: 14px;
}

.preflight-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.handoff-section {
  border-color: rgba(170, 118, 45, 0.24);
}

.handoff-groups {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.handoff-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: white;
}

.handoff-card.blocked {
  border-left-color: var(--coral);
}

.handoff-card.partial {
  border-left-color: var(--amber);
}

.handoff-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.handoff-card em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffe9e1;
  color: #9b3827;
  font-style: normal;
}

.handoff-card.partial em {
  background: #fff2c9;
  color: #8b641b;
}

.handoff-card strong {
  color: var(--ink);
  font-size: 14px;
}

.handoff-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.handoff-columns section {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.handoff-columns span {
  display: block;
  margin-bottom: 5px;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 900;
}

.handoff-columns ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .handoff-columns {
    grid-template-columns: 1fr;
  }
}

.production-config-section {
  border-color: rgba(73, 94, 160, 0.22);
}

.config-groups {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.config-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: white;
}

.config-card.ready {
  border-left-color: var(--mint);
}

.config-card.partial {
  border-left-color: var(--amber);
}

.config-card.blocked {
  border-left-color: var(--coral);
}

.config-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.config-card em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef1fb;
  color: #354473;
  font-style: normal;
}

.config-card strong {
  color: var(--ink);
  font-size: 14px;
}

.config-items {
  display: grid;
  gap: 6px;
}

.config-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.config-item span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.config-item b {
  color: var(--coral);
  font-size: 12px;
}

.config-item.configured b {
  color: var(--mint-dark);
}

.config-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.config-draft-input {
  width: 100%;
  min-height: 118px;
  margin: 4px 0 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.payment-order-heading {
  color: var(--muted);
  font-size: 12px;
}

.payment-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  font-size: 12px;
}

.payment-order span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-order b {
  color: var(--mint-dark);
}

.payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 16, 14, 0.58);
}

.payment-overlay[hidden] {
  display: none;
}

.payment-modal {
  width: min(390px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.payment-modal-info {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.payment-modal-info div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.payment-modal-info strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.payment-qr {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  width: 210px;
  height: 210px;
  margin: 12px auto 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.payment-qr span {
  border-radius: 2px;
  background: transparent;
}

.payment-qr span.on {
  background: #101a17;
}

.chat-box {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  margin: 12px 0;
}

.message {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.45;
  font-size: 14px;
}

.message.coach {
  justify-self: start;
  background: var(--soft-mint);
}

.message.user {
  justify-self: end;
  background: var(--soft-coral);
}

.pattern-bank {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.pattern-chip {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.pattern-chip.active {
  border-color: rgba(30, 138, 117, 0.45);
  background: var(--soft-mint);
}

.pattern-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pattern-chip strong {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pattern-preview {
  display: grid;
  gap: 4px;
  min-height: 58px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px dashed rgba(30, 138, 117, 0.38);
  border-radius: 8px;
  background: #f7faf7;
}

.pattern-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pattern-preview strong {
  color: var(--mint-dark);
  line-height: 1.4;
}

.say-idea-result {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.say-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(30, 138, 117, 0.28);
  border-radius: 8px;
  background: #f7faf7;
}

.say-card span,
.say-alt span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.say-card strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.say-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.say-chunk-list,
.say-alt-list {
  display: grid;
  gap: 8px;
}

.say-chunk,
.say-alt {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.say-chunk:hover,
.say-alt:hover {
  border-color: rgba(30, 138, 117, 0.45);
  background: var(--soft-mint);
}

.say-chunk b,
.say-alt strong {
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.say-chunk small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.say-idea-result .word-token:hover,
.say-idea-result .word-token:focus-visible {
  background: rgba(30, 138, 117, 0.12);
  color: var(--mint-dark);
}

.scenario-dialog {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

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

.scenario-brief div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.scenario-brief div.wide {
  grid-column: 1 / -1;
}

.scenario-brief span,
.scenario-brief strong {
  display: block;
  min-width: 0;
}

.scenario-brief span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.scenario-brief strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.scenario-grade-filter-row,
.scenario-filter-row,
.scenario-length-row,
.scenario-stats {
  display: grid;
  gap: 8px;
}

.scenario-filter-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.scenario-grade-filter-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.scenario-length-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.scenario-grade-filter-row + .scenario-filter-row {
  margin-top: 8px;
}

.scenario-grade-filter,
.scenario-filter,
.scenario-length {
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.scenario-grade-filter.active,
.scenario-filter.active,
.scenario-length.active {
  border-color: rgba(30, 138, 117, 0.45);
  background: var(--soft-mint);
  color: var(--mint-dark);
}

.scenario-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.scenario-stats span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 12px;
}

.scenario-stats b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.scenario-line {
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.45;
  font-size: 14px;
}

.scenario-line.role {
  background: var(--soft-mint);
}

.scenario-line.goal {
  border: 1px dashed rgba(30, 138, 117, 0.42);
  background: #f7faf7;
  color: var(--muted);
}

.scenario-line.previous {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.chip {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-align: left;
}

.chip strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chip .line-translation {
  margin-top: 0;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  margin-top: 10px;
}

.custom-form {
  margin-top: 12px;
}

.library-notice {
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recording {
  border-color: rgba(223, 93, 73, 0.55);
  background: var(--soft-coral);
  color: #8a2d20;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 260px minmax(340px, 1fr);
  }

  .coach-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .practice-area {
    order: 1;
  }

  .rail {
    order: 2;
  }

  .coach-panel {
    order: 3;
  }

  .rail,
  .coach-panel {
    margin-top: 12px;
  }

  .lesson-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .lesson-item {
    grid-template-columns: 52px 160px 12px;
    min-width: 250px;
  }

  .phone-stage {
    width: 100%;
    height: min(820px, calc(100vh - 20px));
    min-height: 700px;
  }

  .english-line {
    font-size: 27px;
  }

  .card-content {
    align-content: start;
    gap: 12px;
  }

  .coach-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

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

@media (max-width: 420px) {
  .filter-row,
  .difficulty-filter-row,
  .scenario-grade-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-content {
    padding: 18px;
  }

  .phone-stage {
    min-height: 680px;
  }

  .english-line {
    font-size: 24px;
  }

  .word-lookup-card {
    grid-template-columns: 1fr;
  }

  .word-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-practice-stats {
    gap: 6px;
  }

  .card-practice-stats span,
  .next-card-hint {
    padding: 7px 8px;
  }

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

  .loop-timeline {
    grid-template-columns: 1fr;
  }
}

/* Primary workspaces keep student practice separate from reports and operations. */
.workspace-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 9px max(18px, calc((100vw - 1404px) / 2));
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
  background: rgba(251, 252, 250, 0.96);
  box-shadow: 0 8px 24px rgba(22, 35, 30, 0.06);
  backdrop-filter: blur(14px);
}

.workspace-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.workspace-brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--mint);
  color: white;
  font-size: 20px;
  font-weight: 900;
}

.workspace-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.workspace-brand strong {
  font-size: 14px;
  line-height: 1.2;
}

.workspace-brand small {
  color: var(--muted);
  font-size: 11px;
}

.workspace-tabs {
  display: flex;
  min-width: 0;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f6f3;
  scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.workspace-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.workspace-tab:hover {
  color: var(--mint-dark);
  background: rgba(255, 255, 255, 0.72);
}

.workspace-tab.active {
  background: var(--panel);
  color: var(--mint-dark);
  box-shadow: 0 2px 8px rgba(22, 35, 30, 0.1);
}

[data-workspace][hidden] {
  display: none !important;
}

body:not([data-workspace="practice"]) .app-shell {
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 64px);
}

body:not([data-workspace="practice"]) .coach-panel {
  grid-column: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
}

body[data-workspace="scenario"] .coach-panel,
body[data-workspace="speech"] .coach-panel {
  grid-template-columns: minmax(0, 1fr);
}

body[data-workspace="scenario"] .coach-panel > .tool-block,
body[data-workspace="speech"] .coach-panel > .tool-block {
  width: min(840px, 100%);
}

body[data-workspace="account"] .rail {
  display: grid;
  gap: 14px;
}

body[data-workspace="account"] .account-panel {
  margin-top: 0;
}

body[data-workspace="practice"] .phone-stage {
  height: min(840px, calc(100vh - 100px));
}

@media (max-width: 900px) {
  .workspace-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    padding: 8px 10px;
  }

  .workspace-brand {
    display: none;
  }

  .workspace-tabs {
    width: 100%;
  }

  body:not([data-workspace="practice"]) .app-shell {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  body:not([data-workspace="practice"]) .rail,
  body:not([data-workspace="practice"]) .coach-panel {
    width: 100%;
  }

  body:not([data-workspace="practice"]):not([data-workspace="account"]) .coach-panel {
    order: 1;
  }

  body:not([data-workspace="practice"]):not([data-workspace="account"]) .rail {
    order: 2;
  }

  body:not([data-workspace="practice"]) .coach-panel {
    grid-template-columns: 1fr;
  }

  body[data-workspace="practice"] .phone-stage {
    height: min(820px, calc(100vh - 72px));
  }
}

@media (max-width: 420px) {
  .workspace-tab {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }
}
