:root {
  --bg: #f4f8ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --line: #dce6f6;
  --text: #14223a;
  --muted: #71809a;
  --blue: #1967ff;
  --blue-2: #4b91ff;
  --green: #36c58a;
  --violet: #8b5cf6;
  --amber: #ffac3d;
  --red: #ff6b8a;
  --shadow: 0 20px 60px rgba(31, 78, 145, 0.12);
  --radius: 8px;
  --app-topbar-height: 74px;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(83, 177, 255, 0.18), transparent 24%),
    radial-gradient(circle at 86% 28%, rgba(70, 211, 153, 0.15), transparent 25%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 46%, #eef5ff 100%);
  font-family: "Inter", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

body.plain-view,
body.history-view {
  background: #fff;
}

body.plain-view #view-root,
body.history-view #view-root {
  min-height: calc(100vh - var(--app-topbar-height));
  background: #fff;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  background: url("/assets/writing-lab-icon.png") center / contain no-repeat;
  box-shadow: none;
}

.main-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 26px;
}

.main-nav button {
  position: relative;
  height: 100%;
  padding: 0 4px;
  border: 0;
  color: #1f2d47;
  background: transparent;
  font-weight: 700;
}

.main-nav button.active {
  color: var(--blue);
}

.main-nav button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--blue);
}

.trial-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #22314d;
  font-weight: 700;
}

.streak {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #61708d;
  background: #fff;
  font-size: 13px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #1e6fff, #4bd4aa);
  box-shadow: 0 10px 28px rgba(25, 103, 255, 0.22);
}

.duck-avatar {
  width: 42px;
  height: 42px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.duck-avatar img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.user-name {
  font-size: 15px;
}

.boot-loading {
  display: grid;
  min-height: calc(100vh - 74px);
  place-items: start center;
  padding-top: 28vh;
}

.boot-loading-inner {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(520px, calc(100vw - 40px));
}

.pixel-loader {
  display: inline-grid;
  grid-template-columns: repeat(6, 8px);
  gap: 4px;
  min-height: 26px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #d9e5f6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(31, 78, 145, 0.1);
}

.pixel-loader i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #c8d7ed;
  animation: pixelLoaderStep 1.15s steps(1, end) infinite;
}

.pixel-loader i:nth-child(2) {
  animation-delay: 0.12s;
}

.pixel-loader i:nth-child(3) {
  animation-delay: 0.24s;
}

.pixel-loader i:nth-child(4) {
  animation-delay: 0.36s;
}

.pixel-loader i:nth-child(5) {
  animation-delay: 0.48s;
}

.pixel-loader i:nth-child(6) {
  animation-delay: 0.6s;
}

.auth-loader {
  min-height: 24px;
  grid-template-columns: repeat(6, 7px);
  padding: 6px 8px;
}

.auth-loader i {
  width: 7px;
  height: 7px;
}

.boot-quiz {
  width: 100%;
  padding: 18px 20px;
  border: 1px solid rgba(196, 211, 235, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 48px rgba(31, 78, 145, 0.12);
  backdrop-filter: blur(14px);
}

.boot-quiz-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.boot-quiz-question {
  margin: 0;
  color: #20324f;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.7;
}

.motion-toggle {
  position: relative;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(198, 213, 238, 0.92);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: #93a3bf;
  font: inherit;
  box-shadow: 0 10px 24px rgba(31, 78, 145, 0.08);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.motion-toggle:hover,
.motion-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(31, 78, 145, 0.14);
}

.motion-toggle-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  opacity: 0.78;
}

.motion-toggle-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.motion-toggle.is-lite {
  border-color: rgba(133, 211, 181, 0.58);
  background: rgba(240, 253, 248, 0.78);
  color: #36a87f;
}

.motion-toggle.is-performance {
  border-color: rgba(79, 145, 255, 0.62);
  background: rgba(237, 245, 255, 0.86);
  color: #1967ff;
}

.motion-toggle.is-performance .motion-toggle-icon {
  opacity: 1;
}

.motion-toggle::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  padding: 9px 11px;
  border: 1px solid rgba(196, 211, 235, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(31, 78, 145, 0.16);
  color: #53627c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.motion-toggle:hover::after,
.motion-toggle:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.motion-toast {
  position: fixed;
  top: 86px;
  right: 30px;
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(340px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid rgba(196, 211, 235, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 46px rgba(31, 78, 145, 0.16);
  color: #4f5f7a;
  animation: motionToastIn 0.56s ease both, motionToastOut 0.68s ease 8.4s forwards;
}

.motion-toast span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #36a87f;
  background: rgba(240, 253, 248, 0.88);
}

.motion-toast svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.motion-toast p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

@keyframes motionToastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes motionToastOut {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes pixelLoaderStep {
  0%,
  100% {
    background: #c8d7ed;
    transform: translateY(0);
  }

  35% {
    background: var(--blue);
    transform: translateY(-2px);
  }

  60% {
    background: #36c58a;
    transform: translateY(0);
  }
}

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

.auth-trigger,
.logout-btn,
.auth-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #22314d;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.auth-trigger,
.logout-btn {
  min-height: 38px;
  padding: 0 14px;
}

.auth-trigger-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #0e61ff, #2689ff);
  box-shadow: 0 10px 24px rgba(25, 103, 255, 0.2);
}

.logout-btn {
  color: #61708d;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 31, 55, 0.26);
  backdrop-filter: blur(6px);
  animation: modalBackdropIn 0.2s ease both;
}

.auth-modal {
  width: min(430px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(29, 65, 120, 0.28);
  animation: modalScaleIn 0.24s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

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

.auth-modal h2 {
  margin: 0;
  font-size: 24px;
}

.announcement-backdrop {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 31, 55, 0.24);
  backdrop-filter: blur(7px);
  animation: modalBackdropIn 0.2s ease both;
}

.announcement-modal {
  width: min(540px, calc(100vw - 36px));
  border: 1px solid #cfe0f8;
  border-radius: 16px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 255, 0.96)),
    #fff;
  box-shadow: 0 30px 80px rgba(29, 65, 120, 0.28);
  animation: modalScaleIn 0.24s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.announcement-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.announcement-modal h2 {
  margin: 0;
  font-size: 24px;
}

.announcement-copy {
  display: grid;
  gap: 10px;
}

.announcement-copy p {
  margin: 0;
  color: #263652;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.75;
}

.announcement-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid #dce6f6;
  color: #71809a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

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

.auth-field {
  display: grid;
  gap: 8px;
  color: #22314d;
  font-size: 13px;
  font-weight: 900;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--text);
  background: #f8fbff;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(25, 103, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(25, 103, 255, 0.1);
}

.auth-error {
  margin: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: #b42318;
  background: #fff1f0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  margin-top: 2px;
}

.auth-switch {
  width: 100%;
  margin-top: 14px;
  min-height: 42px;
}

main {
  min-height: calc(100vh - 74px);
}

.home-page {
  --hero-fade: 0;
  --hero-base-y: 0px;
  --hero-y: 0px;
  --hero-scale: 1;
  --topic-fade: 0;
  --topic-scale: 1;
  --orbit-opacity: 1;
  --orbit-scale: 1;
  --recommend-y: 230px;
  --recommend-opacity: 0.92;
  --recommend-scale: 0.94;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 64px;
  background:
    radial-gradient(circle at 14% 7%, rgba(77, 173, 255, 0.18), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(58, 210, 156, 0.16), transparent 28%),
    radial-gradient(circle at 15% 56%, rgba(114, 145, 255, 0.1), transparent 28%),
    radial-gradient(circle at 88% 74%, rgba(49, 205, 158, 0.12), transparent 30%),
    linear-gradient(180deg, #f9fcff 0%, #eef6ff 46%, #f5faff 100%);
}

.home-intro {
  position: relative;
  isolation: isolate;
  padding-top: calc(100vh - 74px);
}

.hero-stage {
  position: fixed;
  top: 74px;
  right: 0;
  left: 0;
  z-index: 1;
  display: grid;
  height: calc(100vh - 74px);
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 18px 24px 36px;
  pointer-events: none;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.hero-copy {
  position: relative;
  z-index: 4;
  width: min(900px, 94vw);
  text-align: center;
  opacity: calc(1 - var(--hero-fade));
  transform: translateY(calc(var(--hero-base-y) + var(--hero-y))) scale(var(--hero-scale));
  transform-origin: center;
  will-change: opacity, transform;
  pointer-events: none;
}

.hero-interactions-active .hero-copy {
  pointer-events: auto;
}

.hero-mascot-duck {
  --duck-rotate-x: 0deg;
  --duck-rotate-y: 0deg;
  --duck-neck-y: 0deg;
  --duck-face-x: 0px;
  --duck-face-y: 0px;
  position: relative;
  z-index: 1;
  width: 104px;
  height: 108px;
  margin: 4px auto 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  will-change: transform;
  isolation: isolate;
}

.hero-mascot-duck-bob {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 12px 20px rgba(41, 102, 180, 0.16));
  animation: hero-duck-float 5.2s ease-in-out infinite;
  will-change: transform;
}

.hero-mascot-duck.hero-mascot-scurry {
  animation: hero-duck-scurry 2.5s cubic-bezier(0.45, 0, 0.55, 1) both;
}

.hero-mascot-visible .hero-mascot-duck {
  opacity: calc(0.96 - var(--topic-fade, 0) * 0.55);
}

.hero-duck-shadow {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 68px;
  height: 14px;
  margin-left: -34px;
  border-radius: 50%;
  background: rgba(35, 92, 172, 0.12);
  filter: blur(6px);
}

.hero-duck-body,
.hero-duck-head,
.hero-duck-wing,
.hero-duck-eye,
.hero-duck-cheek,
.hero-duck-beak {
  position: absolute;
  display: block;
}

.hero-duck-wing {
  z-index: 0;
  width: 26px;
  height: 17px;
  bottom: 36px;
  border-radius: 72% 30% 55% 38%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.35) 0%, transparent 45%),
    linear-gradient(160deg, #9bdcff 0%, #4aa6f0 55%, #1f74d8 100%);
  box-shadow:
    inset -3px -4px 6px rgba(8, 75, 174, 0.12),
    0 2px 4px rgba(31, 103, 204, 0.08);
  opacity: 0.96;
}

.hero-duck-wing-left {
  left: calc(50% - 52px);
  transform: rotate(-20deg);
}

.hero-duck-wing-right {
  left: calc(50% + 26px);
  transform: rotate(20deg) scaleX(-1);
}

.hero-duck-body {
  left: 50%;
  bottom: 10px;
  z-index: 1;
  width: 72px;
  height: 58px;
  margin-left: -36px;
  overflow: hidden;
  border-radius: 52% 52% 48% 48% / 58% 58% 44% 44%;
  background:
    linear-gradient(118deg, rgba(42, 140, 220, 0.28) 0%, rgba(42, 140, 220, 0) 38%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.22) 0%, transparent 42%),
    linear-gradient(148deg, #9ee5ff 0%, #58b8ff 52%, #1f7ae8 100%);
  box-shadow:
    inset 0 -10px 18px rgba(8, 73, 181, 0.12),
    inset 0 8px 14px rgba(255, 255, 255, 0.28),
    0 6px 12px rgba(31, 103, 204, 0.1);
  transform: rotate(calc(var(--duck-rotate-y) * 0.06));
}

.hero-duck-head {
  left: 50%;
  top: 2px;
  z-index: 2;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  border-radius: 52% 52% 48% 48%;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.35) 0%, transparent 38%),
    linear-gradient(148deg, #c5f1ff 0%, #66c4ff 50%, #1f7de8 100%);
  box-shadow:
    inset 0 -8px 14px rgba(8, 72, 176, 0.14),
    inset 0 6px 12px rgba(255, 255, 255, 0.32),
    0 5px 10px rgba(21, 100, 206, 0.1);
  transform: translateX(calc(var(--duck-face-x) * 0.12)) rotate(calc(var(--duck-neck-y) * 0.055));
  transition: transform 0.14s ease-out;
}

.hero-duck-head::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 18px;
  height: 7px;
  border-radius: 40%;
  background: rgba(255, 255, 255, 0.28);
  filter: blur(2px);
  transform: rotate(-14deg);
}

.hero-duck-eye {
  top: 19px;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0 12%, transparent 14%),
    #132a4d;
  box-shadow: 0 1px 2px rgba(13, 42, 85, 0.14);
  transform: translate3d(var(--duck-face-x), var(--duck-face-y), 10px);
  transition: transform 0.14s ease-out;
}

.hero-duck-eye-left {
  left: 12px;
}

.hero-duck-eye-right {
  right: 12px;
}

.hero-duck-cheek {
  top: 31px;
  width: 10px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 153, 172, 0.32);
  filter: blur(0.2px);
  transform: translate3d(calc(var(--duck-face-x) * 0.55), calc(var(--duck-face-y) * 0.55), 8px);
  transition: transform 0.14s ease-out;
}

.hero-duck-cheek-left {
  left: 8px;
}

.hero-duck-cheek-right {
  right: 8px;
}

.hero-duck-beak {
  left: 50%;
  top: 28px;
  width: 22px;
  height: 12px;
  margin-left: -11px;
  border-radius: 42% 42% 52% 52% / 50% 50% 58% 58%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 40%),
    linear-gradient(148deg, #ffd98a, #ff9d3a);
  box-shadow:
    inset -2px -3px 5px rgba(176, 84, 0, 0.16),
    0 2px 3px rgba(130, 78, 0, 0.1);
  transform: translate3d(var(--duck-face-x), var(--duck-face-y), 12px);
  transition: transform 0.14s ease-out;
}

@keyframes hero-duck-float {
  from {
    transform: translate3d(0, 0, 0) rotateX(var(--duck-rotate-x)) rotateY(var(--duck-rotate-y));
  }
  50% {
    transform: translate3d(0, -5px, 0) rotateX(var(--duck-rotate-x)) rotateY(var(--duck-rotate-y));
  }
  to {
    transform: translate3d(0, 0, 0) rotateX(var(--duck-rotate-x)) rotateY(var(--duck-rotate-y));
  }
}

