:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #17212f;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #d7dee7;
  --navy: #172b4d;
  --blue: #2563eb;
  --teal: #0f766e;
  --teal-soft: #e6f4f1;
  --amber: #b45309;
  --amber-soft: #fff4df;
  --red: #b42318;
  --red-soft: #fef0ef;
  --green: #15803d;
  --green-soft: #eaf7ef;
  --shadow: 0 8px 24px rgba(23, 43, 77, 0.08);
  --radius: 8px;
  --sidebar: 240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

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

button {
  border: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

#app {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  transform: translate(-50%, 16px);
  min-width: 220px;
  max-width: min(90vw, 440px);
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  font-size: 14px;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Auth */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(360px, 0.85fr);
  min-height: 100vh;
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px clamp(32px, 6vw, 88px);
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}

.auth-story::after {
  content: "CET";
  position: absolute;
  right: -26px;
  bottom: -58px;
  color: rgba(255, 255, 255, 0.055);
  font-size: clamp(160px, 26vw, 360px);
  font-weight: 900;
  letter-spacing: -16px;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--teal);
  color: #fff;
  font-size: 15px;
}

.auth-story h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-story p {
  max-width: 520px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  line-height: 1.8;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.auth-proof span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-panel {
  display: grid;
  align-items: center;
  padding: 32px;
  background: var(--surface);
}

.auth-box {
  width: min(100%, 420px);
  margin: 0 auto;
}

.auth-box h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.auth-box > p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  font-size: 15px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.field textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.65;
}

.form-error {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

.auth-switch {
  margin-top: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: 0.16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-amber {
  background: var(--amber);
  color: #fff;
}

.btn-outline {
  border-color: var(--line);
  background: var(--surface);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

/* Shell */
.app-shell {
  min-height: 100vh;
  padding-left: var(--sidebar);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  padding: 22px 16px;
  background: var(--navy);
  color: #fff;
}

.sidebar .brand {
  padding: 0 8px 24px;
  font-size: 19px;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}

.side-link i {
  width: 18px;
  text-align: center;
}

.side-link:hover,
.side-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.side-link.active {
  box-shadow: inset 3px 0 var(--teal);
}

.sidebar-goal {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-goal small {
  color: rgba(255, 255, 255, 0.58);
}

.sidebar-goal strong {
  display: block;
  margin: 4px 0 10px;
  font-size: 16px;
}

.sidebar-goal .goal-days {
  color: #7dd3c7;
  font-size: 12px;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title strong {
  display: block;
  font-size: 17px;
}

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

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

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
}

.page {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 28px 30px 56px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: 0;
}

.page-head p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.mobile-nav {
  display: none;
}

/* Dashboard */
.brief {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
}

.brief h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0;
}

.brief p {
  max-width: 650px;
  margin: 10px 0 18px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

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

.brief-score {
  display: grid;
  align-content: center;
  gap: 4px;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.brief-score small {
  color: rgba(255, 255, 255, 0.62);
}

.brief-score strong {
  color: #7dd3c7;
  font-size: 38px;
  line-height: 1;
}

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

.metric {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.metric strong {
  display: block;
  margin: 9px 0 5px;
  font-size: 25px;
  letter-spacing: 0;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

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

.panel-body {
  padding: 16px 18px;
}

.mission-list {
  display: grid;
}

.mission {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.mission:last-child {
  border-bottom: 0;
}

.mission-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--teal);
}

.mission.done .mission-icon {
  background: var(--green-soft);
  color: var(--green);
}

.mission-title {
  font-size: 14px;
  font-weight: 700;
}

.mission-meta {
  display: flex;
  gap: 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.mission-progress {
  width: 100%;
  max-width: 220px;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8edf2;
}

.mission-progress span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.skill-list {
  display: grid;
  gap: 14px;
}

.skill-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar {
  height: 7px;
  overflow: hidden;
  border-radius: 5px;
  background: #e9edf2;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.bar.teal span {
  background: var(--teal);
}

.bar.amber span {
  background: var(--amber);
}

.focus-note {
  margin-top: 14px;
  padding: 13px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #7a3e03;
  line-height: 1.6;
  font-size: 13px;
}

/* Learn */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
}

.module-card h3 {
  margin: 18px 0 6px;
  font-size: 18px;
}

.module-card p {
  flex: 1;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.module-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* Practice */
.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.practice-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.practice-card .practice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.practice-body {
  padding: 22px;
}

.practice-aside {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.practice-aside .panel-body {
  display: grid;
  gap: 14px;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.stat-line strong {
  color: var(--ink);
}

.question-text {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.7;
}

.passage {
  margin: 0 0 22px;
  padding: 18px;
  border-left: 3px solid var(--blue);
  background: var(--surface-soft);
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: 15px;
}

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

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
}

.option:hover {
  border-color: var(--blue);
}

.option.selected {
  border-color: var(--blue);
  background: #eef4ff;
}

.option.correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.option.wrong {
  border-color: var(--red);
  background: var(--red-soft);
}

.option-key {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 14px;
}

.feedback.success {
  background: var(--green-soft);
  color: #14532d;
}

.feedback.error {
  background: var(--red-soft);
  color: #7a271a;
}

.practice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.audio-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.audio-bar .wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 26px;
}

.audio-bar .wave span {
  width: 3px;
  height: 8px;
  background: var(--teal);
  border-radius: 2px;
}

.audio-bar .wave span:nth-child(2) { height: 15px; }
.audio-bar .wave span:nth-child(3) { height: 22px; }
.audio-bar .wave span:nth-child(4) { height: 13px; }
.audio-bar .wave span:nth-child(5) { height: 19px; }
.audio-bar.playing .wave span {
  animation: wave 0.7s ease-in-out infinite alternate;
}

.audio-bar.playing .wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-bar.playing .wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-bar.playing .wave span:nth-child(4) { animation-delay: 0.3s; }
.audio-bar.playing .wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.1); }
}

.writing-topic {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.writing-topic h3 {
  margin: 0 0 8px;
}

.writing-topic p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* Diagnostic */
.diagnostic-shell {
  max-width: 920px;
  margin: 0 auto;
}

.diagnostic-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.diagnostic-progress .bar {
  flex: 1;
}

.result-hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.result-hero .score {
  color: var(--teal);
  font-size: 56px;
  font-weight: 850;
  letter-spacing: 0;
}

.result-hero h2 {
  margin: 6px 0 8px;
}

.result-hero p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.7;
}

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

.result-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.result-item strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

/* Coach */
.coach-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 560px;
}

.chat-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 20px;
}

.chat-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(78%, 680px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  line-height: 1.65;
  font-size: 14px;
}

.chat-row.user .chat-bubble {
  border-color: var(--blue);
  background: #eef4ff;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.chat-corrections {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.chat-compose textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  resize: none;
}

.chat-compose textarea:focus {
  border-color: var(--blue);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.icon-btn.recording {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  animation: recordingPulse 1.1s ease-in-out infinite;
}

@keyframes recordingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.32); }
  50% { box-shadow: 0 0 0 7px rgba(180, 35, 24, 0); }
}

