:root {
  --ink: #17243a;
  --ink-soft: #31415a;
  --paper: #f6f3ed;
  --card: #fffdf9;
  --line: #ddd8cf;
  --muted: #748096;
  --orange: #e8653b;
  --orange-dark: #c94b25;
  --orange-soft: #fae5da;
  --teal: #2a8277;
  --teal-soft: #dceeea;
  --red: #c7473c;
  --red-soft: #f9e3df;
  --yellow: #f3bb45;
  --shadow: 0 18px 60px rgba(23, 36, 58, 0.1);
  --radius: 22px;
  --sidebar: 236px;
  font-family:
    Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 4%, rgba(232, 101, 59, 0.08), transparent 26rem),
    var(--paper);
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(232, 101, 59, 0.25);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-light {
  color: white;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px 5px 12px 5px;
  color: white;
  background: var(--orange);
  box-shadow: 0 8px 24px rgba(232, 101, 59, 0.28);
}

.eyebrow {
  margin: 0 0 12px;
  color: #f2b9a4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.eyebrow.ink {
  color: var(--orange);
}

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

.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(400px, 0.95fr) minmax(480px, 1.05fr);
  background: var(--card);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 48px clamp(38px, 6vw, 92px);
  color: white;
  background:
    radial-gradient(circle at 82% 16%, rgba(232, 101, 59, 0.3), transparent 22rem),
    radial-gradient(circle at 15% 84%, rgba(42, 130, 119, 0.26), transparent 26rem),
    var(--ink);
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.auth-story::before {
  width: 420px;
  height: 420px;
  right: -220px;
  top: 14%;
}

.auth-story::after {
  width: 260px;
  height: 260px;
  right: -110px;
  top: calc(14% + 80px);
}

.auth-story-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.auth-story h1 {
  margin: 0;
  font-size: clamp(46px, 5vw, 76px);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.auth-lead {
  max-width: 520px;
  margin: 26px 0 28px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.85;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-pills span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.auth-quote {
  position: relative;
  z-index: 1;
  max-width: 540px;
  padding: 22px 24px;
  border-left: 3px solid var(--orange);
  background: rgba(255, 255, 255, 0.045);
}

.auth-quote span {
  color: #f2b9a4;
  font-size: 11px;
}

.auth-quote p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
}

.auth-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px;
  background:
    linear-gradient(rgba(23, 36, 58, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 36, 58, 0.035) 1px, transparent 1px),
    var(--card);
  background-size: 34px 34px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px 18px;
}

.mobile-brand {
  display: none;
  margin-bottom: 42px;
}

.auth-card h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.auth-card > .muted {
  margin: 11px 0 30px;
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 26px;
  padding: 4px;
  border-radius: 13px;
  background: #efede8;
}

.auth-tab {
  padding: 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.auth-tab.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 14px rgba(23, 36, 58, 0.07);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label,
.field {
  display: grid;
  gap: 7px;
}

.auth-form label > span,
.field > span {
  font-size: 12px;
  font-weight: 750;
}

.auth-form input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.auth-form input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: #a5acb7;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 720;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.button-primary {
  color: white;
  background: var(--orange);
  box-shadow: 0 10px 28px rgba(232, 101, 59, 0.22);
}

.button-primary:hover {
  background: var(--orange-dark);
}

.button-wide {
  width: 100%;
  margin-top: 6px;
}

.button-ghost {
  border-color: var(--line);
  background: var(--card);
}

.button-dark {
  color: white;
  background: var(--ink);
}

.button-danger {
  color: var(--red);
  border-color: #ecc9c4;
  background: var(--red-soft);
}

.auth-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  position: fixed;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  height: 100vh;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 25% 100%, rgba(42, 130, 119, 0.25), transparent 18rem),
    var(--ink);
}

.sidebar-brand {
  margin: 0 12px 34px;
  color: white;
}

.side-nav,
.sidebar-bottom {
  display: grid;
  gap: 7px;
}

.sidebar-bottom {
  margin-top: auto;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 0;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: white;
  background: rgba(232, 101, 59, 0.17);
  box-shadow: inset 3px 0 var(--orange);
}