@keyframes hero-duck-scurry {
  0% {
    transform: translateX(0);
  }
  14% {
    transform: translateX(-24px);
  }
  32% {
    transform: translateX(22px);
  }
  50% {
    transform: translateX(-16px);
  }
  68% {
    transform: translateX(12px);
  }
  86% {
    transform: translateX(-6px);
  }
  100% {
    transform: translateX(0);
  }
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(46px, 5.1vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy .hero-mascot-duck + h1 {
  margin-top: 6px;
}

.hero-copy p:not(.eyebrow) {
  margin: 20px auto 34px;
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.primary,
.secondary,
.ghost,
.chip,
.side-link,
.select-like {
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary {
  min-height: 48px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(135deg, #0e61ff, #2689ff);
  box-shadow: 0 12px 28px rgba(25, 103, 255, 0.28);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  color: #22314d;
  background: #fff;
}

.ghost {
  padding: 8px 10px;
  color: var(--blue);
  background: transparent;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  height: 60px;
  font-size: 18px;
}

.hero-cta::before {
  content: "✦";
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-size: 17px;
  transform: rotate(12deg);
}

.hero-search {
  display: flex;
  align-items: center;
  width: min(520px, 92vw);
  height: 54px;
  margin: 30px auto 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(69, 95, 139, 0.08);
}

.hero-search span,
.search-bar span {
  color: #90a0ba;
  font-size: 22px;
}

.hero-search input,
.search-bar input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.floating-topics {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: calc(1 - var(--topic-fade));
  pointer-events: none;
  transform: translateY(-6vh) scale(var(--topic-scale));
  transform-origin: center;
  will-change: opacity, transform;
}

.topic-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 112px;
  padding: 12px 17px;
  border: 1px solid rgba(220, 230, 246, 0.88);
  border-radius: 999px;
  color: #253652;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(31, 78, 145, 0.13);
  pointer-events: none;
  font-size: 16px;
  font-weight: 800;
  animation: float-topic var(--duration, 9s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.hero-interactions-active .topic-bubble {
  pointer-events: auto;
}

.topic-bubble:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, #fff);
  color: var(--accent);
  transform: translateY(-2px);
}

.topic-icon,
.topic-bubble i {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, #fff);
  font-style: normal;
  font-weight: 900;
}

.topic-icon svg,
.tag svg,
.category-dot svg,
.metric-icon svg,
.editor-toolbar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-icon svg {
  width: 24px;
  height: 24px;
}

@keyframes float-topic {
  from {
    transform: translate3d(calc(var(--float-x, 20px) * -0.45), calc(var(--float-y, -20px) * -0.35), 0) rotate(-2deg);
  }
  to {
    transform: translate3d(var(--float-x, 38px), var(--float-y, -34px), 0) rotate(3deg);
  }
}

.orbit-line {
  position: absolute;
  left: 50%;
  top: 51%;
  width: min(72vw, 1040px);
  height: 520px;
  border: 0;
  border-radius: 50%;
  opacity: calc(var(--orbit-opacity) * 0.64);
  transform: translate3d(-50%, -50%, 0) rotateZ(-7deg) rotateX(60deg) scale(var(--orbit-scale));
  transform-origin: center;
  filter:
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0 34px rgba(219, 235, 255, 0.34));
  animation: halo-tilt-one 12s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.orbit-line::before,
.orbit-line::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.orbit-line::before {
  background:
    radial-gradient(ellipse at center, transparent 57%, rgba(255, 255, 255, 0.92) 59%, rgba(255, 255, 255, 0.72) 60.5%, transparent 64%),
    radial-gradient(ellipse at center, transparent 61%, rgba(232, 242, 255, 0.42) 64%, transparent 70%);
  filter: blur(0.35px);
}

.orbit-line::after {
  inset: -24px;
  background:
    radial-gradient(ellipse at center, transparent 54%, rgba(255, 255, 255, 0.28) 59%, rgba(235, 244, 255, 0.18) 63%, transparent 72%),
    radial-gradient(ellipse at center, transparent 62%, rgba(255, 255, 255, 0.15) 68%, transparent 76%);
  filter: blur(18px);
  opacity: 0.92;
}

.orbit-two {
  top: 52%;
  width: min(66vw, 940px);
  height: 470px;
  opacity: calc(var(--orbit-opacity) * 0.5);
  transform: translate3d(-50%, -50%, -80px) rotateZ(8deg) rotateX(120deg) scale(var(--orbit-scale));
  animation-name: halo-tilt-two;
  animation-duration: 13.5s;
  animation-delay: -1.8s;
}

.orbit-two::before {
  background:
    radial-gradient(ellipse at center, transparent 56%, rgba(255, 255, 255, 0.78) 58.5%, rgba(255, 255, 255, 0.58) 60.5%, transparent 65%),
    radial-gradient(ellipse at center, transparent 62%, rgba(235, 244, 255, 0.32) 66%, transparent 72%);
}

.home-page.motion-lite .hero-stage {
  perspective: none;
}

body.home-motion-lite .topbar {
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.96);
}

.home-page.motion-lite .hero-copy,
.home-page.motion-lite .floating-topics,
.home-page.motion-lite .recommendation-band {
  will-change: opacity, transform;
}

.home-page.motion-lite .topic-bubble {
  animation: none;
  box-shadow: 0 10px 24px rgba(31, 78, 145, 0.1);
}

.home-page.motion-lite.hero-interactions-active .topic-bubble {
  pointer-events: auto;
}

@media (min-width: 761px) {
  .home-page.motion-lite .floating-topics {
    width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
    right: 0;
    left: 0;
    z-index: 5;
  }

  .home-page.motion-lite .topic-bubble {
    transform: none !important;
    z-index: 1;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(1) {
    left: 4% !important;
    top: 20% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(2) {
    left: 7% !important;
    top: 35% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(3) {
    left: 5% !important;
    top: 51% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(4) {
    left: 12% !important;
    top: 67% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(5) {
    right: 6% !important;
    left: auto !important;
    top: 20% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(6) {
    right: 4% !important;
    left: auto !important;
    top: 35% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(7) {
    right: 7% !important;
    left: auto !important;
    top: 51% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(8) {
    right: 12% !important;
    left: auto !important;
    top: 67% !important;
  }

  .home-page.motion-lite .floating-topics .topic-bubble:nth-child(9) {
    left: 50% !important;
    top: 9% !important;
    transform: translateX(-50%) !important;
  }
}

.home-page.motion-lite .hero-mascot-duck {
  transition-duration: 0.22s;
}

.home-page.motion-lite .hero-mascot-duck-bob {
  animation-duration: 7.5s;
  filter: drop-shadow(0 8px 12px rgba(41, 102, 180, 0.12));
}

.home-page.motion-lite .hero-duck-shadow {
  filter: blur(3px);
}

.home-page.motion-lite .hero-duck-head::after,
.home-page.motion-lite .hero-duck-cheek {
  filter: none;
}

.home-page.motion-lite .orbit-line {
  animation: none;
  filter: drop-shadow(0 0 14px rgba(219, 235, 255, 0.26));
  will-change: opacity, transform;
}

.home-page.motion-lite .orbit-line::before {
  filter: none;
}

.home-page.motion-lite .orbit-line::after {
  filter: blur(8px);
  opacity: 0.56;
}

.home-page.motion-lite .recommendation-marquee {
  overflow-x: auto;
  overflow-y: hidden;
  mask-image: none;
  scrollbar-width: thin;
  cursor: grab;
}

.home-page.motion-lite .recommendation-marquee.showing-drag-hint {
  padding-top: 48px;
}

.home-page.motion-lite .recommendation-marquee:active {
  cursor: grabbing;
}

.home-page.motion-lite .recommendation-marquee.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.home-page.motion-lite .recommendation-track {
  animation: none;
  width: max-content;
  padding-right: 24px;
  pointer-events: auto;
}

.recommendation-drag-hint {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 13px 0 11px;
  border: 1px solid rgba(25, 103, 255, 0.2);
  border-radius: 999px;
  color: var(--blue);
  background: #eef4ff;
  box-shadow: 0 10px 22px rgba(31, 78, 145, 0.16);
  pointer-events: none;
  transform: translateX(-50%);
  animation: recommendation-drag-hint 4.8s ease-in-out infinite;
}

.recommendation-drag-hint b {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.recommendation-drag-mark {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 18px;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(25, 103, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.recommendation-drag-mark::before {
  position: absolute;
  top: -4px;
  left: 8px;
  width: 18px;
  height: 20px;
  content: "";
  background: #17243c;
  clip-path: polygon(0 0, 0 100%, 33% 72%, 52% 100%, 70% 91%, 52% 64%, 88% 64%);
  filter: drop-shadow(0 8px 10px rgba(23, 36, 60, 0.18));
  animation: recommendation-drag-cursor 4.8s cubic-bezier(0.2, 0.78, 0.22, 1) infinite both;
}

.recommendation-drag-mark::after {
  position: absolute;
  right: 6px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(25, 103, 255, 0.34);
  border-radius: 50%;
  content: "";
  opacity: 0;
  animation: recommendation-drag-ring 4.8s ease-out infinite both;
}

@keyframes halo-tilt-one {
  from {
    transform: translate3d(-50%, -50%, 0) rotateZ(-7deg) rotateX(60deg) scale(var(--orbit-scale));
    opacity: calc(var(--orbit-opacity) * 0.58);
    filter:
      drop-shadow(0 0 16px rgba(255, 255, 255, 0.62))
      drop-shadow(0 0 30px rgba(219, 235, 255, 0.28));
  }
  to {
    transform: translate3d(-50%, -50%, 0) rotateZ(-7deg) rotateX(120deg) scale(var(--orbit-scale));
    opacity: calc(var(--orbit-opacity) * 0.72);
    filter:
      drop-shadow(0 0 22px rgba(255, 255, 255, 0.78))
      drop-shadow(0 0 44px rgba(219, 235, 255, 0.36));
  }
}

@keyframes halo-tilt-two {
  from {
    transform: translate3d(-50%, -50%, -80px) rotateZ(8deg) rotateX(120deg) scale(var(--orbit-scale));
    opacity: calc(var(--orbit-opacity) * 0.46);
  }
  to {
    transform: translate3d(-50%, -50%, -80px) rotateZ(8deg) rotateX(60deg) scale(var(--orbit-scale));
    opacity: calc(var(--orbit-opacity) * 0.62);
  }
}

.content-band {
  position: relative;
  z-index: 9;
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto 34px;
}

.continue-band[hidden] {
  display: none;
}

.continue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid #cfe0f8;
  border-radius: var(--radius);
  color: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 248, 255, 0.92)),
    #fff;
  box-shadow: 0 18px 42px rgba(31, 78, 145, 0.1);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.continue-card:hover {
  transform: translateY(-3px) scale(1.008);
  border-color: #9fc2f5;
  box-shadow: 0 22px 52px rgba(31, 78, 145, 0.16);
}

.continue-card p {
  margin: 12px 0 0;
  color: #223350;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.65;
}

.continue-meta {
  display: grid;
  min-width: 120px;
  gap: 8px;
  justify-items: end;
  color: #657590;
}

.continue-meta strong {
  color: var(--blue);
  font-size: 17px;
}

.continue-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf4ff;
  font-weight: 900;
}

.paper-prep-band[hidden] {
  display: none;
}

.section-kicker {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.paper-prep-panel {
  overflow: hidden;
  border: 1px solid #cfe0f8;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(31, 78, 145, 0.1);
}

.paper-report {
  border-bottom: 1px solid #e1e9f7;
}

.paper-report summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 20px 22px;
  list-style: none;
  cursor: pointer;
}

.paper-report.needs-hint summary i {
  animation: paper-report-chevron 4.8s ease-in-out 0.7s 3;
}

.paper-report-cursor {
  position: absolute;
  top: calc(50% - 3px);
  right: 33px;
  z-index: 3;
  width: 24px;
  height: 28px;
  pointer-events: none;
  transform-origin: 4px 4px;
  animation: paper-report-cursor 4.8s cubic-bezier(0.2, 0.78, 0.22, 1) 0.7s 3 both;
}

.paper-report-cursor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #17243c;
  clip-path: polygon(0 0, 0 100%, 33% 72%, 52% 100%, 70% 91%, 52% 64%, 88% 64%);
  filter: drop-shadow(0 8px 10px rgba(23, 36, 60, 0.2));
}

.paper-report-cursor::after {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(25, 103, 255, 0.38);
  border-radius: 50%;
  opacity: 0;
  animation: paper-report-click-ring 4.8s ease-out 0.7s 3 both;
}

.paper-report summary::-webkit-details-marker {
  display: none;
}

.paper-report summary strong,
.paper-list-heading h3,
.paper-chart-title h3 {
  display: block;
  margin: 0;
  color: #1f2d47;
  font-size: 17px;
}

.paper-report summary small {
  display: block;
  margin-top: 5px;
  color: #6f7e96;
  font-size: 13px;
  font-weight: 800;
}

.paper-report summary i {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #edf4ff;
  transition: transform 0.18s ease;
}

.paper-report summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paper-report[open] summary i {
  transform: rotate(180deg);
}

@keyframes paper-report-cursor {
  0%,
  10% {
    opacity: 0;
    transform: translate(-220px, 32px) rotate(-18deg) scale(0.96);
  }

  26% {
    opacity: 1;
    transform: translate(-82px, 14px) rotate(-18deg) scale(1);
  }

  42%,
  54% {
    opacity: 1;
    transform: translate(-7px, -3px) rotate(-18deg) scale(1);
  }

  48% {
    opacity: 1;
    transform: translate(-7px, -3px) rotate(-18deg) scale(0.88);
  }

  72%,
  100% {
    opacity: 0;
    transform: translate(-7px, -3px) rotate(-18deg) scale(1);
  }
}

@keyframes paper-report-click-ring {
  0%,
  43%,
  62%,
  100% {
    opacity: 0;
    transform: scale(0.35);
  }

  48% {
    opacity: 0.72;
    transform: scale(0.75);
  }

  58% {
    opacity: 0;
    transform: scale(1.65);
  }
}

@keyframes paper-report-chevron {
  0%,
  38%,
  62%,
  100% {
    box-shadow: none;
    transform: translateY(0);
  }

  48% {
    box-shadow: 0 0 0 9px rgba(25, 103, 255, 0.1);
    transform: translateY(1px);
  }
}

.paper-report-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  padding: 0 22px 24px;
}

.paper-report-copy p {
  margin: 16px 0;
  color: #2a3853;
  font-size: 15px;
  line-height: 1.78;
}

.paper-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.paper-stat-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #dbe6f6;
  border-radius: 999px;
  color: #52627a;
  background: #f8fbff;
  font-size: 13px;
  font-weight: 900;
}

.paper-stat-row b {
  color: var(--blue);
  font-size: 18px;
}

.paper-report-points {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: #42516b;
  font-size: 14px;
  line-height: 1.72;
}

.paper-chart-box {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e0e9f6;
  border-radius: var(--radius);
  background: #f8fbff;
}

.paper-chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.paper-help {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #ccd9ec;
  border-radius: 50%;
  color: #60708a;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.paper-help::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 4;
  width: 260px;
  max-width: min(260px, calc(100vw - 64px));
  padding: 10px 12px;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  color: #33425e;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 78, 145, 0.16);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.paper-help:hover::after,
.paper-help:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.paper-bar-chart {
  display: grid;
  gap: 10px;
}

.paper-bar-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.paper-bar-name {
  overflow: hidden;
  color: #33425e;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-bar-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eff8;
}

.paper-bar-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #ffffff));
}

.paper-bar-row strong {
  color: #1f2d47;
  font-size: 13px;
}

.paper-exam-list {
  padding: 20px 22px 22px;
}

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

.paper-list-heading span {
  color: #6d7b94;
  font-size: 13px;
  font-weight: 900;
}

.paper-exam-window {
  display: grid;
  gap: 10px;
  max-height: 548px;
  overflow-y: auto;
  padding: 2px 8px 2px 2px;
  scrollbar-color: #b9c9e3 #edf4ff;
  scrollbar-width: thin;
}

.paper-exam-window::-webkit-scrollbar {
  width: 8px;
}

.paper-exam-window::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #edf4ff;
}

.paper-exam-window::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b9c9e3;
}

.paper-exam-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e5edf8;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.paper-exam-row:hover,
.paper-exam-row:focus-visible {
  border-color: rgba(25, 103, 255, 0.32);
  background: #f8fbff;
  box-shadow: 0 14px 34px rgba(31, 78, 145, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.paper-exam-row.practiced {
  border-color: rgba(32, 185, 130, 0.28);
  background: #f3fff9;
}

.paper-exam-row.practiced:hover,
.paper-exam-row.practiced:focus-visible {
  background: #eafbf3;
}

.paper-exam-row time {
  display: inline-grid;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  color: #215aa8;
  background: #edf4ff;
  font-size: 13px;
  font-weight: 900;
}

.paper-exam-copy {
  min-width: 0;
}

.paper-exam-copy p {
  margin: 10px 0 0;
  color: #223350;
  font-size: 14.5px;
  font-weight: 780;
  line-height: 1.72;
}

.paper-exam-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.recommendation-band {
  position: relative;
  z-index: 8;
  min-height: 62vh;
  margin-top: -44vh;
  padding: 48px 0 14px;
  background: transparent;
  opacity: var(--recommend-opacity);
  transform: translateY(var(--recommend-y)) scale(var(--recommend-scale));
  transform-origin: top center;
  will-change: opacity, transform;
}

.recommendation-band::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  top: 22px;
  height: 390px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.2) 48%, transparent 73%),
    radial-gradient(circle at 26% 52%, rgba(79, 145, 255, 0.13), transparent 35%),
    radial-gradient(circle at 76% 45%, rgba(65, 210, 158, 0.12), transparent 38%);
  filter: blur(2px);
}

.recommendation-inner {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 18px 0 12px;
}

.recommendation-marquee {
  position: relative;
  overflow: hidden;
  margin: 28px calc(50% - 50vw) 0;
  padding: 8px 0 24px;
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.recommendation-track {
  display: flex;
  width: max-content;
  gap: 22px;
  padding: 0 24px;
  animation: recommendation-scroll 64s linear infinite;
}

.recommendation-marquee:hover .recommendation-track {
  animation-play-state: paused;
}

.recommendation-track .topic-card {
  width: min(450px, 82vw);
  min-height: 276px;
  flex: 0 0 min(450px, 82vw);
  padding: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(31, 78, 145, 0.13);
}

.recommendation-track .topic-card p {
  margin: 20px 0;
  font-size: 15.5px;
  line-height: 1.82;
}

@media (min-width: 761px) and (max-width: 1440px), (min-width: 761px) and (max-height: 900px) {
  :root {
    --app-topbar-height: 64px;
  }

  .topbar {
    height: 64px;
    padding: 0 24px;
  }

  .brand {
    gap: 10px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    font-size: 12px;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
  }

  .main-nav {
    gap: 22px;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .streak,
  .logout-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  main {
    min-height: calc(100vh - 64px);
  }

  .home-page {
    padding-bottom: 48px;
  }

  .home-intro {
    padding-top: calc(100vh - 64px);
  }

  .hero-stage {
    top: 64px;
    height: calc(100vh - 64px);
    padding: 12px 22px 28px;
  }

  .category-rail {
    --rail-dot-size: clamp(32px, 4.8vh, 36px);
  }

  .hero-mascot-duck {
    width: 96px;
    height: 100px;
    margin: 2px auto 6px;
    transform: scale(0.94);
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 4.4vw, 58px);
  }

  .hero-copy p:not(.eyebrow) {
    margin: 14px auto 24px;
    font-size: 16px;
    line-height: 1.68;
  }

  .hero-cta {
    min-height: 44px;
  }

  .hero-search {
    margin-top: 22px;
  }

  .recommendation-band {
    min-height: 50vh;
    margin-top: -38vh;
    padding: 34px 0 8px;
  }

  .recommendation-inner,
  .content-band {
    width: min(1120px, calc(100vw - 40px));
  }

  .content-band {
    margin-bottom: 26px;
  }

  .section-title {
    margin-bottom: 12px;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .recommendation-marquee {
    margin-top: 18px;
    padding-bottom: 14px;
  }

  .recommendation-track {
    gap: 16px;
  }

  .recommendation-track .topic-card {
    width: 400px;
    min-height: 232px;
    flex-basis: 400px;
    padding: 20px;
  }

  .recommendation-track .topic-card p {
    margin: 14px 0;
    font-size: 14.5px;
    line-height: 1.7;
  }

  .continue-card {
    padding: 16px 18px;
  }

  .continue-card p {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.55;
  }

  .continue-meta strong {
    font-size: 15px;
  }

  .paper-report summary {
    min-height: 64px;
    padding: 16px 18px;
  }

  .paper-report summary strong,
  .paper-list-heading h3,
  .paper-chart-title h3 {
    font-size: 16px;
  }

  .paper-report-body {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
    gap: 18px;
    padding: 0 18px 18px;
  }

  .paper-report-copy p {
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.65;
  }

  .paper-report-points {
    gap: 8px;
    font-size: 13px;
    line-height: 1.6;
  }

  .paper-chart-box {
    padding: 14px;
  }

  .paper-chart-title {
    margin-bottom: 10px;
  }

  .paper-bar-chart {
    gap: 8px;
  }

  .paper-bar-row {
    min-height: 26px;
  }

  .paper-exam-list {
    padding: 16px 18px 18px;
  }

  .paper-list-heading {
    margin-bottom: 10px;
  }

  .paper-exam-window {
    max-height: min(360px, 43vh);
    gap: 8px;
    padding-right: 6px;
  }

  .paper-exam-row {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 11px 12px;
  }

  .paper-exam-row time {
    min-height: 30px;
    font-size: 12px;
  }

  .paper-exam-copy p {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    font-size: 13.5px;
    line-height: 1.58;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .metric-card {
    min-height: 116px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 28px;
  }

  .metric-sparkline svg {
    height: 86px;
  }

}

@keyframes recommendation-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 9px));
  }
}

@keyframes recommendation-drag-hint {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-2px);
  }
}

@keyframes recommendation-drag-cursor {
  0%,
  14% {
    opacity: 0;
    transform: translateX(-8px) rotate(-18deg) scale(0.96);
  }

  30% {
    opacity: 1;
    transform: translateX(0) rotate(-18deg) scale(1);
  }

  48%,
  62% {
    opacity: 1;
    transform: translateX(14px) rotate(-18deg) scale(1);
  }

  54% {
    opacity: 1;
    transform: translateX(14px) rotate(-18deg) scale(0.9);
  }

  78%,
  100% {
    opacity: 0;
    transform: translateX(14px) rotate(-18deg) scale(1);
  }
}

@keyframes recommendation-drag-ring {
  0%,
  46% {
    opacity: 0;
    transform: scale(0.72);
  }

  54% {
    opacity: 0.9;
    transform: scale(1);
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .recommendation-drag-hint {
    animation: none;
  }

  .recommendation-drag-mark::before,
  .recommendation-drag-mark::after {
    animation: none;
  }

  .home-intro {
    padding-top: 0;
  }

  .hero-stage {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    height: auto;
    min-height: calc(100vh - 74px);
    pointer-events: auto;
  }

  .hero-copy,
  .floating-topics,
  .recommendation-band {
    opacity: 1 !important;
    transform: none !important;
  }

  .orbit-line {
    transform: translate3d(-50%, -50%, 0) rotateZ(-7deg) rotateX(72deg) scale(var(--orbit-scale)) !important;
  }

  .orbit-two {
    transform: translate3d(-50%, -50%, -80px) rotateZ(8deg) rotateX(108deg) scale(var(--orbit-scale)) !important;
  }

  .topic-bubble,
  .recommendation-track,
  .motion-toast,
  .pixel-loader i,
  .paper-report-cursor,
  .paper-report.needs-hint summary i,
  .settings-trigger.guide-active,
  .preference-guide-cursor,
  .preference-guide-choice,
  .orbit-line,
  .orbit-line::before,
  .orbit-line::after {
    animation: none !important;
  }

  .paper-report-cursor {
    display: none;
  }

  .preference-guide-cursor,
  .preference-guide-choice {
    display: none;
  }

  .hero-mascot-duck {
    display: none !important;
  }

  .recommendation-marquee {
    overflow-x: auto;
    mask-image: none;
  }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h2 {
  position: relative;
  margin: 0;
  padding-left: 18px;
  font-size: 20px;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 20px;
  border-radius: 999px;
  background: var(--blue);
  transform: translateY(-50%);
}

.compact {
  margin-top: 8px;
}

.card-grid {
  display: grid;
  gap: 18px;
}

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

.topic-card,
.metric-card,
.panel,
.topic-detail,
.outline-card,
.sentence-panel,
.feedback-card,
.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(31, 78, 145, 0.07);
}

.topic-card {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.topic-card:hover,
.topic-card:focus-visible {
  z-index: 3;
  border-color: rgba(25, 103, 255, 0.35);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(31, 78, 145, 0.16);
  outline: none;
  transform: translateY(-6px) scale(1.018);
}

.topic-card.practiced,
.topic-row.practiced {
  border-color: rgba(32, 185, 130, 0.28);
  background: #f3fff9;
}

.topic-card header,
.topic-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-card-meta,
.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.practice-badge,
.real-exam-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #15855d;
  background: #dcf8eb;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.real-exam-badge {
  color: #b84a12;
  background: #ffe8d6;
}

.topic-status-stack {
  display: inline-grid;
  flex: 0 0 auto;
  gap: 5px;
  justify-items: end;
}

.topic-heart {
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #dbe5f4;
  border-radius: 50%;
  color: #9aa8bd;
  background: #fff;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.topic-heart svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.topic-heart:hover,
.topic-heart.active {
  border-color: #ffb8c8;
  color: #ff4f7b;
  background: #fff0f4;
  box-shadow: 0 8px 20px rgba(255, 79, 123, 0.16);
}

.topic-heart.active svg {
  fill: currentColor;
}

.topic-heart.pop {
  animation: favoritePop 0.38s ease;
}

.detail-heart {
  width: 46px;
  height: 46px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: max-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--accent, var(--blue));
  background: color-mix(in srgb, var(--accent, var(--blue)) 13%, #fff);
  font-size: 12px;
  font-weight: 900;
}

.tag-with-icon {
  gap: 6px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag-large {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.tag-large svg {
  width: 17px;
  height: 17px;
}

.tag-compact {
  min-width: 0;
  min-height: 28px;
  padding: 0 11px;
}

.topic-card p {
  display: -webkit-box;
  margin: 18px 0;
  overflow: hidden;
  color: #263652;
  font-size: 14px;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.start-link {
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 900;
}

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

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

.metric-card {
  min-height: 132px;
  padding: 20px;
}

.history-metrics .metric-card,
.home-metrics .metric-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(120px, 1fr);
  align-items: center;
  gap: 14px;
  text-align: left;
}

.metric-card-clickable {
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  background: var(--surface-solid);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.metric-card-clickable:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: #b9cdf2;
  box-shadow: 0 18px 42px rgba(31, 78, 145, 0.14);
}

.home-metric-card {
  cursor: pointer;
}

.metric-visual {
  position: relative;
  min-width: 0;
  padding-top: 28px;
}

.metric-period {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  min-width: 34px;
  height: 24px;
  place-items: center;
  border: 1px solid #d8e3f5;
  border-radius: 999px;
  color: var(--blue);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.metric-card p,
.metric-card small {
  margin: 0;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 32px;
  line-height: 1;
}

.metric-card strong small {
  font-size: 14px;
}

.metric-sparkline svg {
  width: 100%;
  height: 104px;
  overflow: visible;
}

.spark-line {
  fill: none;
  stroke: var(--spark);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 8px 8px rgba(25, 103, 255, 0.14));
}

.spark-axis {
  stroke: #d9e4f4;
  stroke-width: 1;
}

.spark-x-label,
.spark-y-label {
  fill: #9aa8bd;
  font-size: 10px;
  font-weight: 700;
}

.metric-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 12px;
  font-weight: 900;
}

.metric-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.metric-icon.blue {
  color: var(--blue);
  background: #eaf2ff;
}

.metric-icon.green {
  color: var(--green);
  background: #e9fbf3;
}

.metric-icon.violet {
  color: var(--violet);
  background: #f1ebff;
}

.metric-icon.amber {
  color: var(--amber);
  background: #fff4e2;
}

.recent-table,
.topic-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.recent-empty {
  display: grid;
  min-height: 86px;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.topic-row {
  display: grid;
  grid-template-columns: 112px 1fr 104px;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid #e8eef8;
  color: #263652;
  font-size: 14px;
}

.recent-row {
  display: grid;
  grid-template-columns: minmax(92px, 116px) minmax(0, 1fr) 92px 72px;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid #e8eef8;
  color: #263652;
  font-size: 14px;
  text-align: left;
}

.recent-row .topic-tag {
  justify-self: start;
  max-width: 100%;
}

.recent-question {
  min-width: 0;
  overflow: hidden;
  color: #233757;
  font-weight: 400;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-time {
  justify-self: end;
  color: #73829b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.recent-row .score {
  display: inline-grid;
  justify-self: center;
  min-width: 58px;
  place-items: center;
  text-align: center;
}

.recent-row:last-child,
.topic-row:last-child {
  border-bottom: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: calc(100vh - 74px);
  transition: grid-template-columns 0.2s ease;
  overflow: visible;
}

body.plain-view .workspace,
body.plain-view .training-page {
  background: #fff;
}

.workspace.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.history-workspace {
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - var(--app-topbar-height));
  background: #fff;
}

body.history-side-nav .history-workspace {
  grid-template-columns: 72px minmax(0, 1fr);
}

.history-workspace .history-main {
  min-height: calc(100vh - var(--app-topbar-height));
  background: transparent;
}

.sidebar {
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.category-rail {
  --rail-surface: rgba(255, 255, 255, 0.52);
  --rail-dot-size: clamp(34px, 4.8vh, 38px);
  position: relative;
  z-index: 12;
  width: 72px;
  align-self: start;
  padding: 0 6px;
  overflow: visible;
  border-right: 0;
  background: transparent;
  backdrop-filter: none;
}

.history-side-rail {
  display: none;
}

body.history-side-nav .history-side-rail {
  display: block;
}

body.history-side-nav .history-entry-grid {
  display: none;
}

body.history-side-nav .history-main {
  padding-top: 32px;
}

.history-side-btn .category-dot svg {
  width: 19px;
  height: 19px;
}

.category-rail .category-list {
  position: fixed;
  top: calc(var(--app-topbar-height) + (100vh - var(--app-topbar-height)) / 2);
  left: 6px;
  z-index: 12;
  width: 56px;
  max-height: calc(100vh - var(--app-topbar-height) - 18px);
  min-height: 0;
  gap: clamp(4px, 0.86vh, 7px);
  padding: 7px 5px;
  border: 1px solid rgba(213, 225, 243, 0.64);
  border-radius: 22px;
  background: var(--rail-surface);
  box-shadow: 0 14px 36px rgba(31, 78, 145, 0.1);
  backdrop-filter: blur(14px);
  transform: translateY(-50%);
  transition:
    width 0.2s ease,
    padding 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    backdrop-filter 0.2s ease;
}

@media (min-width: 761px) and (max-height: 720px) {
  .category-rail {
    --rail-dot-size: 32px;
  }

  .category-rail .category-list {
    gap: 4px;
    padding: 6px 5px;
  }

  .category-rail .category-btn {
    min-height: 36px;
  }
}

.category-rail:hover .category-list,
.category-rail:focus-within .category-list,
.category-rail .category-list:hover,
body.history-side-rail-open .history-side-rail .category-list {
  width: 232px;
  padding: 10px;
  border-color: rgba(213, 225, 243, 0.82);
  background: var(--rail-surface);
  box-shadow: 0 22px 56px rgba(31, 78, 145, 0.15);
  backdrop-filter: blur(14px);
}

.category-rail .category-btn {
  gap: 0;
  justify-content: center;
  width: 100%;
  min-height: calc(var(--rail-dot-size) + 4px);
  padding: 0;
  overflow: visible;
  border-radius: 14px;
  white-space: nowrap;
  transition:
    width 0.2s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.category-rail:hover .category-btn,
.category-rail:focus-within .category-btn,
.category-rail .category-list:hover .category-btn,
body.history-side-rail-open .history-side-rail .category-btn {
  gap: 12px;
  width: 100%;
  justify-content: flex-start;
  padding: 0 8px;
}

.category-rail .category-btn span:not(.category-dot),
.category-rail .category-btn small {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition:
    max-width 0.14s ease,
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0.14s ease;
}

.category-rail .category-btn small {
  margin-left: 0;
}

.category-rail:hover .category-btn span:not(.category-dot),
.category-rail:focus-within .category-btn span:not(.category-dot),
.category-rail .category-list:hover .category-btn span:not(.category-dot),
body.history-side-rail-open .history-side-rail .category-btn span:not(.category-dot),
.category-rail:hover .category-btn small,
.category-rail:focus-within .category-btn small,
.category-rail .category-list:hover .category-btn small,
body.history-side-rail-open .history-side-rail .category-btn small {
  max-width: 140px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.category-rail:hover .category-btn small,
.category-rail:focus-within .category-btn small,
.category-rail .category-list:hover .category-btn small,
body.history-side-rail-open .history-side-rail .category-btn small {
  margin-left: auto;
}

.category-rail .category-btn:hover,
.category-rail .category-btn:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, rgba(255, 255, 255, 0.84));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
  outline: none;
}

.category-rail:not(:hover):not(:focus-within) .category-btn.active {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.category-rail:not(:hover):not(:focus-within) .category-btn.active .category-dot {
  transform: scale(1.16);
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 18%, transparent);
}

.category-rail:hover .category-btn.active,
.category-rail:focus-within .category-btn.active,
.category-rail .category-list:hover .category-btn.active,
body.history-side-rail-open .history-side-rail .category-btn.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, rgba(255, 255, 255, 0.85));
}

.category-rail:hover .category-btn.active .category-dot,
.category-rail:focus-within .category-btn.active .category-dot,
.category-rail .category-list:hover .category-btn.active .category-dot,
body.history-side-rail-open .history-side-rail .category-btn.active .category-dot {
  transform: none;
}

.collapse-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #8292ad;
  background: #fff;
  font-size: 20px;
}

.sidebar h3 {
  margin: 26px 0 14px;
  color: #1f2d47;
  font-size: 15px;
}

.sidebar-collapsed .sidebar {
  padding: 26px 14px;
}

.sidebar-collapsed .sidebar h3,
.sidebar-collapsed .side-divider,
.sidebar-collapsed .side-link {
  display: none;
}

.sidebar-collapsed .category-list {
  margin-top: 26px;
}

.category-list,
.side-divider {
  display: grid;
  gap: 8px;
}

.category-btn,
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  color: #31405b;
  background: transparent;
  text-align: left;
}

.side-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.side-link.active {
  color: var(--blue);
  background: #edf4ff;
}

.category-btn small {
  margin-left: auto;
  color: #96a4ba;
  font-size: 12px;
}

.sidebar-collapsed .category-btn {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .category-btn span:not(.category-dot),
.sidebar-collapsed .category-btn small {
  display: none;
}

.category-btn.active {
  color: var(--accent, var(--blue));
  background: color-mix(in srgb, var(--accent, var(--blue)) 13%, #fff);
}

.category-dot {
  display: grid;
  width: var(--rail-dot-size, 38px);
  height: var(--rail-dot-size, 38px);
  min-width: var(--rail-dot-size, 38px);
  min-height: var(--rail-dot-size, 38px);
  flex: 0 0 var(--rail-dot-size, 38px);
  aspect-ratio: 1 / 1;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  font-size: 12px;
  font-weight: 900;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.category-dot svg {
  width: calc(var(--rail-dot-size, 38px) * 0.55);
  height: calc(var(--rail-dot-size, 38px) * 0.55);
}

.side-divider {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.bank-main,
.history-main,
.training-page {
  padding: 32px 36px;
}

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

.page-heading h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  margin: 24px 0 18px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.filter-row,
.tab-row,
.template-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  color: #72819c;
  background: rgba(255, 255, 255, 0.8);
}

.chip.active,
.tab-row button.active,
.template-card.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #edf4ff;
}

.topic-browser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
}

.topic-list {
  max-height: 520px;
  overflow: auto;
}

.topic-row {
  grid-template-columns: 76px minmax(220px, 1fr) 74px minmax(168px, 196px);
  min-height: 76px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e8eef8;
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
}

.topic-row.active,
.topic-row:hover {
  background: #f3f8ff;
}

.topic-row.practiced.active,
.topic-row.practiced:hover {
  background: #eafbf3;
}

.topic-row p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #283954;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stars {
  color: #163763;
  letter-spacing: 2px;
}

.topic-detail {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 22px;
}

.topic-detail-copy {
  min-width: 0;
}

.topic-detail h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.topic-detail p {
  color: var(--muted);
  line-height: 1.7;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.detail-list .tag-row {
  justify-content: flex-start;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.detail-list strong {
  color: #24344f;
}

.topic-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.topic-detail-difficulty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.topic-detail-difficulty strong {
  color: #24344f;
}

@media (min-width: 761px) and (max-width: 1440px), (min-width: 761px) and (max-height: 900px) {
  .topic-browser {
    grid-template-columns: 1fr;
  }

  .topic-detail {
    order: -1;
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) 148px;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
  }

  .topic-detail-copy {
    grid-column: 1;
  }

  .topic-detail h2 {
    margin: 0;
  }

  .topic-detail p {
    margin: 10px 0 0;
  }

  .topic-detail .detail-list {
    grid-column: 2;
    align-self: stretch;
    align-content: center;
    gap: 8px;
    margin: 0;
  }

  .topic-detail-tags {
    gap: 6px;
    align-content: center;
  }

  .topic-detail-tags .tag {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .topic-detail .topic-detail-actions {
    grid-column: 3;
    display: grid;
    justify-items: center;
    gap: 8px;
  }

  .topic-detail .primary {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  .topic-detail .detail-heart {
    width: 40px;
    height: 40px;
  }

  .topic-detail-difficulty {
    display: grid;
    justify-items: center;
    line-height: 1.2;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .topic-detail {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 190px) 140px;
  }
}

.training-page {
  max-width: 1240px;
  margin: 0 auto;
}

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

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

.timer-card {
  position: fixed;
  top: 106px;
  right: 28px;
  z-index: 30;
  width: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 38px rgba(31, 78, 145, 0.07);
  touch-action: none;
  user-select: none;
}

.timer-card.is-collapsed {
  display: inline-flex;
  width: auto;
  min-width: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.timer-card.is-dragging {
  box-shadow: 0 26px 70px rgba(31, 78, 145, 0.2);
  cursor: grabbing;
}

.timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
}

.timer-head h2 {
  margin: 0;
  font-size: 16px;
}

.timer-head span {
  color: #6c7b96;
  font-size: 12px;
  font-weight: 800;
}

.timer-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.timer-icon-button {
  display: inline-flex;
  min-width: 58px;
  height: 28px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid #d7e4f5;
  border-radius: 999px;
  background: #f8fbff;
  color: #49607f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.timer-icon-button b {
  font-size: 16px;
  line-height: 1;
}

.timer-icon-button:hover {
  border-color: #a9c4ef;
  color: var(--blue);
  background: #fff;
}

.timer-time {
  margin: 18px 0 12px;
  color: #10203d;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
}

.timer-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e9f5;
}

.timer-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.2s ease;
}

.timer-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: #63728c;
  font-size: 13px;
  font-weight: 800;
}

.timer-input input {
  width: 72px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  font-weight: 900;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.timer-mini-button {
  display: inline-flex;
  min-width: 54px;
  height: 54px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cfe0f6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue);
  box-shadow: 0 14px 34px rgba(31, 78, 145, 0.14);
  cursor: grab;
}

.timer-card.is-dragging .timer-mini-button {
  cursor: grabbing;
}

.timer-mini-button svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timer-mini-button span {
  min-width: 56px;
  color: #13223d;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.timer-card.is-collapsed.is-paused .timer-mini-button {
  width: 54px;
  padding: 0;
  color: #49607f;
}

.timer-card.is-collapsed.is-running .timer-mini-button {
  min-width: 116px;
}

button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 20px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.step {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  border: 0;
  color: #8190aa;
  background: transparent;
  font-weight: 900;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(50% + 88px);
  right: calc(-50% + 88px);
  top: 50%;
  height: 2px;
  background: #dce5f2;
  z-index: 0;
}

.step.done:not(:last-child)::after {
  background: var(--blue);
}

.step:disabled {
  cursor: default;
}

.step span {
  position: relative;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #d4deef;
  border-radius: 50%;
  background: #fff;
}

.step {
  z-index: 1;
}

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

.step.active span,
.step.done span {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.step.done {
  color: #20b982;
}

.step.done span {
  border-color: var(--green);
  background: var(--green);
}

.question-card {
  margin-bottom: 20px;
  padding: 24px;
}

.question-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ai-source-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
}

.ai-source-badge.live {
  color: #0d8f67;
  background: #e7fbf2;
}

.ai-source-badge.demo {
  color: #b7791f;
  background: #fff4d8;
}

.ai-source-badge.error {
  color: #c2410c;
  background: #ffedd5;
}

.question-card p {
  max-width: none;
  margin: 16px 0 0;
  color: #273854;
  font-size: 17px;
  line-height: 1.75;
}

.question-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.thought-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #bcd2fb;
  border-radius: 10px;
  padding: 0 15px;
  color: var(--blue);
  background: #f7fbff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.thought-trigger:hover {
  transform: translateY(-1px);
  border-color: #7eabff;
  box-shadow: 0 10px 22px rgba(25, 103, 255, 0.12);
}

.thought-trigger.is-ready {
  color: #0d8f67;
  border-color: #bcebd8;
  background: #ecfbf5;
}

.thought-trigger.is-error {
  color: #c2410c;
  border-color: #fed7aa;
  background: #fff7ed;
}

.button-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.button-spinner.large {
  width: 42px;
  height: 42px;
  border-width: 4px;
}

.template-card {
  min-width: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.template-card strong {
  display: block;
  margin-bottom: 8px;
}

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

.outline-card,
.sentence-panel {
  padding: 22px;
}

.outline-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.outline-title-row h2 {
  margin: 0;
}

.settings-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  border: 1px solid #d6deec;
  border-radius: 999px;
  padding: 8px 12px;
  color: #42506a;
  background: #f5f7fb;
  font-size: 13px;
  font-weight: 900;
}

.settings-trigger svg {
  width: 16px;
  height: 16px;
}

.settings-trigger b {
  color: var(--blue);
  font-size: 12px;
}

.settings-trigger:hover {
  border-color: #c4d3ec;
  background: #eef4ff;
}

.settings-trigger.guide-active {
  border-color: rgba(25, 103, 255, 0.42);
  background: #eef4ff;
  animation: preference-trigger-pulse 5.6s ease-in-out infinite;
}

.preference-guide-cursor {
  position: absolute;
  z-index: 5;
  width: 24px;
  height: 28px;
  pointer-events: none;
  transform-origin: 4px 4px;
}

.preference-guide-cursor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #17243c;
  clip-path: polygon(0 0, 0 100%, 33% 72%, 52% 100%, 70% 91%, 52% 64%, 88% 64%);
  filter: drop-shadow(0 8px 10px rgba(23, 36, 60, 0.2));
}

.preference-guide-cursor::after {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(25, 103, 255, 0.38);
  border-radius: 50%;
  opacity: 0;
}

.preference-guide-cursor-trigger {
  top: 28px;
  right: 30px;
  animation: preference-trigger-cursor 5.6s cubic-bezier(0.2, 0.78, 0.22, 1) infinite both;
}

.preference-guide-cursor-trigger::after {
  animation: preference-click-ring 5.6s ease-out infinite both;
}

.help-dot {
  position: relative;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #bcc9dd;
  border-radius: 50%;
  color: #8594ad;
  font-size: 12px;
  font-weight: 900;
}

.help-dot:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: 260px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #40506b;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 78, 145, 0.14);
  font-size: 13px;
  font-weight: 700;
  transform: translateX(-50%);
  z-index: 10;
}

.help-dot.multiline-help:hover::after {
  content: attr(data-tooltip);
  width: 330px;
  max-width: min(330px, calc(100vw - 64px));
  line-height: 1.65;
  white-space: pre-line;
  text-align: left;
  z-index: 40;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 31, 55, 0.22);
  backdrop-filter: blur(5px);
}

