:root {
  --ink: #1d2f2e;
  --ink-soft: #5f6e69;
  --paper: #f7f5ef;
  --surface: #fffefa;
  --surface-2: #eeece4;
  --line: #dcd9cf;
  --line-strong: #c9c5b9;
  --teal: #1d3b3a;
  --teal-soft: #dce9e4;
  --teal-mid: #4e8177;
  --coral: #ee7657;
  --coral-soft: #f9e1d8;
  --yellow: #e9b949;
  --yellow-soft: #f8ecc8;
  --green: #2f7769;
  --green-soft: #dcefe8;
  --red: #b34a3e;
  --red-soft: #f7dfdb;
  --shadow: 0 18px 45px rgba(36, 51, 45, .08);
  --shadow-small: 0 6px 18px rgba(36, 51, 45, .07);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 8px;
  --sidebar: 248px;
}

[data-theme="dark"] {
  --ink: #ecf0e9;
  --ink-soft: #a9b6af;
  --paper: #111918;
  --surface: #182321;
  --surface-2: #202d2a;
  --line: #31413d;
  --line-strong: #42534e;
  --teal: #d9eee7;
  --teal-soft: #213a35;
  --teal-mid: #8dc1b5;
  --coral: #f08a6d;
  --coral-soft: #442a24;
  --yellow: #f1c764;
  --yellow-soft: #3d3521;
  --green: #8fd1bd;
  --green-soft: #203b34;
  --red: #f29989;
  --red-soft: #422a28;
  --shadow: 0 18px 45px rgba(0, 0, 0, .2);
  --shadow-small: 0 6px 18px rgba(0, 0, 0, .18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
label,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--yellow-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--coral) 60%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  top: 16px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon--small {
  width: 16px;
  height: 16px;
}

.icon--large {
  width: 24px;
  height: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  color: currentColor;
  place-items: center;
}

[data-theme="dark"] .brand {
  color: var(--ink);
}

.brand--light {
  color: #f7f5ef;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

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

.button:active {
  transform: translateY(0);
}

.button--primary {
  background: var(--teal);
  color: var(--paper);
}

[data-theme="dark"] .button--primary {
  background: #d9eee7;
  color: #14201e;
}

.button--primary:hover {
  background: #2c5653;
}

[data-theme="dark"] .button--primary:hover {
  background: #c7e4db;
}

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

.button--ghost:hover {
  background: var(--surface-2);
}

.button--soft {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: transparent;
}

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

.button--wide {
  width: 100%;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal-mid);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  place-items: center;
  transition: background .18s ease, transform .18s ease;
}

.icon-button:hover {
  background: var(--surface-2);
  transform: rotate(3deg);
}

/* Onboarding */
.onboarding {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, .92fr) minmax(500px, 1.08fr);
  background: var(--paper);
}

.onboarding-brand {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  padding: 48px clamp(34px, 5vw, 74px);
  background: #1d3b3a;
  color: #f7f5ef;
}

.onboarding-brand::after {
  position: absolute;
  right: -90px;
  bottom: -150px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(247, 245, 239, .12);
  border-radius: 50%;
  content: "";
}

.onboarding-art {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.onboarding-art svg {
  width: min(100%, 590px);
  height: auto;
  max-height: 58vh;
}

.onboarding-quote {
  position: relative;
  z-index: 1;
  max-width: 430px;
}

.onboarding-quote p {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1.25;
}

.onboarding-quote span {
  color: #b8cbc6;
  font-size: 13px;
}

.onboarding-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(28px, 7vw, 100px);
}

.mobile-brand {
  display: none;
}

.setup-form {
  width: 100%;
  max-width: 670px;
}