.coach-aside {
  display: grid;
  align-content: start;
  gap: 14px;
}

.prompt-grid {
  display: grid;
  gap: 8px;
}

.prompt-chip {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
  font-size: 13px;
}

.prompt-chip:hover {
  border-color: var(--teal);
}

/* Profile / report */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

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

.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 110px;
  padding-top: 10px;
}

.activity-bar {
  display: flex;
  flex: 1;
  align-items: flex-end;
  height: 100%;
}

.activity-bar span {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
}

.error-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.error-row strong {
  font-size: 14px;
}

.error-row p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty-state {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 280px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .practice-layout,
  .coach-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .coach-layout {
    height: auto;
  }

  .chat-panel {
    min-height: 620px;
  }

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

@media (max-width: 820px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 260px;
    padding: 30px 24px;
  }

  .auth-story h1 {
    font-size: 34px;
  }

  .auth-story p,
  .auth-proof {
    display: none;
  }

  .auth-panel {
    padding: 28px 20px 80px;
  }

  .sidebar {
    display: none;
  }

  .app-shell {
    padding-left: 0;
    padding-bottom: 68px;
  }

  .topbar {
    height: 58px;
    padding: 0 16px;
  }

  .page {
    padding: 18px 14px 36px;
  }

  .page-head {
    flex-direction: column;
  }

  .brief {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .brief-score {
    padding: 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 0;
  }

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

  .result-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .chat-bubble {
    max-width: 86%;
  }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 5px 4px max(5px, env(safe-area-inset-bottom));
  }

  .mobile-link {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 5px 2px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-link i {
    font-size: 16px;
  }

  .mobile-link.active {
    color: var(--blue);
  }

  .practice-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .practice-actions .btn {
    width: 100%;
  }
}

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

  .metric {
    min-height: 96px;
    padding: 13px;
  }

  .mission {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .mission > .btn {
    grid-column: 2;
    justify-self: start;
  }

  .practice-body {
    padding: 16px;
  }
}