.settings-modal {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 28px 70px rgba(29, 65, 120, 0.24);
}

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

.settings-modal h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.settings-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #67758f;
  background: #f8fbff;
  font-size: 22px;
  line-height: 1;
}

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

.settings-field {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.target-level-field {
  position: relative;
}

.target-level-field.guide-active select {
  border-color: rgba(25, 103, 255, 0.52);
  background: #f3f8ff;
  box-shadow: 0 0 0 4px rgba(25, 103, 255, 0.08);
}

.preference-guide-choice {
  position: absolute;
  top: 43px;
  right: 42px;
  z-index: 4;
  display: inline-grid;
  min-width: 56px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(25, 103, 255, 0.2);
  border-radius: 999px;
  color: var(--blue);
  background: #eef4ff;
  box-shadow: 0 10px 22px rgba(31, 78, 145, 0.16);
  font-size: 13px;
  font-weight: 900;
  animation: preference-choice-float 5.6s ease-in-out infinite both;
}

.preference-guide-cursor-level {
  top: 49px;
  right: 80px;
  animation: preference-level-cursor 5.6s cubic-bezier(0.2, 0.78, 0.22, 1) infinite both;
}

.preference-guide-cursor-level::after {
  animation: preference-click-ring 5.6s ease-out infinite both;
}

.settings-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-field span,
.settings-label span:first-child {
  color: #263753;
  font-weight: 900;
}

.settings-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: #24344f;
  background: #f8fbff;
  font: inherit;
  font-weight: 800;
}