.nav-icon {
  display: grid;
  width: 24px;
  place-items: center;
  font-size: 20px;
}

.app-column {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 21px clamp(24px, 4vw, 64px);
  border-bottom: 1px solid rgba(221, 216, 207, 0.8);
  background: rgba(246, 243, 237, 0.86);
  backdrop-filter: blur(18px);
}

.topbar h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.topbar .eyebrow {
  margin-bottom: 5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.sync-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(42, 130, 119, 0.1);
}

.sync-state.is-syncing i {
  background: var(--yellow);
  animation: pulse 1s infinite alternate;
}

.sync-state.is-error i {
  background: var(--red);
}

@keyframes pulse {
  to {
    opacity: 0.35;
  }
}

.user-chip {
  display: flex;
  min-width: 150px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}

.user-chip > span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--ink);
}

.user-chip-copy {
  display: grid;
  min-width: 0;
  text-align: left;
}

.user-chip-copy b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-copy small {
  color: var(--muted);
  font-size: 10px;
}

.main-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 34px clamp(22px, 4vw, 64px) 80px;
}

.hero-dashboard {
  position: relative;
  display: grid;
  min-height: 270px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  overflow: hidden;
  padding: clamp(28px, 4vw, 50px);
  border-radius: 28px;
  color: white;
  background:
    linear-gradient(120deg, rgba(232, 101, 59, 0.12), transparent 60%),
    var(--ink);
  box-shadow: var(--shadow);
}

.hero-dashboard::after {
  position: absolute;
  width: 320px;
  height: 320px;
  content: "";
  right: -130px;
  top: -100px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.025),
    0 0 0 84px rgba(255, 255, 255, 0.018);
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.hero-copy .eyebrow {
  color: #f0a98d;
}

.hero-copy h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(32px, 4vw, 51px);
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.hero-copy p {
  max-width: 650px;
  margin: 15px 0 25px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
}

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

.hero-actions .button-ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.progress-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  width: 176px;
  height: 176px;
  align-self: center;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orange) var(--progress), rgba(255, 255, 255, 0.1) 0);
}

.progress-orbit::before {
  position: absolute;
  width: 138px;
  height: 138px;
  content: "";
  border-radius: 50%;
  background: var(--ink);
}

.progress-orbit div {
  position: relative;
  display: grid;
  text-align: center;
}

.progress-orbit b {
  font-size: 36px;
  letter-spacing: -0.06em;
}

.progress-orbit small {
  color: rgba(255, 255, 255, 0.58);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0 34px;
}

.stat-card {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid rgba(221, 216, 207, 0.84);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.72);
}

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

.stat-card b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  letter-spacing: -0.045em;
}

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

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 15px;
}

.section-head h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  padding: 7px 0;
  border: 0;
  color: var(--orange-dark);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.quick-card {
  position: relative;
  min-height: 145px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
}

.quick-card::after {
  position: absolute;
  width: 68px;
  height: 68px;
  content: "";
  right: -20px;
  bottom: -20px;
  border-radius: 50%;
  background: var(--quick-color, var(--orange-soft));
}

.quick-card:hover {
  border-color: #c9c0b4;
  box-shadow: 0 10px 30px rgba(23, 36, 58, 0.07);
  transform: translateY(-2px);
}

.quick-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 19px;
  place-items: center;
  border-radius: 11px;
  background: var(--quick-color, var(--orange-soft));
}

.quick-card b,
.quick-card span {
  display: block;
}

.quick-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.chapter-card {
  display: grid;
  min-height: 190px;
  grid-template-rows: auto 1fr auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.chapter-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.chapter-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--teal-soft);
  font-size: 21px;
}

.chapter-index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chapter-card h4 {
  margin: 17px 0 7px;
  font-size: 17px;
  letter-spacing: -0.025em;
}

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

.chapter-progress {
  margin-top: 18px;
}

.chapter-progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.progress-line {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece9e3;
}