.setup-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.setup-topline h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3.3vw, 51px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.step-count {
  padding-top: 24px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.setup-intro {
  max-width: 550px;
  margin: 18px 0 26px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

.step-dots {
  display: flex;
  gap: 7px;
  margin-bottom: 34px;
}

.step-dots span {
  width: 32px;
  height: 4px;
  border-radius: 20px;
  background: var(--line);
  transition: background .2s ease, width .2s ease;
}

.step-dots span.active {
  width: 54px;
  background: var(--coral);
}

.setup-step {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.setup-step.active {
  display: block;
  animation: fade-up .32s ease both;
}

.setup-step legend {
  margin-bottom: 8px;
  padding: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}

.field-help {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-card {
  position: relative;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  padding: 13px 44px 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.choice-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.choice-card:has(input:checked) {
  border-color: var(--teal-mid);
  background: var(--teal-soft);
}

.choice-card input,
.goal-choice input,
.time-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  place-items: center;
}

.choice-icon--coral {
  background: var(--coral-soft);
  color: var(--coral);
}

.choice-icon--teal {
  background: var(--teal-soft);
  color: var(--teal-mid);
}

.choice-icon--yellow {
  background: var(--yellow-soft);
  color: #9b7018;
}

.choice-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.choice-copy strong {
  font-size: 14px;
}

.choice-copy small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.choice-check {
  position: absolute;
  right: 17px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.choice-card:has(input:checked) .choice-check {
  border: 5px solid var(--teal-mid);
}

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

.goal-choice {
  display: grid;
  min-height: 104px;
  grid-template-columns: 38px 1fr;
  align-content: center;
  gap: 2px 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.goal-choice:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.goal-choice:has(input:checked) {
  border-color: var(--teal-mid);
  background: var(--teal-soft);
}

.goal-choice > [data-icon] {
  display: grid;
  width: 38px;
  height: 38px;
  grid-row: span 2;
  border-radius: 50%;
  background: var(--surface);
  color: var(--teal-mid);
  place-items: center;
}

[data-theme="dark"] .goal-choice > [data-icon] {
  background: rgba(255, 255, 255, .06);
}

.goal-choice strong {
  align-self: end;
  font-size: 14px;
}

.goal-choice small {
  align-self: start;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}

.goal-choice:last-child {
  grid-column: span 2;
}

.time-choices {
  display: grid;
  gap: 10px;
}

.time-choice {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.time-choice:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.time-choice:has(input:checked) {
  border-color: var(--teal-mid);
  background: var(--teal-soft);
}

.time-number {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--coral);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  place-items: center;
}

.time-choice span:last-child {
  display: flex;
  flex-direction: column;
}

.time-choice small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 12px;
}

.setup-actions {
  display: flex;
  gap: 10px;
  margin-top: 27px;
}

.setup-actions .button--wide {
  flex: 1;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 28px 20px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-top {
  padding: 0 8px;
}

.sidebar .brand {
  align-items: flex-start;
  font-size: 20px;
  line-height: 1.08;
}

.sidebar .brand-mark {
  margin-top: 3px;
}

.sidebar .brand > span:last-child {
  max-width: 158px;
}

.sidebar-tagline {
  margin: 6px 0 0 40px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 42px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: color .18s ease, background .18s ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.nav-badge {
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  place-items: center;
}

.sidebar-spacer {
  flex: 1;
}

.daily-rhythm {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.rhythm-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.daily-rhythm > strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
}

.mini-week {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 34px;
  margin: 13px 0 11px;
}

.mini-day {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.mini-day span {
  width: 14px;
  height: 5px;
  border-radius: 5px;
  background: var(--line);
}

.mini-day.done span {
  background: var(--teal-mid);
}

.mini-day.today span {
  height: 9px;
  background: var(--coral);
}

.profile-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.profile-button:hover {
  background: var(--surface-2);
}

.profile-button > [data-icon] {
  margin-left: auto;
  color: var(--ink-soft);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  place-items: center;
}

.profile-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.profile-copy strong {
  font-size: 12px;
}

.profile-copy small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(24px, 4.3vw, 68px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.topbar-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--coral);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

main {
  width: 100%;
  max-width: 1500px;
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 54px) clamp(24px, 4.3vw, 68px) 70px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in .32s ease both;
}

.mobile-nav {
  display: none;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.page-heading h1,
.section-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(31px, 3.2vw, 44px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.page-heading p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.header-mark {
  display: flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--coral);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.section-heading--compact {
  margin-bottom: 13px;
}

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

/* Today dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .82fr);
  gap: 18px;
}

.dashboard-main {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 18px;
}

.dashboard-side {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 18px;
}

.study-hero {
  position: relative;
  display: grid;
  min-height: 276px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) 260px;
  border: 1px solid #cbdad4;
  border-radius: var(--radius);
  background: #edf2ed;
  color: #16302e;
}

[data-theme="dark"] .study-hero {
  border-color: var(--line);
  background: #1b2d29;
  color: var(--ink);
}

.study-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(25px, 3vw, 40px);
}

.study-hero .eyebrow {
  color: #b7553d;
}

[data-theme="dark"] .study-hero .eyebrow {
  color: var(--coral);
}

.study-hero h2 {
  max-width: 520px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 3vw, 42px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.06;
}

.study-hero p {
  max-width: 480px;
  margin: 13px 0 20px;
  color: #536d68;
  font-size: 13px;
  line-height: 1.55;
}

[data-theme="dark"] .study-hero p {
  color: var(--ink-soft);
}

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

.hero-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #536d68;
  font-size: 11px;
  font-weight: 700;
}

[data-theme="dark"] .hero-meta {
  color: var(--ink-soft);
}

.hero-art {
  position: relative;
  min-height: 100%;
}

.hero-art::before {
  position: absolute;
  top: -62px;
  right: -22px;
  width: 285px;
  height: 285px;
  border: 1px solid rgba(29, 59, 58, .12);
  border-radius: 50%;
  content: "";
}

.hero-path {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.path-stack {
  position: relative;
  display: flex;
  width: 170px;
  height: 210px;
  flex-direction: column;
  justify-content: center;
}

.path-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 4px 0;
  padding: 10px 12px;
  border: 1px solid rgba(29, 59, 58, .13);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, .82);
  box-shadow: 0 7px 20px rgba(29, 59, 58, .08);
  color: #1d3b3a;
  transform: translateX(var(--offset, 0));
}

[data-theme="dark"] .path-step {
  border-color: var(--line);
  background: rgba(24, 35, 33, .92);
  color: var(--ink);
}

.path-step:nth-child(2) {
  --offset: 24px;
}

.path-step:nth-child(3) {
  --offset: 47px;
}

.path-step.done {
  border-color: #80aa9d;
}

.path-step-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-mid);
  place-items: center;
}

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

.path-step-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.path-step-copy strong {
  font-size: 10px;
  line-height: 1.2;
}

.path-step-copy small {
  color: var(--ink-soft);
  font-size: 8px;
}

.hero-sun {
  position: absolute;
  top: 30px;
  right: 25px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1c867;
}

.hero-line {
  position: absolute;
  right: 28px;
  bottom: 23px;
  width: 88px;
  height: 70px;
  border-right: 1px solid rgba(29, 59, 58, .2);
  border-bottom: 1px solid rgba(29, 59, 58, .2);
  border-radius: 0 0 45px 0;
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 18px;
}

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

.panel-pad {
  padding: 22px;
}

.task-list {
  display: grid;
}

.task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  transition: background .18s ease;
}

.task-row:hover {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.task-check {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  cursor: pointer;
  place-items: center;
}

.task-check:hover {
  border-color: var(--teal-mid);
}

.task-check.done {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.task-copy {
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-copy p {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row.completed .task-copy strong {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.task-action {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.task-action:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.task-time {
  padding: 3px 7px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 15px;
}

.plan-head-copy {
  display: flex;
  align-items: center;
  gap: 13px;
}

.plan-dial {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--coral) var(--progress, 0%), var(--surface-2) 0);
  place-items: center;
}

.plan-dial::before {
  position: absolute;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.plan-dial span {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 800;
}

.plan-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.plan-head p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.plan-progress-copy {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.daily-words-panel {
  padding: 20px;
}

.word-peek-list {
  display: grid;
  gap: 3px;
}

.word-peek {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 3px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.word-peek:first-child {
  border-top: 0;
}

.word-peek:hover .word-peek-arrow {
  color: var(--coral);
  transform: translateX(2px);
}

.word-peek-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.word-peek strong {
  font-family: var(--serif);
  font-size: 16px;
}

.word-peek small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speak-chip {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--teal-mid);
  cursor: pointer;
  place-items: center;
}

.word-peek-arrow {
  color: var(--line-strong);
  transition: color .18s ease, transform .18s ease;
}

.panel-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--teal-mid);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-cell {
  padding: 17px;
  border-left: 1px solid var(--line);
}

.stat-cell:first-child {
  border-left: 0;
}

.stat-cell span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stat-cell strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.stat-cell small {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
}

.week-panel {
  padding: 20px;
}

.week-chart {
  display: flex;
  height: 120px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 7px;
  padding-top: 18px;
}

.week-column {
  display: flex;
  height: 100%;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  gap: 7px;
}

.week-bar-track {
  display: flex;
  width: 100%;
  max-width: 26px;
  height: 78px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-2);
}

.week-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 4px;
  background: var(--teal-mid);
}

.week-column.today .week-bar {
  background: var(--coral);
}

.week-column > span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.quote-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--yellow-soft);
}

.quote-panel::after {
  position: absolute;
  right: -20px;
  bottom: -35px;
  color: rgba(152, 108, 25, .13);
  content: "“";
  font-family: var(--serif);
  font-size: 145px;
  line-height: 1;
}

.quote-panel .eyebrow {
  color: #8e661d;
}

[data-theme="dark"] .quote-panel .eyebrow {
  color: var(--yellow);
}

.quote-panel p {
  position: relative;
  z-index: 1;
  margin: 0 0 11px;
  color: #453719;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
}

[data-theme="dark"] .quote-panel p {
  color: var(--ink);
}

.quote-panel span {
  color: #775f2f;
  font-size: 10px;
}

[data-theme="dark"] .quote-panel span {
  color: var(--ink-soft);
}

/* Vocabulary */
.vocab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  min-width: 240px;
  flex: 1;
}

.search-box > [data-icon] {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--ink-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 44px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

.search-box input:focus {
  border-color: var(--teal-mid);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  height: 44px;
  min-width: 145px;
  appearance: none;
  padding: 10px 36px 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  content: "";
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.filter-chip {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.filter-chip:hover {
  border-color: var(--line-strong);
}

.filter-chip.active {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--paper);
}

[data-theme="dark"] .filter-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

.word-card {
  position: relative;
  display: flex;
  min-height: 181px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.word-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-small);
  transform: translateY(-2px);
}

.word-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.word-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.word-pronunciation {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.tag {
  padding: 3px 7px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tag--level {
  background: var(--teal-soft);
  color: var(--teal-mid);
}

.tag--learned {
  background: var(--green-soft);
  color: var(--green);
}

.word-definition {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.word-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.word-card-foot span {
  color: var(--coral);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.learned-dot {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green) !important;
}

.no-results {
  grid-column: 1 / -1;
  padding: 55px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-align: center;
}

.vocab-count {
  color: var(--ink-soft);
  font-size: 11px;
}

/* Practice */
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: 30px;
}

.lesson-content {
  min-width: 0;
}

.lesson-intro {
  margin-bottom: 26px;
  padding-bottom: 27px;
  border-bottom: 1px solid var(--line);
}

.lesson-intro h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(35px, 4vw, 55px);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.lesson-intro > p {
  max-width: 690px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.lesson-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.lesson-section {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 105px;
}

.lesson-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.lesson-section-heading span:last-child {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
}

.lesson-section h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.lesson-section h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.feature-word {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--teal-soft);
}

.feature-word-word {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-word h2 {
  margin: 0;
  font-size: 34px;
}

.feature-word .word-pronunciation {
  margin-top: 2px;
}

.feature-word p {
  max-width: 600px;
  margin: 12px 0 0;
  font-size: 14px;
}

.example-box {
  margin-top: 15px;
  padding: 17px;
  border-left: 3px solid var(--coral);
  background: var(--paper);
}

.example-box p {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
}

.example-box mark {
  padding: 0 2px;
  background: var(--yellow-soft);
  color: inherit;
}

.example-explainer {
  display: flex;
  gap: 8px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 12px;
}

.expression-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--yellow-soft);
}

.expression-card .expression {
  margin: 0;
  color: #403317;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 33px);
  line-height: 1.25;
}

[data-theme="dark"] .expression-card .expression {
  color: var(--ink);
}

.expression-card > p {
  margin: 12px 0;
  color: #6a582e;
  font-size: 13px;
}

[data-theme="dark"] .expression-card > p {
  color: var(--ink-soft);
}

.expression-example {
  padding-top: 12px;
  border-top: 1px solid rgba(91, 70, 24, .16);
  color: #514019 !important;
  font-style: italic;
}

[data-theme="dark"] .expression-example {
  border-color: var(--line);
  color: var(--ink-soft) !important;
}

.grammar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
}

.grammar-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.grammar-note span {
  color: var(--coral);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.grammar-note p {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 15px;
}

.reading-text {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
}

.reading-text strong {
  padding: 0 2px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
}

[data-theme="dark"] .reading-text strong {
  color: var(--teal-mid);
}

.pronunciation-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.audio-button {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--teal);
  color: var(--paper);
  cursor: pointer;
  place-items: center;
}

[data-theme="dark"] .audio-button {
  background: var(--ink);
  color: var(--paper);
}

.audio-button:hover {
  transform: scale(1.04);
}

.pronunciation-copy {
  min-width: 0;
}

.pronunciation-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
}

.pronunciation-copy small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.goal-lab {
  border-color: #d9c99f;
  background: #fbf6e8;
}

[data-theme="dark"] .goal-lab {
  border-color: #473f29;
  background: #29271f;
}

.goal-lab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.goal-lab-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 20px;
  background: var(--yellow);
  color: #33280e;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.goal-prompt {
  margin: 15px 0;
  padding: 16px;
  border-left: 3px solid var(--yellow);
  background: rgba(255, 255, 255, .5);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
}

[data-theme="dark"] .goal-prompt {
  background: rgba(255, 255, 255, .04);
}

.goal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.practice-timer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-display {
  min-width: 64px;
  color: var(--coral);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}

.writing-area {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
}

.writing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.writing-foot span {
  color: var(--ink-soft);
  font-size: 10px;
}

.quiz-shell {
  overflow: hidden;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.quiz-header h2 {
  margin: 0;
}

.quiz-progress {
  display: flex;
  gap: 5px;
}

.quiz-progress span {
  width: 25px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
}

.quiz-progress span.done {
  background: var(--teal-mid);
}

.quiz-progress span.current {
  background: var(--coral);
}

.quiz-body {
  padding: 24px;
}

.quiz-question {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.35;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--teal-mid);
}

.quiz-option span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  place-items: center;
}

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

.quiz-option.correct span {
  border-color: var(--green);
  background: var(--green);
  color: var(--paper);
}

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

.quiz-option.wrong span {
  border-color: var(--red);
  background: var(--red);
  color: var(--paper);
}

.quiz-feedback {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12px;
}

.quiz-feedback.correct {
  background: var(--green-soft);
  color: var(--green);
}

.quiz-feedback.wrong {
  background: var(--red-soft);
  color: var(--red);
}

.quiz-next-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

.quiz-result {
  padding: 35px 24px;
  text-align: center;
}

.result-score {
  display: grid;
  width: 104px;
  height: 104px;
  margin: 0 auto 17px;
  border: 7px solid var(--teal-soft);
  border-radius: 50%;
  color: var(--teal);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  place-items: center;
}

.quiz-result h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 29px;
}

.quiz-result p {
  max-width: 450px;
  margin: 8px auto 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.lesson-aside {
  position: sticky;
  top: 102px;
  align-self: start;
}

.lesson-map {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lesson-map-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lesson-map-title strong {
  font-family: var(--serif);
  font-size: 16px;
}

.lesson-map-title span {
  color: var(--ink-soft);
  font-size: 9px;
}

.lesson-map-list {
  display: grid;
  gap: 2px;
}

.lesson-map-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.lesson-map-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.lesson-map-number {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  place-items: center;
}

.lesson-map-link.active .lesson-map-number {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: var(--coral);
}

.lesson-map-progress {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.lesson-map-progress-row {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.progress-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface-2);
}

.progress-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--coral);
  transition: width .35s ease;
}

.complete-lesson-button {
  margin-top: 13px;
}

/* Progress */
.progress-overview {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  margin-bottom: 18px;
}

.progress-hero {
  position: relative;
  display: grid;
  min-height: 280px;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 20px;
  padding: 30px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #1d3b3a;
  color: #f7f5ef;
}

.progress-hero h2 {
  max-width: 470px;
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.progress-hero p {
  max-width: 400px;
  margin: 0;
  color: #b9cac5;
  font-size: 12px;
}

.progress-hero .eyebrow {
  color: #f0a087;
}

.big-progress-ring {
  position: relative;
  display: grid;
  width: 152px;
  height: 152px;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(#ee7657 var(--progress, 0%), rgba(255, 255, 255, .13) 0);
  place-items: center;
}

.big-progress-ring::before {
  position: absolute;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #1d3b3a;
  content: "";
}

.big-progress-ring div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.big-progress-ring strong {
  display: block;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
}

.big-progress-ring span {
  color: #b9cac5;
  font-size: 9px;
}

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

.progress-stat {
  display: flex;
  min-height: 135px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.progress-stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  place-items: center;
}

.progress-stat:nth-child(2) .progress-stat-icon {
  background: var(--teal-soft);
  color: var(--teal-mid);
}

.progress-stat:nth-child(3) .progress-stat-icon {
  background: var(--yellow-soft);
  color: #9b7018;
}

.progress-stat:nth-child(4) .progress-stat-icon {
  background: var(--green-soft);
  color: var(--green);
}

.progress-stat strong {
  display: block;
  margin-top: 15px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  line-height: 1;
}

.progress-stat span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.progress-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.large-week {
  height: 170px;
}

.large-week .week-bar-track {
  height: 120px;
  max-width: 38px;
}

.milestones {
  display: grid;
}

.milestone {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.milestone:first-child {
  border-top: 0;
}

.milestone-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  place-items: center;
}

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

.milestone-copy {
  flex: 1;
}

.milestone-copy strong {
  display: block;
  font-size: 12px;
}

.milestone-copy small {
  color: var(--ink-soft);
  font-size: 10px;
}

.milestone-state {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.milestone.done .milestone-state {
  color: var(--green);
}

/* Drawer and modal */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(17, 28, 25, .44);
  backdrop-filter: blur(3px);
}

.drawer-backdrop.visible,
.modal-backdrop.visible {
  animation: fade-in .2s ease both;
}

.settings-drawer {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  padding: 28px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(20, 33, 29, .12);
  transform: translateX(105%);
  transition: transform .28s ease;
}

.settings-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 28px;
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.settings-group {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.settings-group > label,
.settings-group > legend {
  display: block;
  margin-bottom: 7px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.settings-group select {
  width: 100%;
  height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 38px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  place-items: center;
}

.segmented input:checked + span {
  background: var(--surface);
  box-shadow: var(--shadow-small);
  color: var(--ink);
}

.settings-summary {
  margin: 24px 0 16px;
  padding: 14px;
  border-left: 3px solid var(--teal-mid);
  background: var(--teal-soft);
  color: var(--ink-soft);
  font-size: 11px;
}

.drawer-divider {
  height: 1px;
  margin: 27px 0 18px;
  background: var(--line);
}

.danger-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.drawer-footnote {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.word-modal {
  width: min(600px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 35px 90px rgba(14, 28, 24, .25);
}

.word-modal[open] {
  animation: modal-in .25s ease both;
}

.word-modal::backdrop {
  background: rgba(17, 28, 25, .48);
  backdrop-filter: blur(3px);
}

.word-modal-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
}

.word-modal-inner {
  padding: 34px;
}

.word-modal-head {
  padding-right: 40px;
}

.word-modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 45px;
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1;
}

.word-modal-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  color: var(--ink-soft);
}

.word-modal-head-row span {
  font-family: var(--mono);
  font-size: 10px;
}

.word-modal-definition {
  margin: 22px 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.45;
}

.modal-example {
  padding: 18px;
  border-left: 3px solid var(--coral);
  background: var(--paper);
}

.modal-example p {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
}

.modal-example small {
  display: block;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 11px;
}

.modal-example--secondary {
  margin-top: 9px;
  border-left-color: var(--teal-mid);
  background: var(--surface-2);
}

.modal-example--secondary small {
  margin: 0 0 6px;
  color: var(--teal-mid);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-example--secondary p {
  font-size: 17px;
}

.modal-usage {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.modal-usage span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.toast {
  position: fixed;
  z-index: 150;
  bottom: 24px;
  left: 50%;
  max-width: calc(100% - 36px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .2s ease, transform .2s ease;
}

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

.empty-state {
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-align: center;
}

/* Responsive */
@media (max-width: 1180px) {
  :root {
    --sidebar: 220px;
  }

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

  .study-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

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

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

  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 215px;
    gap: 20px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar: 205px;
  }

  .sidebar {
    padding: 24px 14px 15px;
  }

  .main-nav {
    margin-top: 32px;
  }

  .dashboard-grid,
  .progress-overview,
  .progress-detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-side > .quote-panel {
    display: none;
  }

  .study-hero {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-aside {
    position: static;
    order: -1;
  }

  .lesson-map-list {
    display: none;
  }

  .lesson-map {
    padding: 14px 16px;
  }

  .lesson-map-title {
    margin: 0;
  }

  .lesson-map-progress {
    margin-top: 10px;
    padding-top: 10px;
  }

  .complete-lesson-button {
    width: auto;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 68px;
  }

  .sidebar {
    display: none;
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-menu-button {
    display: flex;
  }

  .topbar {
    min-height: 66px;
    padding: 11px 18px;
  }

  .topbar-date {
    display: none;
  }

  .topbar::before {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 700;
    content: "Melvin's study plan for you";
  }

  .topbar-actions {
    margin-left: auto;
  }

  .mobile-menu-button {
    display: none;
  }

  main {
    min-height: calc(100vh - 66px);
    padding: 26px 18px 34px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: 68px;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(14px);
  }

  .mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: 8px;
    font-weight: 700;
  }

  .mobile-nav-item .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav-item.active {
    color: var(--coral);
  }

  .page-heading h1 {
    font-size: 34px;
  }

  .page-heading .header-mark {
    display: none;
  }

  .study-hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }

  .study-hero {
    min-height: 0;
  }

  .study-hero-copy {
    padding: 28px;
  }

  .dashboard-side {
    grid-template-columns: 1fr;
  }

  .dashboard-side > .quote-panel {
    display: block;
  }

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

  .goal-choices {
    grid-template-columns: 1fr 1fr;
  }

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

  .onboarding-brand {
    display: none;
  }

  .onboarding-panel {
    flex-direction: column;
    min-height: 100vh;
    align-items: flex-start;
    padding: 30px 22px;
  }

  .mobile-brand {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    max-width: 670px;
    margin: 0 auto 38px;
  }

  .setup-form {
    margin: 0 auto;
  }

  main {
    padding-bottom: 34px;
  }

  .progress-hero {
    grid-template-columns: 1fr;
  }

  .big-progress-ring {
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 108px;
    height: 108px;
    opacity: .9;
  }

  .big-progress-ring::before {
    width: 86px;
    height: 86px;
  }

  .big-progress-ring strong {
    font-size: 23px;
  }

  .progress-stats {
    grid-template-columns: 1fr 1fr;
  }

  .progress-stat {
    min-height: 120px;
  }

  .settings-drawer {
    padding: 24px 20px;
  }
}

@media (max-width: 560px) {
  .topbar-date,
  .topbar-focus {
    display: none;
  }

  .setup-topline h1 {
    font-size: 36px;
  }

  .setup-intro {
    font-size: 14px;
  }

  .step-count {
    padding-top: 8px;
  }

  .goal-choices {
    grid-template-columns: 1fr;
  }

  .goal-choice:last-child {
    grid-column: auto;
  }

  .choice-card {
    min-height: 70px;
  }

  .choice-copy small {
    font-size: 11px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .study-hero-copy {
    padding: 24px 20px;
  }

  .study-hero h2 {
    font-size: 31px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-row {
    grid-template-columns: 30px minmax(0, 1fr) 27px;
    gap: 9px;
    padding: 13px 14px;
  }

  .task-copy strong {
    font-size: 12px;
  }

  .task-copy p {
    font-size: 10px;
  }

  .task-time {
    display: none;
  }

  .stat-cell {
    padding: 13px 10px;
  }

  .stat-cell strong {
    font-size: 17px;
  }

  .stat-cell small {
    font-size: 8px;
  }

  .section-heading {
    align-items: flex-start;
  }

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

  .vocab-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .select-wrap select {
    width: 100%;
  }

  .lesson-intro h1 {
    font-size: 39px;
  }

  .lesson-section {
    padding: 19px;
  }

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

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

  .reading-text {
    font-size: 16px;
  }

  .pronunciation-strip {
    align-items: flex-start;
  }

  .quiz-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quiz-body {
    padding: 19px;
  }

  .progress-stats {
    grid-template-columns: 1fr 1fr;
  }

  .progress-stat {
    min-height: 115px;
    padding: 14px;
  }

  .large-week .week-bar-track {
    max-width: 28px;
  }

  .word-modal-inner {
    padding: 27px 20px;
  }

  .word-modal-head h2 {
    font-size: 38px;
  }

  .modal-usage {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(238, 118, 87, .3); }
  70% { box-shadow: 0 0 0 10px rgba(238, 118, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(238, 118, 87, 0); }
}

.audio-button.speaking {
  animation: pulse-ring 1.2s ease infinite;
}