.task-response-settings {
  padding-top: 4px;
}

.task-response-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.task-response-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid #e1e8f4;
  border-radius: 999px;
  padding: 4px 10px;
  color: #5d6d86;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 850;
}

.tr-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.88);
}

.tr-dot.tr-green {
  background: #32c78a;
}

.tr-dot.tr-yellow {
  background: #f5b72e;
}

.tr-dot.tr-red {
  background: #ff617b;
}

@keyframes preference-trigger-pulse {
  0%,
  34%,
  62%,
  100% {
    box-shadow: none;
  }

  44%,
  54% {
    box-shadow: 0 0 0 8px rgba(25, 103, 255, 0.1);
  }
}

@keyframes preference-trigger-cursor {
  0%,
  12% {
    opacity: 0;
    transform: translate(-150px, 34px) rotate(-18deg) scale(0.96);
  }

  34% {
    opacity: 1;
    transform: translate(-48px, 14px) rotate(-18deg) scale(1);
  }

  44%,
  56% {
    opacity: 1;
    transform: translate(0, 0) rotate(-18deg) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(0, 0) rotate(-18deg) scale(0.88);
  }

  72%,
  100% {
    opacity: 0;
    transform: translate(0, 0) rotate(-18deg) scale(1);
  }
}

@keyframes preference-level-cursor {
  0%,
  10% {
    opacity: 0;
    transform: translate(-130px, -42px) rotate(-18deg) scale(0.96);
  }

  28% {
    opacity: 1;
    transform: translate(-58px, -18px) rotate(-18deg) scale(1);
  }

  42%,
  56% {
    opacity: 1;
    transform: translate(0, 0) rotate(-18deg) scale(1);
  }

  49% {
    opacity: 1;
    transform: translate(0, 0) rotate(-18deg) scale(0.88);
  }

  74%,
  100% {
    opacity: 0;
    transform: translate(0, 0) rotate(-18deg) scale(1);
  }
}