.progress-line i {
  display: block;
  width: var(--width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
}

.chapter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

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

.chapter-start {
  padding: 7px 11px;
  border: 0;
  border-radius: 9px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 40px;
  border: 1px dashed #cec7bc;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.48);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 20px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  font-size: 28px;
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  max-width: 480px;
  color: var(--muted);
  line-height: 1.7;
}

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

.oral-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.oral-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.oral-card h3 {
  margin: 10px 0 8px;
  font-size: 18px;
}

.oral-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: #ece9e3;
  font-size: 10px;
  font-weight: 780;
}

.tag-dark {
  color: white;
  background: var(--ink);
}

.tag-orange {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.tag-teal {
  color: #1f6f65;
  background: var(--teal-soft);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 18px;
}

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

.panel h3 {
  margin: 0 0 18px;
}

.form-stack {
  display: grid;
  gap: 15px;
}

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

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
  border-radius: var(--radius);
  color: white;
  background: var(--ink);
}

.profile-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 20px;
  background: var(--orange);
  font-size: 26px;
  font-weight: 800;
}

.profile-card h3 {
  margin: 0 0 5px;
}

.profile-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
}

.skeleton {
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(90deg, #e9e5df 25%, #f4f1eb 50%, #e9e5df 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.practice-layer {
  position: fixed;
  z-index: 100;
  display: grid;
  min-height: 100dvh;
  inset: 0;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(circle at 50% -15%, rgba(232, 101, 59, 0.09), transparent 30rem),
    var(--paper);
}

.practice-header {
  position: relative;
  display: grid;
  min-height: 74px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(18px);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-size: 19px;
}

.practice-heading {
  display: grid;
}

.practice-heading b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.practice-timer {
  min-width: 66px;
  color: var(--orange-dark);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.thin-progress {
  position: absolute;
  height: 3px;
  inset: auto 0 0;
  background: #ebe7e0;
}

.thin-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width 0.2s ease;
}

.practice-main {
  display: grid;
  overflow: auto;
  place-items: start center;
  padding: clamp(20px, 4vw, 50px) 18px 130px;
}

.question-card {
  width: min(820px, 100%);
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 18px 70px rgba(23, 36, 58, 0.09);
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.favorite-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: #f1eee8;
  cursor: pointer;
  font-size: 24px;
}

.favorite-button.is-active {
  color: var(--orange);
  background: var(--orange-soft);
}

.question-chapter {
  margin: 28px 0 8px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 760;
}

.question-stem {
  margin: 0;
  font-size: clamp(22px, 3vw, 31px);
  letter-spacing: -0.035em;
  line-height: 1.5;
}

.question-options {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.option-button {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  cursor: pointer;
  line-height: 1.55;
  text-align: left;
}

.option-button:hover {
  border-color: #bcb3a7;
}

.option-letter {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: #f1eee8;
  font-size: 12px;
  font-weight: 800;
}

.option-button.is-selected {
  border-color: var(--orange);
  background: #fff8f4;
  box-shadow: inset 0 0 0 1px var(--orange);
}

.option-button.is-selected .option-letter {
  color: white;
  background: var(--orange);
}

.option-button.is-correct {
  border-color: var(--teal);
  background: #f2fbf8;
}

.option-button.is-correct .option-letter {
  color: white;
  background: var(--teal);
}

.option-button.is-wrong {
  border-color: var(--red);
  background: #fff7f5;
}

.option-button.is-wrong .option-letter {
  color: white;
  background: var(--red);
}

.option-button:disabled {
  cursor: default;
  opacity: 1;
}

.answer-panel {
  margin-top: 26px;
  padding: 21px;
  border-radius: 16px;
  background: #f1efe9;
}

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

.answer-result span {
  color: var(--teal);
  font-weight: 780;
}

.answer-result.is-wrong span {
  color: var(--red);
}

.answer-result b {
  color: var(--muted);
  font-size: 12px;
}

.answer-panel > p {
  margin: 13px 0;
  line-height: 1.75;
}

.mnemonic {
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  border-radius: 5px 10px 10px 5px;
  color: var(--ink-soft);
  background: var(--orange-soft);
  font-size: 13px;
  line-height: 1.65;
}

.practice-footer {
  position: fixed;
  z-index: 102;
  display: grid;
  min-height: 82px;
  grid-template-columns: auto auto minmax(180px, 300px);
  justify-content: center;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  inset: auto 0 0;
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(18px);
}

.practice-primary {
  min-width: 220px;
}

.modal-root {
  position: fixed;
  z-index: 200;
  display: grid;
  overflow: auto;
  padding: 20px;
  place-items: center;
  inset: 0;
  background: rgba(12, 20, 33, 0.66);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(620px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 26px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.26);
}

.modal-card.modal-wide {
  width: min(880px, 100%);
}

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

.modal-head h3 {
  margin: 0;
  font-size: 22px;
}

.modal-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

.sheet-grid button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 11px;
}

.sheet-grid button.is-answered {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.sheet-grid button.is-current {
  box-shadow: 0 0 0 2px var(--orange);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.score-hero {
  display: grid;
  padding: 28px;
  place-items: center;
  border-radius: 20px;
  color: white;
  background: var(--ink);
  text-align: center;
}

.score-hero b {
  font-size: 58px;
  letter-spacing: -0.07em;
}

.score-hero span {
  color: rgba(255, 255, 255, 0.6);
}

.oral-workspace {
  display: grid;
  gap: 18px;
}

.oral-prompt-box,
.reference-box {
  padding: 18px;
  border-radius: 16px;
  background: #f1eee8;
  line-height: 1.75;
}

.oral-timer {
  color: var(--orange-dark);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.rubric-list {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.rubric-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.score-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 15px;
}

.score-input input {
  width: 100%;
}

.score-input output {
  min-width: 54px;
  font-size: 21px;
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 300;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: 0.22s ease;
  inset: auto auto 28px 50%;
}

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

.toast.is-error {
  background: var(--red);
}

.bottom-nav {
  display: none;
}

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

  .quick-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .auth-screen {
    display: block;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    min-height: 100dvh;
    padding: 24px;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .app-column {
    min-height: 100dvh;
  }

  .topbar {
    min-height: 78px;
    padding: 16px 20px;
  }

  .topbar .eyebrow,
  .sync-state,
  .user-chip-copy {
    display: none;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .user-chip {
    min-width: 0;
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .main-content {
    padding: 22px 16px calc(96px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    z-index: 50;
    display: grid;
    min-height: 66px;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    inset: auto 0 0;
    background: rgba(255, 253, 249, 0.96);
    backdrop-filter: blur(16px);
  }

  .bottom-nav button {
    display: grid;
    gap: 2px;
    place-items: center;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
  }

  .bottom-nav button span {
    font-size: 20px;
  }

  .bottom-nav button small {
    font-size: 10px;
  }

  .bottom-nav button.is-active {
    color: var(--orange-dark);
  }

  .hero-dashboard {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .progress-orbit {
    display: none;
  }

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

@media (max-width: 620px) {
  .auth-panel {
    place-items: start center;
  }

  .auth-card {
    padding: 16px 0 30px;
  }

  .auth-card h2 {
    font-size: 27px;
  }

  .hero-copy h1 {
    font-size: 31px;
  }

  .stats-grid,
  .quick-grid,
  .chapter-grid,
  .oral-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-card {
    padding: 17px;
  }

  .stat-card b {
    font-size: 24px;
  }

  .section-head {
    align-items: start;
  }

  .question-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .question-stem {
    font-size: 20px;
  }

  .question-options {
    margin-top: 22px;
  }

  .option-button {
    grid-template-columns: 30px 1fr;
    padding: 10px 12px;
  }

  .practice-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 10px 14px;
  }

  .practice-footer {
    grid-template-columns: auto 1fr;
  }

  .practice-footer .sheet-button {
    display: none;
  }

  .practice-primary {
    min-width: 0;
  }

  .sheet-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .modal-root {
    align-items: end;
    padding: 0;
  }

  .modal-card,
  .modal-card.modal-wide {
    width: 100%;
    max-height: 92dvh;
    padding: 22px 17px calc(22px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