@keyframes preference-click-ring {
  0%,
  43%,
  62%,
  100% {
    opacity: 0;
    transform: scale(0.35);
  }

  49% {
    opacity: 0.72;
    transform: scale(0.75);
  }

  59% {
    opacity: 0;
    transform: scale(1.65);
  }
}

@keyframes preference-choice-float {
  0%,
  30%,
  70%,
  100% {
    opacity: 0;
    transform: translateY(4px);
  }

  38%,
  60% {
    opacity: 1;
    transform: translateY(0);
  }
}

.thought-reference-backdrop,
.task-response-backdrop {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(16, 31, 55, 0.22);
  backdrop-filter: blur(5px);
  animation: modalBackdropIn 0.2s ease both;
}

.thought-reference-modal,
.task-response-modal {
  width: min(720px, calc(100vw - 42px));
  max-height: calc(100vh - 70px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 30px 80px rgba(29, 65, 120, 0.26);
  animation: modalScaleIn 0.24s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.thought-reference-modal header,
.task-response-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.thought-reference-modal h2,
.thought-reference-modal h3 {
  margin: 0;
}

.task-response-modal {
  width: min(620px, calc(100vw - 42px));
}

.task-response-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-response-modal-body {
  display: grid;
  gap: 14px;
}

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

.thought-mode-option {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  color: #253653;
  background: #f8fbff;
  text-align: left;
  cursor: pointer;
}

.thought-mode-option.active {
  border-color: #8bb6ff;
  background: #eef6ff;
  box-shadow: 0 14px 28px rgba(25, 103, 255, 0.12);
}

.thought-mode-option strong {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 17px;
}

.thought-mode-option span {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.65;
}

.thought-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.thought-loading {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid #dbe7fb;
  border-radius: 14px;
  padding: 22px;
  background: #f7fbff;
}

.thought-loading strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.thought-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.thought-error {
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 18px;
  color: #9a3412;
  background: #fff7ed;
}

.thought-error strong {
  display: block;
  margin-bottom: 8px;
}

.thought-error p {
  margin: 0;
}

.thought-result {
  display: grid;
  gap: 16px;
}

.thought-result section {
  border: 1px solid #e4edf8;
  border-radius: 14px;
  padding: 16px;
  background: #fbfdff;
}

.thought-result h3 {
  margin-bottom: 10px;
  color: #152945;
  font-size: 16px;
}

.thought-result p,
.thought-list {
  margin: 0;
  color: #273854;
  line-height: 1.75;
}

.thought-list {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

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

.thought-chain {
  border-radius: 12px;
  padding: 12px 14px;
  background: #f4f8ff;
}

.thought-chain strong {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
}

.thought-chain span {
  color: var(--blue);
  font-weight: 900;
}

.keyword-hints {
  display: grid;
  gap: 8px;
}

.keyword-hints p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.keyword-hints strong {
  color: #152945;
}

.keyword-hints span {
  color: #61708d;
  font-weight: 800;
}

.outline-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 54px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.editor-toolbar button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #2a3650;
  background: transparent;
}

.editor-toolbar button:hover {
  background: #eef4ff;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 6px;
  background: var(--line);
}

.template-insert {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #66758f;
  background: #f8fbff;
  font-size: 13px;
  font-weight: 800;
}

.template-insert select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.template-insert::after {
  content: "⌄";
  color: #8b9ab2;
}

.outline-input-wrap {
  position: relative;
  min-height: 320px;
}

.outline-textarea {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 0;
  padding: 22px;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  line-height: 1.58;
}

.outline-placeholder {
  position: absolute;
  top: 22px;
  right: 22px;
  left: 22px;
  z-index: 2;
  white-space: pre-wrap;
  color: #9aa7bb;
  opacity: 0.86;
  pointer-events: none;
  font-size: 15px;
  line-height: 1.58;
}

.outline-input-wrap.is-editing .outline-placeholder,
.outline-input-wrap:focus-within .outline-placeholder,
.outline-input-wrap.has-content .outline-placeholder {
  display: none;
}

.editor-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.outline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #253652;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
}

textarea:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(25, 103, 255, 0.08);
}

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

.translation-stage,
.feedback-stage {
  position: relative;
}

.task-response-card {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid #d9e3f2;
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(31, 78, 145, 0.1);
}

.task-response-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-response-card h3 {
  margin: 4px 0 0;
  color: #172845;
  font-size: 18px;
}

.task-response-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.task-response-mode {
  display: inline-grid;
  min-width: 46px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #1967ff;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 900;
}

.task-response-loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #60708a;
  font-size: 14px;
  font-weight: 750;
}

.task-response-loading-row p,
.task-response-error > p {
  margin: 0;
  color: #60708a;
}

.task-response-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.task-response-modal .task-response-list {
  grid-template-columns: 1fr;
}

.task-response-row {
  min-height: 76px;
  border: 1px solid #e1e9f5;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.task-response-row.tr-green {
  min-height: 0;
  padding: 10px 12px;
}

.task-response-row.tr-yellow {
  border-color: rgba(245, 183, 46, 0.38);
  background: #fffaf0;
}

.task-response-row.tr-red {
  border-color: rgba(255, 97, 123, 0.36);
  background: #fff6f8;
}

.task-response-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #223350;
  font-size: 14px;
  line-height: 1.45;
}

.task-response-row small {
  color: #7887a0;
  font-size: 12px;
}

.task-response-row strong em {
  color: #66758f;
  font-size: 12px;
  font-style: normal;
}

.task-response-issues {
  display: grid;
  gap: 9px;
  margin-top: 8px;
}

.task-response-issue p {
  margin: 8px 0 0;
  color: #53637d;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.65;
}

.task-response-reference {
  margin-top: 8px;
}

.task-response-reference summary {
  display: inline-grid;
  min-height: 26px;
  align-items: center;
  border: 1px solid #dfe7f3;
  border-radius: 999px;
  padding: 0 10px;
  color: #61708a;
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.task-response-reference summary::-webkit-details-marker {
  display: none;
}

.task-response-reference summary:hover,
.task-response-reference summary:focus-visible {
  border-color: #cbd8ea;
  background: #fff;
  outline: none;
}

.task-response-reference div {
  margin-top: 8px;
  border-left: 3px solid #d9e4f3;
  padding: 8px 10px;
  color: #46566f;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .task-response-list {
    grid-template-columns: 1fr;
  }

  .task-response-card header {
    align-items: flex-start;
  }
}

.translation-panel {
  min-height: 480px;
}

.sentence-nav {
  position: fixed;
  z-index: 14;
  top: clamp(260px, 42vh, 386px);
  left: max(32px, calc((100vw - 1240px) / 2 - 276px));
  width: 300px;
  max-height: min(520px, calc(100vh - 120px));
  overflow: auto;
}

.sentence-nav.is-dragging {
  opacity: 0.94;
  user-select: none;
}

.sentence-panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.sentence-nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  cursor: move;
}

.sentence-nav-title h2 {
  margin: 0;
}

.sentence-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sentence-nav-reset {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #66748d;
  background: #fff;
  font-weight: 900;
}

.sentence-nav-toggle {
  min-width: 58px;
  height: 28px;
}

.sentence-nav-title button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sentence-nav-toggle svg {
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.sentence-nav.is-collapsed {
  width: 78px;
  padding: 10px;
  overflow: visible;
}

.sentence-nav.is-collapsed .sentence-nav-title {
  justify-content: center;
  margin-bottom: 10px;
}

.sentence-nav.is-collapsed .sentence-nav-title h2,
.sentence-nav.is-collapsed [data-action="reset-sentence-nav"] {
  display: none;
}

.sentence-nav.is-collapsed .sentence-nav-toggle svg {
  transform: rotate(-90deg);
}

.sentence-nav.is-collapsed .sentence-list {
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.sentence-nav.is-collapsed .sentence-list button {
  grid-template-columns: 1fr;
  width: 44px;
  min-height: 44px;
  padding: 8px;
  place-items: center;
  border-radius: 999px;
  text-align: center;
}

.sentence-nav.is-collapsed .sentence-list button b {
  width: 28px;
  height: 28px;
}

.sentence-nav.is-collapsed .sentence-list .sentence-text,
.sentence-nav.is-collapsed .sentence-list .sentence-meta {
  display: none;
}

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

.translation-heading h2 {
  margin: 0;
}

.text-link {
  padding: 4px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 900;
}

.sentence-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow-y: auto;
  padding: 0 4px 0 0;
  margin: 0;
  list-style: none;
}

.sentence-list button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #2a3a55;
  background: #fff;
  text-align: left;
}

.sentence-list button b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #6d7b94;
  background: #eef3fb;
  font-size: 13px;
}

.sentence-list button span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sentence-list .sentence-meta {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.sentence-meta em,
.sentence-meta strong {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  font-style: normal;
  font-weight: 800;
}

.sentence-meta em {
  color: #6b7890;
}

.sentence-meta strong {
  padding: 2px 6px;
  color: #6d7b94;
  background: #eef3fb;
}

.sentence-list button.active {
  border-color: var(--blue);
  background: #edf4ff;
}

.sentence-list button.active b {
  color: #fff;
  background: var(--blue);
}

.sentence-list button.active.pending .sentence-meta strong {
  color: var(--blue);
  background: #e7f0ff;
}

.sentence-list button.completed b {
  color: #fff;
  background: var(--green);
}

.sentence-list button.completed .sentence-meta strong {
  color: #179b69;
  background: #e8fbf3;
}

.sentence-list button.feedback-loading b {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green), var(--violet));
  background-size: 180% 180%;
  animation: feedbackGradientShift 1.35s ease-in-out infinite;
}

.sentence-list button.feedback-loading .sentence-meta strong {
  color: var(--blue);
  background: #eaf2ff;
}

.sentence-list button.feedback-error b {
  color: #fff;
  background: #f07a12;
}

.sentence-list button.feedback-error .sentence-meta strong {
  color: #c2410c;
  background: #fff1e7;
}

.sentence-list button.skipped b {
  color: #7a879d;
  background: #e5eaf2;
}

.sentence-list button.skipped .sentence-meta strong {
  color: #7a879d;
  background: #eef1f6;
}

.hint {
  margin: 12px 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #63728c;
  background: #f3f7ff;
  font-size: 13px;
}

.translation-box {
  min-height: 190px;
  font-size: 17px;
}

.translation-editor {
  position: relative;
}

.translation-editor .translation-box {
  padding-bottom: 38px;
}

.word-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: #7d8ca5;
  font-size: 12px;
}

.translation-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.translation-actions button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.translation-actions .primary {
  margin-left: 0;
  min-width: 0;
}

.action-with-icon svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1500px) {
  .translation-stage,
  .feedback-stage {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
  }

  .translation-stage.has-collapsed-sentence-nav,
  .feedback-stage.has-collapsed-sentence-nav {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sentence-nav {
    position: static;
    width: auto;
    max-height: none;
  }

  .translation-stage > .sentence-nav,
  .feedback-stage > .sentence-nav {
    grid-column: 1;
  }

  .feedback-stage > .sentence-nav {
    grid-row: 1 / span 2;
  }

  .translation-stage > .sentence-panel:not(.sentence-nav),
  .feedback-stage > .feedback-progress-banner,
  .feedback-stage > .feedback-card {
    grid-column: 2;
    min-width: 0;
  }

  .feedback-stage > .feedback-progress-banner {
    grid-row: 1;
    align-self: start;
  }

  .feedback-stage > .feedback-card {
    grid-row: 2;
  }
}

@media (max-width: 1180px) {
  .training-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .timer-card {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    order: -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    margin: 0 0 4px;
    padding: 10px 12px;
    touch-action: auto;
  }

  .timer-card.is-collapsed {
    width: auto;
    align-self: flex-start;
    padding: 0;
    background: transparent;
  }

  .timer-card.is-dragging {
    box-shadow: 0 16px 38px rgba(31, 78, 145, 0.07);
    cursor: default;
  }

  .timer-head {
    cursor: default;
  }

  .timer-head h2 {
    font-size: 14px;
  }

  .timer-time {
    margin: 0;
    font-size: 24px;
  }

  .timer-progress {
    flex: 1 1 140px;
    min-width: 100px;
  }

  .timer-input,
  .timer-actions {
    margin-top: 0;
  }

  .timer-input input {
    width: 60px;
    height: 32px;
  }

  .timer-actions {
    display: flex;
    flex: 0 0 auto;
  }

  .translation-stage,
  .feedback-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .translation-stage > .sentence-nav,
  .translation-stage > .sentence-panel:not(.sentence-nav),
  .feedback-stage > .sentence-nav,
  .feedback-stage > .feedback-progress-banner,
  .feedback-stage > .feedback-card {
    grid-column: 1;
    grid-row: auto;
  }

  .sentence-nav {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 12px 14px;
  }

  .sentence-nav.is-dragging {
    opacity: 1;
    user-select: auto;
  }

  .sentence-nav-title {
    margin-bottom: 10px;
    cursor: default;
  }

  .sentence-nav-title h2,
  .sentence-panel h2 {
    font-size: 16px;
  }

  .sentence-nav-title .sentence-nav-toggle {
    display: inline-flex;
  }

  .sentence-nav-title .sentence-nav-reset {
    display: none;
  }

  .sentence-list {
    display: flex;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
  }

  .sentence-list li {
    flex: 0 0 auto;
  }

  .sentence-list button {
    display: grid;
    grid-template-columns: 1fr;
    width: 44px;
    min-height: 44px;
    padding: 8px;
    place-items: center;
    border-radius: 999px;
    text-align: center;
  }

  .sentence-list button b {
    width: 28px;
    height: 28px;
  }

  .sentence-list .sentence-text,
  .sentence-list .sentence-meta {
    display: none;
  }

  .sentence-nav.is-collapsed {
    width: 100%;
    padding: 12px 14px;
    overflow: visible;
  }

  .sentence-nav.is-collapsed .sentence-nav-title {
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .sentence-nav.is-collapsed .sentence-nav-title h2 {
    display: block;
  }

  .sentence-nav.is-collapsed .sentence-list {
    display: flex;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
  }
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7f4;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.25s ease;
}

.feedback-layout {
  display: grid;
  gap: 18px;
}

.feedback-card {
  padding: 22px;
}

.feedback-card h3 {
  margin: 0 0 10px;
}

.feedback-progress-banner {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #cfe0ff;
  border-radius: var(--radius);
  color: #274066;
  background: linear-gradient(135deg, rgba(25, 103, 255, 0.08), rgba(54, 197, 138, 0.08));
}

.feedback-progress-banner div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.feedback-progress-banner strong {
  font-size: 14px;
  font-weight: 900;
}

.feedback-progress-banner span {
  color: #60708a;
  font-size: 13px;
  font-weight: 800;
}

.feedback-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(214, 224, 240, 0.9);
}

.feedback-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.25s ease;
}

.feedback-pending-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  border-color: #cfe0ff;
  background: rgba(255, 255, 255, 0.9);
}

.feedback-pending-visual {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(25, 103, 255, 0.12), rgba(123, 77, 255, 0.12), rgba(54, 197, 138, 0.14));
}

.feedback-pending-visual span {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
  animation: feedbackOrbit 1.45s ease-in-out infinite;
}

.feedback-pending-visual span:nth-child(2) {
  background: var(--green);
  animation-delay: 0.14s;
}

.feedback-pending-visual span:nth-child(3) {
  background: var(--violet);
  animation-delay: 0.28s;
}

.feedback-pending-visual span:nth-child(4) {
  background: #ffac3d;
  animation-delay: 0.42s;
}

.feedback-sentence-error {
  border-color: #fed7aa;
  background: #fffaf5;
}

.feedback-sentence-error h3 {
  color: #c2410c;
}

.feedback-sentence-error > p:not(.feedback-cn-sentence) {
  margin: 0;
  color: #5f6f89;
  line-height: 1.7;
}

.feedback-error-state {
  max-width: 760px;
  margin: 0 auto;
  border-color: #fed7aa;
  background: #fffaf5;
}

.feedback-error-state h3 {
  color: #c2410c;
}

.feedback-error-state p {
  margin: 0;
  color: #5f6f89;
  line-height: 1.7;
}

.feedback-cn-sentence {
  margin: 0 0 12px;
  color: #253652;
  font-size: 16px;
  line-height: 1.7;
}

.user-translation {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.user-translation strong {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 13px;
}

.user-translation p {
  margin: 0;
  color: #263651;
  line-height: 1.65;
}

.answer-box {
  margin: 12px 0;
  padding: 18px;
  border: 1px solid #a9c6ff;
  border-radius: var(--radius);
  color: var(--blue);
  background: #f3f8ff;
  line-height: 1.6;
}

.answer-box > strong,
.feedback-box > strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 900;
}

.answer-box svg,
.feedback-box svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.answer-box p {
  margin: 0;
  color: #155de8;
  font-size: 18px;
  line-height: 1.7;
}

.answer-box p strong {
  font-weight: 900;
}

.feedback-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.feedback-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.feedback-praise {
  border-color: #bfeeda;
  color: #17a36f;
  background: #fbfffd;
}

.feedback-improve {
  border-color: #ffd8ad;
  color: #f07a12;
  background: #fffdf9;
}

.feedback-advanced {
  border-color: #d7c7ff;
  color: #7b4dff;
  background: #fdfbff;
}

.feedback-box ul {
  margin: 0;
  padding-left: 18px;
  color: #42506a;
  line-height: 1.7;
}

.expression-list {
  display: grid;
  gap: 8px;
  padding-left: 0 !important;
  list-style: none;
}

.expression-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(123, 77, 255, 0.06);
}

.expression-item b {
  color: #3c2c77;
  font-weight: 900;
}

.expression-item span {
  color: #6d5aa6;
  font-size: 13px;
}

.feedback-save-list {
  display: grid;
  gap: 8px;
  padding-left: 0 !important;
  list-style: none;
}

.feedback-save-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 172, 61, 0.08);
}

.feedback-empty-line {
  margin: 0;
  color: #6a7489;
  line-height: 1.7;
}

.improvement-save-item {
  padding: 10px 12px;
}

.improvement-body {
  display: grid;
  gap: 7px;
  color: #42506a;
  line-height: 1.6;
}

.improvement-body p {
  margin: 0;
}

.inline-expression-favorite {
  position: relative;
  display: inline;
  vertical-align: baseline;
}

.inline-expression-text {
  display: inline;
  color: #743f0a;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(240, 122, 18, 0.34);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.inline-expression-favorite.active .inline-expression-text {
  color: #8b5b10;
  text-decoration-color: rgba(255, 172, 61, 0.72);
}

.inline-expression-popover {
  position: fixed;
  z-index: 1000;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 54px;
  padding: 14px 18px;
  pointer-events: auto;
}

.inline-expression-popover.hidden {
  display: none;
}

.inline-expression-meaning {
  width: max-content;
  max-width: min(280px, calc(100vw - 64px));
  padding: 8px 10px;
  border: 1px solid #f2c48b;
  border-radius: 8px;
  color: #5f390b;
  background: #fffaf2;
  box-shadow: 0 12px 28px rgba(170, 98, 18, 0.16);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
}

.inline-popover-favorite {
  width: 26px;
  height: 26px;
  border-color: #f2c48b;
  box-shadow: 0 8px 18px rgba(170, 98, 18, 0.16);
}

.inline-popover-favorite svg {
  width: 14px;
  height: 14px;
}

.improvement-body b {
  color: #8b4d0f;
}

.improvement-original {
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  color: #8b4d0f;
  background: rgba(255, 172, 61, 0.14);
  font-weight: 800;
}

.improvement-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.improvement-alternatives span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #70400d;
  background: #fff;
  border: 1px solid rgba(255, 172, 61, 0.28);
  font-weight: 700;
}

.favorite-btn {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #d9e3f4;
  border-radius: 50%;
  color: #9aa8bd;
  background: #fff;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.favorite-btn svg {
  width: 16px;
  height: 16px;
}

.favorite-btn.active {
  border-color: #ffd18a;
  color: #ffac3d;
  background: #fff7e8;
}

.favorite-btn.pop {
  animation: favoritePop 0.38s ease;
}

@keyframes favoritePop {
  0% {
    transform: scale(0.82);
  }
  50% {
    transform: scale(1.22) rotate(-8deg);
  }
  100% {
    transform: scale(1);
  }
}

.tab-row {
  margin: 24px 0;
  border-bottom: 1px solid var(--line);
}

.tab-row button {
  margin-bottom: -1px;
  padding: 0 4px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #72819c;
  background: transparent;
  font-weight: 900;
}

.tab-row .period-toggle {
  float: right;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: #fff;
}

.tab-row button.active {
  border-color: var(--blue);
  background: transparent;
}

.history-entry-grid {
  --entry-fly-step: clamp(72px, 7.4vw, 142px);
  display: grid;
  position: relative;
  z-index: 8;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  height: 58px;
  margin: 0 auto 16px;
  padding: 8px 0;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition:
    grid-template-columns 0.82s cubic-bezier(0.16, 0.82, 0.24, 1),
    border-color 0.18s ease,
    border-radius 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.history-entry-grid:hover,
.history-entry-grid:focus-within {
  position: relative;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  width: 100%;
  padding: 0;
  border-color: transparent;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

.history-entry-card {
  --entry-accent: var(--blue);
  --entry-shift: 0px;
  display: grid;
  grid-template-columns: 42px;
  gap: 0;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #20324f;
  background: transparent;
  box-shadow: none;
  text-align: left;
  transform: translateX(var(--entry-shift));
  will-change: transform, width, min-height, padding;
  transition:
    transform 0.9s cubic-bezier(0.16, 0.88, 0.2, 1),
    width 0.74s cubic-bezier(0.16, 0.88, 0.2, 1),
    min-height 0.58s ease,
    padding 0.58s ease,
    border-color 0.32s ease,
    border-radius 0.58s ease 0.04s,
    background 0.32s ease,
    box-shadow 0.32s ease;
}

.history-entry-card:nth-child(1) {
  --entry-shift: calc(var(--entry-fly-step) * 3);
}

.history-entry-card:nth-child(2) {
  --entry-shift: var(--entry-fly-step);
}

.history-entry-card:nth-child(3) {
  --entry-shift: calc(var(--entry-fly-step) * -1);
}

.history-entry-card:nth-child(4) {
  --entry-shift: calc(var(--entry-fly-step) * -3);
}

.history-entry-grid:hover .history-entry-card,
.history-entry-grid:focus-within .history-entry-card {
  --entry-shift: 0px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  justify-content: stretch;
  width: 100%;
  min-height: 88px;
  padding: 14px;
  border-color: rgba(213, 225, 243, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 16px 40px rgba(31, 78, 145, 0.08);
  backdrop-filter: blur(14px);
}

.history-entry-grid:hover .history-entry-icon,
.history-entry-grid:focus-within .history-entry-icon {
  width: 38px;
  height: 38px;
}

.history-entry-card.green {
  --entry-accent: var(--green);
}

.history-entry-card.violet {
  --entry-accent: var(--violet);
}

.history-entry-card.amber {
  --entry-accent: var(--amber);
}

.history-entry-card:hover,
.history-entry-card:focus-visible,
.history-entry-card.active {
  border-color: color-mix(in srgb, var(--entry-accent) 34%, #d5e1f3);
  background: color-mix(in srgb, var(--entry-accent) 12%, rgba(255, 255, 255, 0.74));
  box-shadow: 0 20px 48px color-mix(in srgb, var(--entry-accent) 14%, rgba(31, 78, 145, 0.1));
  outline: none;
  transform: translateX(var(--entry-shift)) translateY(-2px);
}

.history-entry-grid:not(:hover):not(:focus-within) .history-entry-card.active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: translateX(var(--entry-shift));
}

.history-entry-grid:not(:hover):not(:focus-within) .history-entry-card.active .history-entry-icon {
  transform: scale(1.12);
  background: color-mix(in srgb, var(--entry-accent) 18%, #fff);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--entry-accent) 18%, transparent);
}

.history-entry-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--entry-accent);
  background: color-mix(in srgb, var(--entry-accent) 14%, #fff);
  transition:
    transform 0.64s cubic-bezier(0.16, 0.88, 0.2, 1),
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.history-entry-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.history-entry-card strong,
.history-entry-card small {
  display: block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  will-change: opacity, transform, max-width;
  transition:
    max-width 0.18s ease,
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
}

.history-entry-card > span:not(.history-entry-icon) {
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.history-entry-grid:hover .history-entry-card > span:not(.history-entry-icon),
.history-entry-grid:focus-within .history-entry-card > span:not(.history-entry-icon) {
  width: auto;
  height: auto;
  pointer-events: auto;
}

.history-entry-grid:hover .history-entry-card strong,
.history-entry-grid:hover .history-entry-card small,
.history-entry-grid:focus-within .history-entry-card strong,
.history-entry-grid:focus-within .history-entry-card small {
  max-width: 190px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    max-width 0.36s ease 0.04s,
    opacity 0.34s ease 0.06s,
    transform 0.34s ease 0.06s,
    visibility 0.34s ease 0.06s;
}

.history-entry-card strong {
  font-size: 16px;
}

.history-entry-card small {
  margin-top: 4px;
  color: #74829a;
  font-size: 12px;
  line-height: 1.45;
}

.history-entry-card b {
  display: grid;
  min-width: 0;
  height: 0;
  place-items: center;
  border-radius: 999px;
  color: var(--entry-accent);
  background: color-mix(in srgb, var(--entry-accent) 10%, #fff);
  font-size: 13px;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  will-change: opacity, transform, max-width;
  transition:
    max-width 0.18s ease,
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
}

.history-entry-grid:hover .history-entry-card b,
.history-entry-grid:focus-within .history-entry-card b {
  min-width: 30px;
  height: 30px;
  max-width: 54px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    max-width 0.36s ease 0.08s,
    opacity 0.34s ease 0.1s,
    transform 0.34s ease 0.1s,
    visibility 0.34s ease 0.1s;
}

.back-top-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 18;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(213, 225, 243, 0.86);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 30px rgba(31, 78, 145, 0.12);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.back-top-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transform: rotate(180deg);
}

.back-top-button:hover,
.back-top-button:focus-visible {
  border-color: #bdd0ef;
  background: #fff;
  box-shadow: 0 18px 38px rgba(31, 78, 145, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.practice-records {
  display: grid;
  gap: 16px;
}

.record-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.record-heading h2,
.record-heading p {
  margin: 0;
}

.record-heading h2 {
  color: #172641;
  font-size: 22px;
}

.record-heading p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.record-heading > span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf4ff;
  font-weight: 900;
}

.record-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 160px;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.record-tools label {
  display: grid;
  gap: 6px;
  color: #657590;
  font-size: 12px;
  font-weight: 900;
}

.record-tools input,
.record-tools select {
  height: 42px;
  min-width: 0;
  border: 1px solid #dbe6f4;
  border-radius: 10px;
  padding: 0 12px;
  color: #243654;
  background: #fff;
}

.practice-record-list {
  display: grid;
  gap: 12px;
}

.practice-record-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 112px;
  gap: 18px;
  align-items: center;
  min-height: 108px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: rgba(255, 255, 255, 0.88);
}

.practice-record-card.practiced {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.practice-record-card.unfinished {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.practice-record-card.history-clickable {
  border: 1px solid var(--line);
}

.practice-record-card.practiced.history-clickable {
  border-color: var(--line);
}

.practice-record-card.unfinished.history-clickable {
  border-color: var(--line);
}

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

.record-main h3 {
  margin: 10px 0 0;
  color: #1e304d;
  font-size: 16px;
  line-height: 1.65;
}

.record-date-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #2062af;
  background: #eaf3ff;
  font-size: 13px;
  font-weight: 900;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #6d7d98;
  font-size: 12px;
  font-weight: 800;
}

.record-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f2f6fc;
}

.record-status {
  color: #15855d;
  background: #dcf8eb !important;
}

.record-status.unfinished {
  color: #c46900;
  background: #fff1d8 !important;
}

.record-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.record-side .record-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.record-action-text {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.practice-record-card.history-clickable {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.practice-record-card.history-clickable:hover,
.practice-record-card.history-clickable:focus-visible {
  border-color: #bdd0ef;
  background: #fff;
  box-shadow: 0 16px 38px rgba(31, 78, 145, 0.12);
  transform: translateY(-2px);
  outline: none;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}

.panel {
  min-height: 245px;
  padding: 20px;
}

.favorite-panel-card,
.distribution-panel {
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.favorite-panel-card:hover,
.distribution-panel:hover {
  transform: translateY(-3px) scale(1.006);
  border-color: #b9cdf2;
  box-shadow: 0 18px 42px rgba(31, 78, 145, 0.14);
}

.favorite-expression-card {
  border-color: #d7c7ff;
  background: linear-gradient(180deg, #ffffff 0%, #fdfbff 100%);
}

.favorite-improvement-card {
  border-color: #ffd8ad;
  background: linear-gradient(180deg, #ffffff 0%, #fffbf5 100%);
}

.panel.wide {
  grid-column: span 1;
}

.panel h2,
.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

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

.select-like {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: #65748e;
  background: #fff;
}

.line-chart {
  width: 100%;
  margin-top: 14px;
}

.line-chart polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
}

.line-chart circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
}

.favorite-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: 310px;
  overflow: auto;
}

.favorite-list.compact {
  max-height: 230px;
}

.favorite-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 48px 12px 12px;
  border: 1px solid #e5edf8;
  border-radius: 10px;
  background: #fbfdff;
}

.favorite-row > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #7b4dff;
  background: #f1ebff;
}

.favorite-improvement-card .favorite-row > span,
.improvement-modal .favorite-detail-row > span {
  color: #f07a12;
  background: #fff2df;
}

.favorite-expression-card .favorite-row > span,
.expression-modal .favorite-detail-row > span {
  color: #7b4dff;
  background: #f1ebff;
}

.favorite-row svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.favorite-row strong,
.favorite-row small,
.favorite-row em {
  display: block;
}

.favorite-row-content {
  min-width: 0;
}

.favorite-remove-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #e2e8f3;
  border-radius: 999px;
  color: #8a98ae;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(31, 78, 145, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.favorite-remove-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.favorite-remove-btn:hover,
.favorite-remove-btn:focus-visible {
  border-color: #ffb8c8;
  color: #eb4b74;
  background: #fff3f6;
  box-shadow: 0 10px 22px rgba(235, 75, 116, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.favorite-core-text {
  color: #20324f;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.48;
}

.favorite-core-text.compact {
  font-size: 15.5px;
}

.favorite-improvement-card .favorite-core-text,
.favorite-detail-row.improvement .favorite-core-text {
  font-weight: 400;
}

.favorite-improvement-card .inline-expression-text,
.favorite-detail-row.improvement .inline-expression-text {
  font-weight: 900;
}

.favorite-row strong {
  color: #20324f;
  line-height: 1.45;
}

.favorite-row small {
  margin-top: 3px;
  color: #657590;
  font-size: 14px;
  line-height: 1.45;
}

.favorite-row em {
  margin-top: 6px;
  color: #8794aa;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.favorite-context-details {
  margin-top: 8px;
  color: #8290a6;
}

.favorite-context-details summary {
  width: fit-content;
  color: #6f7e96;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.favorite-context-details div {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e3ebf7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.favorite-context-details p,
.favorite-context-details em {
  display: block;
  margin: 0;
  color: #7d8ba1;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

.favorite-context-details p + em {
  margin-top: 6px;
}

.favorite-empty {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #cbd8eb;
  border-radius: 12px;
  color: #72809a;
  background: #f8fbff;
  text-align: center;
  line-height: 1.7;
}

.history-note-page {
  display: grid;
  gap: 16px;
}

.history-stats-page {
  display: grid;
  gap: 20px;
}

.notebook-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.notebook-heading h2,
.notebook-heading p {
  margin: 0;
}

.notebook-heading h2 {
  color: #172641;
  font-size: 24px;
}

.notebook-heading p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.notebook-heading > span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf4ff;
  font-weight: 900;
}

.notebook-tools {
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid rgba(218, 229, 244, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.notebook-list {
  display: grid;
  gap: 12px;
}

.notebook-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 34%) 104px;
  gap: 18px;
  align-items: start;
  padding: 18px 18px 18px 20px;
  overflow: visible;
  border: 1px solid #e0e4ea;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.06);
}

.notebook-row.expression {
  border-color: color-mix(in srgb, var(--violet) 14%, #e0e4ea);
}

.notebook-row.improvement {
  border-color: color-mix(in srgb, var(--amber) 18%, #e0e4ea);
}

.notebook-row.pinned {
  border-color: color-mix(in srgb, var(--amber) 26%, #dce2eb);
  box-shadow: 0 14px 34px rgba(245, 139, 32, 0.1);
}

.notebook-term-line {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.notebook-row .favorite-core-text {
  margin: 0;
  color: #172641;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.55;
}

.notebook-row.improvement .favorite-core-text {
  font-weight: 400;
}

.notebook-row.improvement .inline-expression-text {
  font-weight: 900;
  text-decoration: none;
}

.notebook-term-input,
.notebook-meaning-input {
  min-width: 0;
  border: 1px solid #dde5ef;
  border-radius: 10px;
  color: #172641;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  outline: none;
}

.notebook-term-input {
  flex: 1 1 320px;
  min-height: 32px;
  padding: 7px 10px;
  resize: none;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
}

.notebook-meaning-input {
  flex: 1 1 180px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 14px;
}

.notebook-term-input:focus,
.notebook-meaning-input:focus {
  border-color: #b9c9e6;
  box-shadow: 0 0 0 3px rgba(25, 103, 255, 0.08);
}

.notebook-meaning-inline {
  padding-top: 3px;
  color: #657590;
  font-size: 14px;
  line-height: 1.55;
}

.notebook-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.notebook-source > span {
  color: #8a97ad;
  font-size: 12px;
  font-weight: 900;
}

.notebook-source em {
  color: #98a5b8;
  font-size: 12px;
  font-style: normal;
}

.notebook-note-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #e1e4ea;
  border-radius: 12px;
  background: #f4f5f6;
}

.notebook-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notebook-note-head span {
  color: #9aa3b2;
  font-size: 11px;
  font-weight: 900;
}

.notebook-note-head button {
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid #d9dde5;
  border-radius: 999px;
  color: #687386;
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.notebook-note-preview,
.notebook-note-input {
  width: 100%;
  min-height: 22px;
  margin: 0;
  color: #2b3a52;
  font-size: 14px;
  line-height: 1.5;
}

.notebook-note-preview {
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.notebook-note-input {
  resize: none;
  border: 0;
  background: transparent;
  font: inherit;
  outline: none;
}

.notebook-row.editing .notebook-note-panel {
  border-color: #d6dde8;
  background: #f2f4f7;
}

.notebook-note-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 32;
  width: min(420px, calc(100vw - 72px));
  max-height: 280px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid #dce1e9;
  border-radius: 12px;
  color: #45546b;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(31, 41, 55, 0.14);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.notebook-row.note-open .notebook-note-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notebook-actions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  justify-items: end;
  align-items: start;
  justify-content: end;
  gap: 7px;
}

.notebook-actions time {
  grid-column: 1 / -1;
  justify-self: end;
  color: #8b98ac;
  font-size: 12px;
  font-weight: 800;
}

.notebook-pin,
.notebook-edit,
.notebook-context button {
  display: inline-grid;
  place-items: center;
  border: 1px solid #e2e8f3;
  color: #8a98ae;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(31, 78, 145, 0.06);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.notebook-pin {
  width: 28px;
  height: 28px;
  border-color: #e2e8f3;
  border-radius: 9px;
  color: #8a98ae;
  background: rgba(255, 255, 255, 0.96);
}

.notebook-pin svg,
.notebook-edit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.notebook-pin.active {
  color: #fff;
  border-color: #f28a18;
  background: #f28a18;
}

.notebook-edit {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.notebook-edit.active {
  color: #208763;
  border-color: #bfe7d5;
  background: #effbf5;
}

.notebook-context {
  position: relative;
}

.notebook-context button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.notebook-pin:hover,
.notebook-pin:focus-visible {
  border-color: #ffd7ac;
  color: #f28a18;
  background: #fff8ef;
  outline: none;
  transform: translateY(-1px);
}

.notebook-pin.active:hover,
.notebook-pin.active:focus-visible {
  color: #fff;
  background: #f28a18;
}

.notebook-edit:hover,
.notebook-edit:focus-visible {
  border-color: #bdd0ef;
  color: var(--blue);
  background: #edf4ff;
  outline: none;
  transform: translateY(-1px);
}

.notebook-context button:hover,
.notebook-context button:focus-visible {
  border-color: #d6dbe4;
  color: #596477;
  background: #eef0f3;
  outline: none;
  transform: translateY(-1px);
}

.notebook-context-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(380px, calc(100vw - 72px));
  padding: 12px 14px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  color: #52627a;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(31, 41, 55, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.notebook-context-popover p,
.notebook-context-popover em {
  display: block;
  margin: 0;
  font-size: 12px;
  font-style: normal;
  line-height: 1.65;
}

.notebook-context-popover em {
  margin-top: 8px;
  color: #738197;
}

.notebook-row.context-open .notebook-context-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notebook-row.context-open .notebook-context button {
  border-color: #d6dbe4;
  color: #596477;
  background: #eef0f3;
}

.notebook-remove {
  position: static;
}

.history-stats-page .analytics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

@media (max-width: 1180px) {
  .history-entry-grid {
    --entry-fly-step: clamp(54px, 6.8vw, 86px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-entry-grid:hover,
  .history-entry-grid:focus-within {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .practice-record-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .record-date-pill,
  .record-side {
    justify-self: start;
  }

  .record-side {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .notebook-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .notebook-heading,
  .record-heading {
    grid-template-columns: 1fr;
  }

  .notebook-actions {
    display: grid;
    grid-template-columns: repeat(3, 28px);
    justify-content: flex-start;
  }

  .notebook-actions time {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .notebook-heading,
  .record-heading {
    align-items: flex-start;
  }

  .history-stats-page .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .history-entry-grid {
    --entry-fly-step: clamp(24px, 6vw, 42px);
  }

  .history-entry-grid:hover,
  .history-entry-grid:focus-within {
    grid-template-columns: minmax(220px, 1fr);
    height: auto;
  }
}

.donut {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  margin: 20px auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.48),
    0 18px 42px rgba(31, 78, 145, 0.12);
}

.donut span {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 50%;
  color: #253652;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 78, 145, 0.12);
  text-align: center;
  font-weight: 900;
}

.topic-donut {
  background: conic-gradient(#1967ff 0 26%, #42bf82 26% 48%, #8b5cf6 48% 66%, #79a9ff 66% 81%, #ffac3d 81% 94%, #ff6b8a 94% 100%);
}

.type-donut {
  background: conic-gradient(#1967ff 0 36%, #42bf82 36% 62%, #79a9ff 62% 82%, #ffac3d 82% 100%);
}

.legend,
.phrase-list,
.summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#topic-distribution {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 10px;
  align-content: start;
}

#topic-distribution li {
  min-width: 0;
}

#topic-distribution li > span:first-child {
  min-width: 0;
}

.legend li,
.phrase-list p,
.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: #53627b;
  font-size: 14px;
}

.legend b {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
}

.legend-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.blue-dot {
  background: var(--blue);
}

.green-dot {
  background: var(--green);
}

.soft-dot {
  background: #79a9ff;
}

.orange-dot {
  background: var(--amber);
}

.phrase-list span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #159b6d;
  background: #e9fbf3;
  font-weight: 900;
}

.phrase-list strong {
  flex: 1;
  color: #23344f;
}

.summary-item {
  min-height: 48px;
  border-bottom: 1px solid #eef3fb;
}

.summary-item:last-child {
  border-bottom: 0;
}

@media (min-width: 761px) and (max-width: 1440px), (min-width: 761px) and (max-height: 900px) {
  .favorite-improvement-card {
    display: flex;
    height: min(360px, 42vh);
    min-height: 0;
    flex-direction: column;
  }

  .favorite-improvement-card .favorite-list.compact {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    overflow: auto;
  }

  .recent-summary-panel {
    grid-column: 2 / span 2;
    display: flex;
    height: min(360px, 42vh);
    min-height: 0;
    flex-direction: column;
  }

  .recent-summary-panel .summary-list {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    overflow: auto;
  }

  .recent-summary-panel .summary-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    justify-content: stretch;
  }

  .recent-summary-panel .summary-item > span:nth-of-type(2) {
    min-width: 0;
  }
}

.history-clickable {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef3fb;
  background: transparent;
  text-align: left;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.history-clickable:hover {
  transform: scale(1.015);
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: 0 12px 28px rgba(31, 78, 145, 0.1);
}

.history-clickable > span:nth-of-type(2) {
  flex: 1;
}

.history-clickable small {
  color: var(--muted);
  white-space: nowrap;
}

.history-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(16, 31, 55, 0.24);
  backdrop-filter: blur(5px);
  animation: modalBackdropIn 0.2s ease both;
}

.history-detail-modal {
  width: min(920px, calc(100vw - 42px));
  max-height: calc(100vh - 70px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(29, 65, 120, 0.28);
  animation: modalScaleIn 0.24s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes modalBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.history-detail-modal h2,
.history-detail-modal h3 {
  margin: 0;
}

.modal-kicker {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.history-detail-question,
.history-sentence-detail,
.history-detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.history-detail-question {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
}

.history-detail-question p {
  margin: 0;
  color: #243654;
  line-height: 1.7;
}

.history-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 14px;
  margin-bottom: 18px;
}

.history-detail-grid > div {
  padding: 16px;
}

.history-detail-grid pre {
  min-height: 130px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: 8px;
  color: #33435e;
  background: #f3f7ff;
  font-family: inherit;
  line-height: 1.75;
  white-space: pre-wrap;
}

.history-detail-grid dl {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.history-detail-grid dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #52627d;
}

.history-detail-grid dd {
  margin: 0;
  color: #172641;
  font-weight: 900;
}

.history-sentence-detail-list {
  display: grid;
  gap: 10px;
}

.history-sentence-detail {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.history-sentence-detail > b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}

.history-sentence-detail p {
  margin: 0 0 8px;
  color: #1f2f4b;
  font-weight: 800;
  line-height: 1.6;
}

.history-sentence-detail small,
.history-sentence-detail em {
  display: block;
  margin-top: 5px;
  color: #657590;
  font-style: normal;
  line-height: 1.6;
}

.favorite-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  margin-bottom: 16px;
}

.favorite-tools input,
.favorite-tools select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: #243654;
  background: #fff;
}

.favorite-detail-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.favorite-detail-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 52px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.favorite-detail-row.expression {
  border-color: #d7c7ff;
  background: #fdfbff;
}

.favorite-detail-row.improvement {
  border-color: #ffd8ad;
  background: #fffdf9;
}

.favorite-detail-row > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
}

.favorite-detail-row svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.favorite-detail-row strong {
  display: block;
  color: #20324f;
  line-height: 1.5;
}

.favorite-detail-row .favorite-core-text {
  font-size: 19px;
}

.favorite-detail-row small,
.favorite-detail-row p,
.favorite-detail-row em {
  display: block;
  margin: 5px 0 0;
  color: #657590;
  font-style: normal;
  line-height: 1.55;
}

.favorite-detail-row small {
  font-size: 14px;
}

.favorite-detail-row .favorite-context-details p,
.favorite-detail-row .favorite-context-details em {
  margin: 0;
  color: #8190a8;
  font-size: 12.5px;
}

.metric-detail-hero {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.metric-detail-hero strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 44px;
}

.metric-detail-hero p {
  margin: 0;
  color: var(--muted);
}

.metric-detail-chart svg {
  width: 100%;
  height: 190px;
}

.metric-detail-chart .spark-line {
  stroke-width: 5;
}

.distribution-detail-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.animated-donut {
  display: grid;
  place-items: center;
}

.animated-donut svg {
  width: 230px;
  height: 230px;
}

.donut-track {
  fill: none;
  stroke: #eef4fb;
  stroke-width: 24;
}

.donut-segment {
  fill: none;
  stroke-width: 24;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 90px 90px;
  opacity: 0;
  animation: donutSegmentIn 0.6s ease forwards;
  animation-delay: var(--delay);
}

.animated-donut text:first-of-type {
  fill: #172641;
  font-size: 30px;
  font-weight: 900;
}

.animated-donut text:last-of-type {
  fill: #7a89a2;
  font-size: 13px;
  font-weight: 800;
}

.distribution-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.distribution-detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #e4edf8;
  border-radius: 10px;
  color: #465672;
  background: #fbfdff;
}

.distribution-detail-list span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.distribution-detail-list b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

@keyframes donutSegmentIn {
  from {
    opacity: 0;
    stroke-dashoffset: 0;
    transform: rotate(-90deg) scale(0.92);
  }
  to {
    opacity: 1;
    transform: rotate(-90deg) scale(1);
  }
}

.score {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf4ff;
  font-weight: 900;
}

.empty-state,
.loading-state {
  padding: 32px;
  border: 1px dashed #cfdaf0;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.loading-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  width: 100%;
  box-sizing: border-box;
  gap: 24px;
  align-items: center;
  margin: 22px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.loading-card > div:last-child {
  min-width: 0;
}

.loading-visual {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(25, 103, 255, 0.12), rgba(54, 197, 138, 0.16));
}

.loading-visual span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  animation: orbitPulse 1.6s ease-in-out infinite;
}

.loading-visual span:nth-child(2) {
  background: var(--green);
  animation-delay: 0.18s;
  transform: translate(22px, 12px);
}

.loading-visual span:nth-child(3) {
  background: var(--violet);
  animation-delay: 0.36s;
  transform: translate(-18px, 18px);
}

.loading-eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.loading-card h3 {
  margin: 0 0 14px;
  font-size: 24px;
}

.loading-dots i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: dotPulse 1.2s infinite;
}

.loading-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

.mini-drill {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #dbe7fb;
  border-radius: 10px;
  background: #f5f9ff;
}

.mini-drill strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #243654;
  font-size: 13px;
}

.mini-drill strong span {
  display: inline-grid;
  min-width: 42px;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: #e7f0ff;
  font-weight: 900;
}

.mini-drill p {
  margin: 0;
  color: #172641;
  font-weight: 800;
  line-height: 1.55;
}

.mini-drill .drill-answer-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}

.drill-prompt {
  max-width: 72ch;
}

.drill-token {
  border-bottom: 2px solid currentColor;
  font-weight: 900;
  line-height: 1.45;
}

.drill-token.positive,
.drill-answer-item.positive b,
.drill-color-legend i.green,
.drill-tone-dot.green {
  color: #188f63;
}

.drill-token.negative,
.drill-answer-item.negative b,
.drill-color-legend i.red,
.drill-tone-dot.red {
  color: #d64b45;
}

.drill-token.neutral,
.drill-answer-item.neutral b,
.drill-color-legend i.yellow,
.drill-tone-dot.yellow {
  color: #b78300;
}

.drill-core-noun {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  width: fit-content;
  padding: 8px 10px;
  border: 1px solid #d8e5fb;
  border-radius: 8px;
  background: #f7fbff;
}

.drill-core-noun span {
  color: #667997;
  font-size: 12px;
  font-weight: 900;
}

.drill-core-noun b {
  color: #1d3356;
  font-size: 17px;
  line-height: 1.35;
}

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

.drill-answer-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.drill-tone-dot {
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
}

.drill-answer-item div {
  min-width: 0;
}

.drill-answer-item b {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.drill-answer-item em {
  display: block;
  margin-top: 1px;
  color: #697992;
  font-size: 12.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.drill-color-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 2px;
  color: #60708b;
  font-size: 12px;
  font-weight: 800;
}

.drill-color-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.drill-color-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

.mini-drill small {
  color: #6d7d99;
}

.mini-drill.answer {
  border-color: #e5edf8;
  background: #fffdfa;
}

.mini-drill.answer strong span {
  color: #7a5a00;
  background: #fff2bd;
}

.mini-drill.done {
  border-style: dashed;
  background: #fbfdff;
}

@keyframes orbitPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-12px, -10px) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(14px, 8px) scale(1.05);
  }
}

@keyframes feedbackOrbit {
  0%,
  100% {
    opacity: 0.56;
    transform: translate(-18px, -12px) scale(0.78);
  }
  35% {
    opacity: 1;
    transform: translate(18px, -8px) scale(1.05);
  }
  70% {
    opacity: 0.85;
    transform: translate(4px, 18px) scale(0.92);
  }
}

@keyframes feedbackGradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes dotPulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 760px) {
  .loading-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .loading-visual {
    width: 64px;
    height: 64px;
  }

  .feedback-progress-banner div:first-child,
  .feedback-pending-card {
    grid-template-columns: 1fr;
  }

  .feedback-progress-banner div:first-child {
    display: grid;
  }

  .boot-loading {
    min-height: calc(100vh - 122px);
    padding: 22vh 18px 0;
  }

  .boot-quiz {
    padding: 16px;
  }

  .boot-quiz-question {
    font-size: 14.5px;
  }

  .feedback-pending-visual {
    width: 62px;
    height: 62px;
  }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 18px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    height: 42px;
    justify-content: space-around;
    gap: 8px;
  }

  .trial-user {
    gap: 8px;
  }

  .motion-toggle {
    width: 32px;
    height: 32px;
  }

  .motion-toggle::after {
    right: -74px;
  }

  .streak,
  .user-name {
    display: none;
  }

  main {
    min-height: calc(100vh - 122px);
  }

  .hero-stage {
    top: 122px;
    height: calc(100vh - 122px);
    place-items: center;
    padding: 28px 18px 44px;
  }

  .home-intro {
    padding-top: calc(100vh - 122px);
  }

  .home-page {
    --hero-base-y: 0px;
    --recommend-y: 160px;
  }

  .hero-copy {
    width: min(360px, 92vw);
  }

  .hero-mascot-duck {
    margin: 2px auto 8px;
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .hero-copy h1 {
    font-size: 40px;
    line-height: 1.12;
  }

  .hero-copy p:not(.eyebrow) {
    margin: 14px auto 24px;
    font-size: 15px;
    line-height: 1.75;
  }

  .hero-cta {
    min-width: 216px;
    height: 56px;
  }

  .hero-search {
    margin-top: 22px;
  }

  .recommendation-band {
    min-height: 50vh;
    margin-top: -34vh;
    padding: 46px 0 18px;
  }

  .recommendation-inner {
    width: min(560px, calc(100vw - 32px));
  }

  .recommendation-marquee {
    margin-right: -16px;
    margin-left: -16px;
    padding-bottom: 18px;
  }

  .recommendation-track {
    gap: 14px;
    padding: 0 16px;
    animation-duration: 46s;
  }

  .recommendation-track .topic-card {
    width: 320px;
    min-height: 236px;
    flex-basis: 320px;
    padding: 20px;
  }

  .recommendation-track .topic-card p {
    font-size: 14px;
    line-height: 1.72;
  }

  .topic-bubble {
    min-width: auto;
    padding: 8px 11px;
    font-size: 14px;
  }

  .topic-icon,
  .topic-bubble i {
    width: 30px;
    height: 30px;
  }

  .floating-topics .topic-bubble:nth-child(1) {
    left: 6% !important;
    top: 23% !important;
  }

  .floating-topics .topic-bubble:nth-child(2) {
    left: 13% !important;
    top: 55% !important;
  }

  .floating-topics .topic-bubble:nth-child(3) {
    left: 20% !important;
    top: 72% !important;
  }

  .floating-topics .topic-bubble:nth-child(4) {
    left: 38% !important;
    top: 82% !important;
  }

  .floating-topics .topic-bubble:nth-child(5) {
    left: 70% !important;
    top: 26% !important;
  }

  .floating-topics .topic-bubble:nth-child(6) {
    left: 78% !important;
    top: 42% !important;
  }

  .floating-topics .topic-bubble:nth-child(7) {
    left: 76% !important;
    top: 55% !important;
  }

  .floating-topics .topic-bubble:nth-child(8) {
    left: 68% !important;
    top: 70% !important;
  }

  .floating-topics .topic-bubble:nth-child(9) {
    left: 58% !important;
    top: 80% !important;
  }

  .orbit-line {
    width: 720px;
    height: 340px;
  }

  .orbit-two {
    width: 600px;
    height: 300px;
  }

  .card-grid.three,
  .metric-grid,
  .history-metrics,
  .analytics-grid,
  .paper-report-body,
  .feedback-columns,
  .outline-grid,
  .translation-stage,
  .feedback-stage,
  .training-grid,
  .topic-browser,
  .workspace {
    grid-template-columns: 1fr;
  }

  #topic-distribution {
    grid-template-columns: 1fr;
  }

  .translation-actions {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar {
    display: none;
  }

  .bank-main,
  .history-main,
  .training-page {
    padding: 24px 18px;
  }

  .thought-reference-modal {
    width: min(100%, calc(100vw - 28px));
    padding: 20px;
  }

  .thought-mode-grid,
  .thought-loading {
    grid-template-columns: 1fr;
  }

  .thought-mode-grid {
    display: grid;
  }

  .thought-loading {
    display: grid;
  }

  .thought-modal-actions {
    flex-direction: column;
  }

  .topic-row {
    grid-template-columns: 78px 1fr;
    min-height: 92px;
  }

  .recent-row {
    grid-template-columns: 78px minmax(0, 1fr) 56px;
    min-height: 86px;
    padding: 12px 14px;
  }

  .recent-question {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .recent-time {
    display: none;
  }

  .continue-card,
  .paper-exam-row,
  .record-heading,
  .practice-record-card,
  .history-detail-grid,
  .distribution-detail-body,
  .metric-detail-hero {
    grid-template-columns: 1fr;
  }

  .record-heading {
    align-items: flex-start;
  }

  .record-tools,
  .favorite-tools {
    grid-template-columns: 1fr;
  }

  .continue-meta {
    justify-items: start;
  }

  .paper-report summary,
  .paper-exam-list {
    padding-right: 16px;
    padding-left: 16px;
  }

  .paper-report-body {
    gap: 18px;
    padding: 0 16px 20px;
  }

  .paper-exam-row {
    gap: 12px;
  }

  .paper-exam-window {
    max-height: 620px;
  }

  .paper-exam-actions {
    justify-content: flex-start;
  }

  .paper-bar-row {
    grid-template-columns: 66px minmax(0, 1fr) 24px;
  }

  .topic-row > :nth-child(n + 3) {
    display: none;
  }

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

  .topic-detail {
    position: static;
  }

  .timer-card {
    position: sticky;
    top: 12px;
    right: auto;
    width: 100%;
    margin-bottom: 18px;
  }

  .timer-card.is-collapsed {
    width: auto;
  }
}
