:root {
  color-scheme: light;
  --c-bg: #f4f7f6;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafb;
  --c-border: #e2e8f0;
  --c-border-soft: #edf0f3;
  --c-text: #10201e;
  --c-text-soft: #64748b;
  --c-text-muted: #94a3b8;
  --c-brand: #0f766e;
  --c-brand-light: #14b8a6;
  --c-brand-bg: #ccfbf1;
  --c-accent: #f97316;
  --c-accent-light: #fb923c;
  --c-accent-bg: #ffedd5;
  --c-success: #10b981;
  --c-warn: #f59e0b;
  --c-error: #ef4444;
  --r-sm: 0.75rem;
  --r-md: 1rem;
  --r-lg: 1.25rem;
  --r-xl: 1.5rem;
  --r-2xl: 1.75rem;
  --r-full: 9999px;
  --s-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --s-md: 0 4px 6px -1px rgb(0 0 0 / .08), 0 2px 4px -2px rgb(0 0 0 / .06);
  --s-lg: 0 10px 15px -3px rgb(0 0 0 / .08), 0 4px 6px -4px rgb(0 0 0 / .05);
  --s-clay: 0 4px 0 0 rgb(0 0 0 / .08), 0 8px 20px -6px rgb(0 0 0 / .12);
  --s-clay-lg: 0 6px 0 0 rgb(0 0 0 / .08), 0 12px 28px -8px rgb(0 0 0 / .15);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 500;
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* === Fade animations === */
.fade-in { animation: fade-in .3s cubic-bezier(.22, 1, .36, 1); }
.fade-in-up { animation: fade-in-up .4s cubic-bezier(.22, 1, .36, 1); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === Buttons: claymorphism style === */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
  color: white;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  box-shadow: var(--s-clay), inset 0 1px 0 rgb(255 255 255 / .25);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
}
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--s-clay-lg), inset 0 1px 0 rgb(255 255 255 / .3);
  filter: brightness(1.05);
}
.primary-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 rgb(0 0 0 / .1), 0 2px 6px -2px rgb(0 0 0 / .1);
}
.primary-button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(.3);
}
.primary-button:not(.w-full):not(.max-w-56) { width: auto; }
.primary-button.max-w-56 { width: auto; min-width: 10rem; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 0 0 rgb(0 0 0 / .04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.secondary-button:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 0 0 rgb(0 0 0 / .06), 0 6px 14px -4px rgb(0 0 0 / .1);
}
.secondary-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 rgb(0 0 0 / .04);
}
.secondary-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--c-text-soft);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ghost-button:hover { background: var(--c-border-soft); color: var(--c-text); }

/* === Inputs === */
.input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--c-border-soft);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: 'Nunito Sans', 'PingFang SC', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input:hover { border-color: #d1d5db; }
.input:focus {
  border-color: var(--c-brand-light);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(20 184 166 / .12);
}
.input::placeholder { color: var(--c-text-muted); font-weight: 400; }

textarea.input { resize: vertical; line-height: 1.55; }

/* === Cards === */
.media-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--s-md);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease;
  text-decoration: none;
  color: inherit;
}
.media-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--s-lg);
}
.media-card-media {
  position: relative;
  aspect-ratio:3/4;
  overflow: hidden;
  background: var(--c-surface-2);
}
.media-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body { padding: 1.1rem 1.25rem 1.25rem; }
.card-title {
  margin: 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-text);
}
.card-text { margin: 0.4rem 0 0; color: var(--c-text-soft); font-size: 0.875rem; line-height: 1.5; }

/* === Chips === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.chip-primary { background: var(--c-brand-bg); color: var(--c-brand); }
.chip-success { background: #d1fae5; color: #065f46; }
.chip-danger { background: #fee2e2; color: #991b1b; }
.chip-warning { background: #fef3c7; color: #92400e; }
.chip-info { background: #dbeafe; color: #1e40af; }
.chip-neutral { background: #f1f5f9; color: #475569; }

/* === Progress === */
.progress-track {
  height: 0.55rem;
  border-radius: var(--r-full);
  background: var(--c-border-soft);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--c-brand-light), var(--c-brand));
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

/* === Empty state === */
.empty-media {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0fdfa 0%, #faf5ff 50%, #fff7ed 100%);
  display: grid;
  place-items: center;
}

/* === Panels === */
.panel {
  background: var(--c-surface);
  border-radius: var(--r-2xl);
  padding: 1.5rem;
  box-shadow: var(--s-sm);
  border: 1px solid var(--c-border-soft);
}
.panel-lg { padding: 1.75rem; }
.panel-title { margin: 0; font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: 1.1rem; font-weight: 600; }
.panel-subtitle { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--c-text-soft); }

/* === Sections === */
.section-title { margin: 0; font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: 1.25rem; font-weight: 600; }
.section-description { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--c-text-soft); }

/* === Photo chip === */
.photo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-full);
  background: rgb(255 255 255 / .92);
  backdrop-filter: blur(8px);
  color: var(--c-text);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgb(0 0 0 / .1);
}

/* === Voice button === */
.voice-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 0 0 rgb(0 0 0 / .1);
  transition: transform .15s ease;
}
.voice-button:hover { transform: translateY(-1px); }
.voice-button:active { transform: translateY(1px); }

/* === Practice Page - 沉浸式黑色风格 === */
.practice-body {
  background: #000;
  color: #fff;
}

/* 顶部栏 */
.practice-topbar {
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
}
.practice-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 52px;
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.practice-top-left {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
}
.practice-dot-progress {
  display: flex;
  align-items: center;
  gap: 3px;
}
.practice-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #262626;
  transition: all .3s ease;
}
.practice-dot.done {
  background: #14b8a6;
}
.practice-dot.active {
  width: 16px;
  background: #14b8a6;
}
.practice-dot-count {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #525252;
  letter-spacing: 0.02em;
}
.practice-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.practice-mini-select {
  height: 30px;
  padding: 0 0.6rem;
  border: 1px solid #262626;
  border-radius: 8px;
  background: #141414;
  color: #d4d4d4;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.practice-mini-select:hover {
  border-color: #404040;
  background: #1a1a1a;
}
.practice-mini-select option {
  background: #1a1a1a;
  color: #d4d4d4;
}
.practice-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.75rem;
  border: 1px solid #262626;
  border-radius: 999px;
  background: #141414;
  color: #a3a3a3;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.practice-chip-btn:hover {
  border-color: #404040;
  color: #d4d4d4;
}
.practice-chip-btn.active {
  background: #0c2e2a;
  border-color: #0f766e;
  color: #99f6e4;
}
.practice-chip-btn span {
  background: #0f766e;
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}
.practice-icon-btn {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #262626;
  border-radius: 8px;
  background: #141414;
  color: #a3a3a3;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.practice-icon-btn:hover {
  border-color: #404040;
  color: #fff;
  background: #1a1a1a;
}
.practice-icon-btn svg {
  width: 15px;
  height: 15px;
}

/* 顶部进度条 */
.practice-progress-bar {
  height: 3px;
  background: #1a1a1a;
  overflow: hidden;
}
.practice-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #ec4899);
  border-radius: 0 2px 2px 0;
  transition: width .4s cubic-bezier(.22, 1, .36, 1);
}

/* 练习主区域 */
.practice-section {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* 图片 */
.practice-image {
  max-height: 42vh;
  width: auto;
  max-width: 100%;
  border-radius: 16px;
  background: #141414;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  object-fit: contain;
}

/* 输入框 */
.practice-input {
  width: 100%;
  height: 58px;
  padding: 0 1.5rem;
  border: 2px solid #2a2a2a;
  border-radius: 12px;
  background: #141414;
  color: #fff;
  text-align: center;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.practice-input:focus {
  border-color: #14b8a6;
  background: #1a1625;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .12);
}
.practice-input::placeholder {
  color: #525252;
  font-weight: 500;
}

/* 按钮 */
.practice-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  height: 44px;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(20, 184, 166, .3);
  transition: all .15s ease;
}
.practice-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(20, 184, 166, .4);
  filter: brightness(1.05);
}
.practice-btn-primary:active {
  transform: translateY(1px);
}
.practice-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  height: 44px;
  padding: 0 1.75rem;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  background: #141414;
  color: #d4d4d4;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.practice-btn-secondary:hover {
  border-color: #404040;
  color: #fff;
  background: #1a1a1a;
  transform: translateY(-1px);
}

/* 底部快捷键栏 */
.practice-bottombar {
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  flex-shrink: 0;
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
}
.practice-bottombar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}
.practice-kbd-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #262626;
  border-radius: 10px;
  background: #141414;
  color: #a3a3a3;
  cursor: pointer;
  transition: all .15s ease;
}
.practice-kbd-btn:hover {
  border-color: #404040;
  color: #fff;
  background: #1a1a1a;
  transform: translateY(-1px);
}
.practice-kbd-btn.primary {
  border-color: #0f766e;
  background: linear-gradient(180deg, #134e4a, #0a2e2a);
  color: #ccfbf1;
}
.practice-kbd-btn.primary:hover {
  background: linear-gradient(180deg, #115e59, #134e4a);
  color: #f0fdfa;
}
.practice-kbd-btn .kbd {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #262626;
  color: #d4d4d4;
  line-height: 1;
}
.practice-kbd-btn.primary .kbd {
  background: #0f766e;
  color: #fff;
}
.practice-kbd-btn .kbd-label {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* 响应式：移动端隐藏底部快捷键栏的文字 */
@media (max-width: 640px) {
  .practice-topbar-inner { height: 48px; padding: 0 0.75rem; }
  .practice-title { font-size: 13px; }
  .practice-mini-select { display: none; }
  .practice-chip-btn { display: none; }
  .practice-image { max-height: 35vh; }
  .practice-input { height: 52px; font-size: 1.25rem; }
  .practice-bottombar-inner { gap: 0.25rem; }
  .practice-kbd-btn { min-width: 56px; padding: 0.4rem 0.5rem; }
  .practice-kbd-btn .kbd-label { font-size: 10px; }
}

/* 旧样式保留占位 - 防止其他地方引用报错 */
.practice-control { color: #f8fafc; border: 2px solid rgb(255 255 255 / .1); background: rgb(255 255 255 / .04); }
.practice-play-button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.15rem; border: 1px solid rgb(45 212 191 / .3); border-radius: .8rem; background: rgb(45 212 191 / .12); padding: 0 .75rem; font-size: 13px; font-weight: 750; color: #d9fef8; }
.practice-icon-button { display: grid; place-items: center; }
.practice-chip { display: inline-flex; }
.practice-button-primary, .practice-button-secondary { display: none; }

.phrase-inputs { display: flex; align-items: flex-end; justify-content: center; gap: .55rem; min-height: 3rem; padding: .25rem 0; }
.phrase-inputs { flex-wrap: wrap; }
.phrase-word-item { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.phrase-word-counter { display: block; min-width: 2rem; margin-bottom: .3rem; text-align: center; font-size: 10px; font-weight: 800; color: rgb(226 232 240 / .58); }
.phrase-word-input { width: clamp(3.8rem, 17vw, 7rem); height: 3rem; border: 2px solid rgb(255 255 255 / .15); border-radius: .85rem; background: rgb(255 255 255 / .07); padding: 0 .55rem; color: #f8fafc; font-size: 1.1rem; font-weight: 800; text-align: center; outline: none; transition: .18s; }
.phrase-word-input:focus { border-color: rgb(45 212 191 / .65); background: rgb(45 212 191 / .1); outline: 3px solid rgb(45 212 191 / .12); transform: translateY(-1px); }
.phrase-word-input::placeholder { color: rgb(148 163 184 / .65); }
.phrase-word-input:disabled { opacity: .9; }
.practice-button-primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 3rem; border: 0; border-radius: 1rem; background: linear-gradient(135deg, #14b8a6, #0d9488); padding: 0 1.75rem; font-size: 15px; font-weight: 800; color: white; box-shadow: 0 12px 32px rgb(13 148 136 / .35); transition: .2s; }
.practice-button-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.practice-button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 3rem; border: 2px solid rgb(255 255 255 / .12); border-radius: 1rem; background: rgb(255 255 255 / .05); padding: 0 1.75rem; font-size: 15px; font-weight: 800; color: white; transition: .2s; }
.practice-button-secondary:hover { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2); transform: translateY(-1px); }
.practice-celebration { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; overflow: hidden; pointer-events: none; background: radial-gradient(circle at center, rgb(15 118 110 / .18), transparent 62%); animation: practice-celebration-fade .95s ease forwards; }
.practice-celebration-core { position: relative; display: grid; justify-items: center; padding: 1.4rem 2.3rem; border: 1px solid rgb(255 255 255 / .15); border-radius: 1.25rem; background: rgb(8 16 18 / .74); box-shadow: 0 24px 70px rgb(0 0 0 / .35), inset 0 1px 0 rgb(255 255 255 / .1); backdrop-filter: blur(18px); transform: scale(.65); opacity: 0; animation: practice-celebration-pop .58s cubic-bezier(.18, .9, .25, 1.18) forwards; }
.practice-celebration-title { margin: 0; font-size: clamp(1.7rem, 6vw, 2.6rem); font-weight: 900; line-height: 1.1; color: #d9fef8; text-shadow: 0 0 24px rgb(15 118 110 / .55); }
.practice-celebration-message { margin: .5rem 0 0; font-size: .95rem; font-weight: 700; color: rgb(226 232 240 / .78); }
.practice-celebration-ring { position: absolute; inset: -32px; border: 2px solid rgb(15 118 110 / .4); border-radius: 1.7rem; opacity: 0; animation: practice-celebration-ring .75s ease-out forwards; }
.practice-celebration-ring:nth-child(2) { animation-delay: .12s; border-color: rgb(245 158 11 / .3); }
.practice-celebration-particle { position: absolute; left: 50%; top: 50%; border-radius: 999px; opacity: 0; animation: practice-celebration-particle .88s ease-out forwards; }
@keyframes practice-celebration-fade { 0% { opacity: 0; } 18%, 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes practice-celebration-pop { 0% { transform: scale(.62) translateY(10px); opacity: 0; } 42% { transform: scale(1.04) translateY(0); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes practice-celebration-ring { 0% { transform: scale(.82); opacity: .9; } 100% { transform: scale(1.22); opacity: 0; } }
@keyframes practice-celebration-particle { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--scale)); } }

/* === Answer Modal === */
.answer-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / .6);
  backdrop-filter: blur(6px);
  animation: answer-fade-in .25s ease;
}
.answer-modal.hidden { display: none; }
@keyframes answer-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.answer-modal-content {
  position: relative;
  padding: 2.5rem 3rem;
  border-radius: 1.75rem;
  background: linear-gradient(180deg, #1a2e33 0%, #0f1f23 100%);
  border: 2px solid rgb(255 255 255 / .1);
  box-shadow: 0 30px 80px rgb(0 0 0 / .5), inset 0 1px 0 rgb(255 255 255 / .1);
  text-align: center;
  animation: answer-pop .35s cubic-bezier(.22, 1.2, .36, 1);
  max-width: 90vw;
}
@keyframes answer-pop {
  from { opacity: 0; transform: scale(.85) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.answer-word {
  margin: 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.answer-phonetic {
  margin: 0.75rem 0 0;
  font-size: clamp(1rem, 3vw, 1.35rem);
  color: #5eead4;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 500;
}
.answer-close {
  margin-top: 1.75rem;
  padding: 0.55rem 1.2rem;
  border: 2px solid rgb(255 255 255 / .12);
  border-radius: 999px;
  background: rgb(255 255 255 / .06);
  color: rgb(226 232 240 / .8);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
}
.answer-close:hover {
  background: rgb(255 255 255 / .12);
  color: #fff;
  transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) { .practice-celebration, .practice-celebration-core, .practice-celebration-ring, .practice-celebration-particle { animation-duration: .01ms; animation-iteration-count: 1; } }

:root {
  --brand: #0b7c6f;
  --brand-teal: #12a372;
  --brand-amber: #f59e0b;
  --coral: #ff8f7c;
  --sun: #ffd166;
  --ink: #17272c;
  --muted: #64748b;
  --line: #e2e8f0;
  --shadow-sm: 0 6px 18px rgb(16 32 38 / .05);
  --shadow-md: 0 14px 36px rgb(16 32 38 / .08);
}

.media-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f9fcfa 0%, #eef6f3 100%);
}
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.media-frame.contain { padding: .75rem; }
.media-frame.contain img { object-fit: contain; border-radius: .7rem; }
.photo-chip { border: 1px solid rgb(255 255 255 / .9); border-radius: 999px; background: rgb(255 255 255 / .95); padding: .28rem .65rem; color: var(--ink); font-size: 12px; font-weight: 750; box-shadow: var(--shadow-sm); }

.home-hero { overflow: hidden; position: relative; border: 0; border-radius: 1.75rem; background: linear-gradient(135deg, #083f39 0%, #0a675b 46%, #11997e 100%); box-shadow: 0 30px 80px rgb(9 43 38 / .24); isolation: isolate; }
.home-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 5px; z-index: 2; background: linear-gradient(90deg, var(--coral), var(--sun), #8de8c7); }

.learning-heatmap {
  margin-top: 1.5rem;
  border: 1px solid var(--ui-line);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: var(--ui-shadow);
  padding: clamp(1.25rem, 2vw, 1.6rem);
}
.learning-heatmap-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.heatmap-badges { display: flex; flex-shrink: 0; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.heatmap-badge {
  display: inline-flex; align-items: center; min-height: 34px; border: 1px solid var(--ui-line);
  border-radius: 999px; background: var(--ui-surface-muted); padding: 0 .8rem;
  color: var(--ui-body); font-size: 13px; font-weight: 800; white-space: nowrap;
}
.heatmap-badge.active { border-color: #a9d8d0; background: var(--ui-primary-soft); color: var(--ui-primary); }
.heatmap-body { display: flex; align-items: stretch; gap: .7rem; margin-top: 1.4rem; }
.heatmap-week-labels {
  display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; flex-shrink: 0;
  color: var(--ui-muted); font-size: 10px; font-weight: 800; line-height: 14px;
}
.heatmap-week-labels span:first-child { grid-row: 1; }
.heatmap-week-labels span:nth-child(2) { grid-row: 4; }
.heatmap-week-labels span:last-child { grid-row: 7; }
.heatmap-scroll { min-width: 0; overflow-x: auto; padding-bottom: .35rem; }
.heatmap-grid {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); grid-auto-columns: 14px;
  gap: 3px; width: max-content;
}
.heatmap-cell { width: 14px; height: 14px; border-radius: 4px; background: #e7eeec; box-shadow: inset 0 0 0 1px rgb(16 32 30 / .04); }
.heatmap-cell.level-1 { background: #b8e5d8; }
.heatmap-cell.level-2 { background: #61c3ae; }
.heatmap-cell.level-3 { background: #189a85; }
.heatmap-cell.level-4 { background: #0b6c5e; }
.heatmap-cell.today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f7b32b; }
.heatmap-cell.future { background: #f3f6f5; box-shadow: inset 0 0 0 1px #e4ecea; }
.heatmap-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.heatmap-stats { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; color: var(--ui-muted); font-size: 13px; font-weight: 800; }
.heatmap-stats span { display: inline-flex; align-items: center; gap: .35rem; }
.heatmap-stats span + span::before { content: ""; width: 4px; height: 4px; border-radius: 999px; background: #c5d4d1; }
.heatmap-legend { display: inline-flex; align-items: center; gap: 4px; color: var(--ui-muted); font-size: 11px; font-weight: 800; }
.heatmap-cta {
  display: inline-flex; width: 100%; align-items: center; justify-content: center; min-height: 46px;
  margin-top: 1.1rem; border-radius: .9rem; background: linear-gradient(135deg, #ffd166, #ffb454);
  color: #253c38; font-weight: 900; text-decoration: none; box-shadow: 0 12px 28px rgb(255 180 84 / .24);
}
.home-hero-badge, .home-progress-chip { display: inline-flex; width: fit-content; align-items: center; gap: .4rem; border: 1px solid rgb(255 255 255 / .2); border-radius: 999px; background: rgb(255 255 255 / .12); padding: .42rem .8rem; color: #eafff7; font-size: 12px; font-weight: 800; backdrop-filter: blur(10px); }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.home-hero-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(1.9rem, 4vw, 3.4rem); }
.home-hero-title { margin: 1.2rem 0 0; color: #fff; font-size: clamp(2.1rem, 4.5vw, 3.45rem); font-weight: 900; line-height: 1.06; }
.home-hero-title strong { color: #ffe9a8; }
.home-hero-marker { display: block; width: 56px; height: 4px; margin-top: 1.2rem; border-radius: 999px; background: linear-gradient(90deg, #ffd166, #ff8f7c); }
.home-hero-description { margin: 1.35rem 0 0; max-width: 37rem; color: #d8eae5; font-size: 1.05rem; line-height: 1.75; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.home-hero-btn { display: inline-flex; height: 3.1rem; align-items: center; justify-content: center; gap: .55rem; border-radius: .95rem; padding: 0 1.25rem; font-size: 15px; font-weight: 800; text-decoration: none; transition: transform .18s ease, filter .18s ease; }
.home-hero-btn.primary { background: linear-gradient(135deg, #fff2cd, #ffd166); color: #253c38; box-shadow: 0 14px 34px rgb(255 209 102 / .28); }
.home-hero-btn.secondary { border: 1px solid rgb(255 255 255 / .16); background: rgb(255 255 255 / .12); color: #fff; backdrop-filter: blur(12px); }
.home-hero-btn.ghost { border: 1px solid transparent; color: #d9ece8; }
.home-hero-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.home-progress { margin-top: 2.4rem; border: 1px solid rgb(255 255 255 / .14); border-radius: 1.1rem; background: rgb(255 255 255 / .1); padding: 1.15rem 1.2rem; box-shadow: inset 0 1px 0 rgb(255 255 255 / .12); backdrop-filter: blur(12px); }
.home-progress-label { margin: 0; color: #d7eae5; font-size: 13px; font-weight: 800; }
.home-progress-value { display: block; margin-top: .25rem; color: #fff; font-size: 2rem; font-weight: 900; line-height: 1; }
.home-progress .progress-track { background: rgb(255 255 255 / .2); }
.home-hero-media { position: relative; display: flex; min-width: 0; align-items: center; justify-content: center; border-left: 1px solid rgb(255 255 255 / .1); background: linear-gradient(135deg, rgb(255 255 255 / .06), rgb(255 255 255 / .02)); padding: 2rem; }
.home-hero-frame { display: grid; width: min(100%, 460px); aspect-ratio:3/4; overflow: hidden; border: 6px solid rgb(255 255 255 / .92); border-radius: 1.5rem; background: #fff; box-shadow: 0 24px 60px rgb(16 32 38 / .12); }
.home-hero-frame img { display: block; width: 100%; height: 100%; object-fit: contain; padding: .7rem; }
.home-hero-caption { position: absolute; right: 1.5rem; bottom: 1.5rem; left: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid rgb(255 255 255 / .9); border-radius: 1rem; background: rgb(255 255 255 / .94); padding: .85rem 1rem; box-shadow: var(--shadow-md); }
.home-caption-label { display: block; color: #63777d; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.home-caption-word { display: block; overflow: hidden; color: var(--ink); font-size: 19px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.home-caption-arrow { display: grid; width: 42px; height: 42px; flex-shrink: 0; place-items: center; border-radius: 999px; background: #eafaf5; color: var(--brand); }
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.home-stat { position: relative; display: flex; align-items: flex-start; gap: 1rem; border: 2px solid var(--line); border-radius: 1.35rem; background: #fff; padding: 1.35rem; text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.home-stat:hover { border-color: #84d8c7; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.home-stat--mint { border-color: #c8e9dd; background: linear-gradient(135deg, #effbf5, #fcfffd); }
.home-stat--mint .home-stat-icon { background: #dff4eb; color: #0b7c6f; }
.home-stat--peach { border-color: #f7d0c9; background: linear-gradient(135deg, #fff3f0, #fffdfc); }
.home-stat--peach .home-stat-icon { background: #ffe3dd; color: #e25544; }
.home-stat--sun { border-color: #f3ddb2; background: linear-gradient(135deg, #fff8e6, #fffefb); }
.home-stat--sun .home-stat-icon { background: #ffedc4; color: #d97706; }
.home-stat--sky { border-color: #c9e2f7; background: linear-gradient(135deg, #eff8ff, #fdfeff); }
.home-stat--sky .home-stat-icon { background: #dbecfb; color: #2563eb; }
.home-stat-icon { display: grid; width: 2.75rem; height: 2.75rem; flex-shrink: 0; place-items: center; border-radius: .95rem; transition: transform .2s ease; }
.home-stat:hover .home-stat-icon { transform: scale(1.05); }
.home-stat-arrow { position: absolute; right: 1rem; bottom: 1rem; color: #a7b6ba; opacity: 0; transition: opacity .2s ease, transform .2s ease; }
.home-stat:hover .home-stat-arrow { color: var(--brand); opacity: 1; transform: translateX(2px); }
.home-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.section-title { margin: 0; color: var(--ink); font-size: 1.18rem; font-weight: 900; line-height: 1.3; }
.section-description { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.home-more-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--brand); font-size: 14px; font-weight: 800; text-decoration: none; transition: gap .18s ease; }
.home-more-link:hover { gap: .6rem; }
.home-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.5rem; }
.home-project-card { display: flex; height: 100%; flex-direction: column; overflow: hidden; border: 2px solid var(--line); border-radius: 1.25rem; background: #fff; box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.home-project-card:hover { border-color: #84d8c7; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.home-project-media { position: relative; aspect-ratio:3/4; overflow: hidden; background: linear-gradient(135deg, #f9fbf8, #f2f6f4); }
.home-project-media img { display: block; width: 100%; height: 100%; object-fit: contain; padding: .55rem; transition: transform .28s ease; }
.home-project-card:hover .home-project-media img { transform: scale(1.045); }
.home-project-media .photo-chip { position: absolute; left: .9rem; bottom: .9rem; }
.home-project-body { display: flex; min-height: 0; flex: 1; flex-direction: column; padding: 1.25rem; }
.home-project-progress { margin-top: auto; padding-top: 1.3rem; }
.progress-track { height: .5rem; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12a372, #0b7c6f); }
@media (max-width: 1080px) {
  .home-hero-grid { grid-template-columns: 1fr; }
  .home-hero-media { min-height: 420px; border-top: 1px solid rgb(255 255 255 / .1); border-left: 0; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home-hero-copy { padding: 1.25rem 1.1rem 1.35rem; }
  .home-hero-media { min-height: 320px; padding: 1rem; }
  .home-caption { right: 1rem; bottom: 1rem; left: 1rem; padding: .7rem .85rem; }
  .home-caption-word { font-size: 17px; }
  .home-stats { grid-template-columns: 1fr; }
  .home-project-grid { grid-template-columns: 1fr; }
}

.batch-panel {
  overflow: hidden;
  border: 1px solid #dfeae6;
  border-radius: 1.65rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fdfb 100%);
  padding: 1.65rem;
  box-shadow: 0 18px 50px rgb(16 32 38 / .06);
}

.batch-head { position: relative; }
.batch-kicker {
  margin: 0;
  color: #0b7c6f;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.batch-title { margin: .45rem 0 0; color: #17272c; font-size: 1.6rem; font-weight: 900; line-height: 1.2; }
.batch-description { margin: .6rem 0 0; color: #64748b; font-size: .875rem; line-height: 1.65; }

.batch-progress {
  margin-top: 1.35rem;
  border: 1px solid #d7ece5;
  border-radius: 1.15rem;
  background: linear-gradient(135deg, #f0fbf7 0%, #ffffff 100%);
  padding: 1.05rem 1.1rem;
}
.batch-progress-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.batch-progress-label { color: #54706c; font-size: .8rem; font-weight: 800; }
.batch-progress-value { color: #0b7c6f; font-size: 1.75rem; font-weight: 900; line-height: 1; }

.batch-form { margin-top: 1.5rem; }
.batch-section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.batch-section-title { color: #17272c; font-size: .95rem; font-weight: 900; }
.batch-section-note { color: #8ca3a0; font-size: .75rem; font-weight: 750; }
.batch-field { display: block; margin-top: .75rem; }
.batch-label { display: block; margin-bottom: .45rem; color: #54706c; font-size: .78rem; font-weight: 850; }
.batch-textarea { min-height: 7.5rem; resize: vertical; line-height: 1.7; }
.batch-hint { margin: .65rem 0 0; color: #7f9a96; font-size: .78rem; line-height: 1.55; }
.batch-feedback {
  margin: .7rem 0 0; border-radius: .8rem; padding: .65rem .8rem;
  color: #0b7c6f; background: #e9f7f1; font-size: .8rem; font-weight: 750; line-height: 1.5;
}
.batch-feedback.error { color: #b4232a; background: #fdecec; }

.batch-actions { display: grid; gap: .7rem; margin-top: 1.1rem; }
.batch-actions .primary-button,
.batch-actions .secondary-button { width: 100%; justify-content: center; }

.batch-settings { display: grid; gap: .7rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #e4eeeb; }
.batch-setting {
  display: block;
  border: 1px solid #e4eeeb;
  border-radius: 1rem;
  background: #fff;
  padding: .85rem .9rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.batch-setting:hover { border-color: #a8dccd; box-shadow: 0 8px 22px rgb(16 32 38 / .05); }
.batch-setting-label {
  display: block;
  color: #738c88;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.batch-setting-value { display: block; margin-top: .4rem; color: #17272c; font-size: .95rem; font-weight: 850; }
.batch-setting-description { display: block; margin-top: .35rem; color: #7f9a96; font-size: .75rem; line-height: 1.5; }
.batch-select { margin-top: .45rem; }

@media (min-width: 640px) {
  .batch-actions { grid-template-columns: 1.15fr .85fr; }
}

/* ============================================
   练习页面 - 简洁全屏
   ============================================ */

.prac-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background-color: #0b1518;
  background-image: linear-gradient(180deg, #101e22 0%, #0a1518 55%, #070e11 100%);
}

.prac-container {
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 顶部 */
.prac-header { flex-shrink: 0; }

.prac-wood-sign { display: none; }

.prac-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.prac-topbar-left,
.prac-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prac-select {
  appearance: none;
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  border-radius: .6rem;
  padding: 7px 26px 7px 10px;
  font-size: 13px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  transition: .18s;
}

.prac-select:hover { border-color: rgba(45,212,191,.35); background: rgba(45,212,191,.12); }

.prac-select option { color: #172128; background: white; }

.prac-progress-chip {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  padding: 6px 12px;
  min-width: 120px;
}

.prac-progress-text {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.prac-progress-track {
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.prac-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #2dd4bf);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.prac-score-chip {
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
}

.prac-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: .6rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  transition: .18s;
  text-decoration: none;
}

.prac-icon-btn:hover {
  border-color: rgba(45,212,191,.35);
  background: rgba(45,212,191,.12);
  color: white;
}

/* 筛选栏 */
.prac-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* 主卡片 */
.prac-main-card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 1.25rem;
  background: rgba(255,255,255,.05);
  box-shadow: 0 24px 60px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}

.prac-main-inner {
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow-y: auto;
}

/* 发音按钮 */
.prac-speak-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.prac-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(45,212,191,.12);
  border: 1px solid rgba(45,212,191,.3);
  border-radius: .8rem;
  color: #d9fef8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s;
}

.prac-speak-btn:hover { background: rgba(45,212,191,.2); }

.prac-speak-icon { font-size: 15px; }

/* 情景图 */
.prac-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 480px;
  display: grid;
  place-items: center;
  position: relative;
}

.prac-image-wrap {
  width: 100%;
  max-width: 360px;
  aspect-ratio:3/4;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255,255,255,.05);
  box-shadow: 0 20px 50px rgba(0,0,0,.32);
}

.prac-scene-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prac-scene-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 48px;
  color: rgba(255,255,255,.2);
}

.prac-meaning-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prac-meaning-text {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
}

.prac-phrase-badge {
  background: rgba(245,158,11,.2);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

/* 答案卡片 */
.prac-cards {
  width: 100%;
  max-width: 700px;
  flex-shrink: 0;
  animation: prac-cards-in 0.35s ease;
}

@keyframes prac-cards-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.prac-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.prac-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem;
  padding: 12px;
  text-align: center;
}

.prac-card-label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
}

.prac-card-image {
  width: 100%;
  aspect-ratio:3/4;
  border-radius: .75rem;
  overflow: hidden;
  background: rgba(255,255,255,.05);
}

.prac-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prac-card-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.25);
  font-size: 12px;
}

.prac-card-word {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}

.prac-card-meaning {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.prac-card-story {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.5;
}

.prac-card-story-cn {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.5;
}

/* 输入区 */
.prac-inputs-wrap {
  width: 100%;
  max-width: 480px;
  flex-shrink: 0;
}

.prac-input-wrap {
  position: relative;
  width: 100%;
}

.prac-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  opacity: .5;
}

.prac-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  font-size: 17px;
  font-weight: 500;
  color: #f8fafc;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .9rem;
  outline: none;
  transition: .18s;
  text-align: center;
  letter-spacing: 0.5px;
}

.prac-input:focus {
  border-color: rgba(45,212,191,.5);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 4px rgba(45,212,191,.1);
}

.prac-input-correct {
  border-color: rgba(52,211,153,.6) !important;
  background: rgba(16,185,129,.15) !important;
}

.prac-input-wrong {
  border-color: rgba(248,113,113,.6) !important;
  background: rgba(239,68,68,.12) !important;
  animation: prac-shake 0.35s ease;
}

.prac-input-show {
  border-color: rgba(251,191,36,.6) !important;
  background: rgba(245,158,11,.12) !important;
}

@keyframes prac-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.prac-phrase-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.prac-phrase-word {
  width: calc(33.333% - 6px);
  min-width: 90px;
  padding: 10px 6px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  color: #f8fafc;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .8rem;
  outline: none;
  transition: .18s;
}

.prac-phrase-word:focus {
  border-color: rgba(45,212,191,.5);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(45,212,191,.1);
}

/* 反馈 */
.prac-feedback {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  min-height: 20px;
  flex-shrink: 0;
}

.prac-feedback-info { color: #94a3b8; }
.prac-feedback-success { color: #6ee7b7; }
.prac-feedback-error { color: #fca5a5; }
.prac-feedback-hint { color: #fcd34d; }

/* 按钮 */
.prac-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  justify-content: center;
  width: 100%;
  max-width: 380px;
}

.prac-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  color: white;
  border: 0;
  border-radius: .8rem;
  cursor: pointer;
  transition: .18s;
  text-decoration: none;
  text-align: center;
}

.prac-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.prac-btn:disabled { opacity: .5; cursor: not-allowed; }

.prac-btn-green {
  background: linear-gradient(135deg, #12a372, #0f766e);
  box-shadow: 0 10px 26px rgba(15,118,110,.22);
}

.prac-btn-orange {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 10px 26px rgba(249,115,22,.2);
}

/* 提示 */
.prac-hints {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  color: rgba(255,255,255,.35);
  flex-shrink: 0;
}

/* 底部装饰 - 隐藏 */
.prac-bottom-decor,
.prac-bg,
.prac-sun,
.prac-cloud,
.prac-grass,
.prac-tree,
.prac-bird {
  display: none !important;
}

/* 庆祝动画 */
.prac-celebrate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.4s ease;
}

.prac-celebrate-box {
  text-align: center;
  animation: prac-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes prac-pop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.prac-celebrate-emoji { font-size: 64px; }

.prac-celebrate-text {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 900;
  color: #6ee7b7;
  text-shadow: 0 0 20px rgba(52,211,153,.4);
}

.prac-star {
  position: absolute;
  font-size: 20px;
  animation: prac-star-fly 1.5s ease-out forwards;
}

@keyframes prac-star-fly {
  0% { transform: translateY(0) scale(0); opacity: 1; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* 完成页 */
.prac-complete-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1.5rem;
  padding: 40px 32px;
  text-align: center;
  max-width: 480px;
  margin: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  color: #f1f5f9;
}

.prac-complete-emoji { font-size: 72px; }

.prac-complete-title {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  color: #f8fafc;
}

.prac-complete-desc {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 14px;
}

.prac-complete-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 24px 0;
}

.prac-stat-item { text-align: center; }

.prac-stat-num {
  font-size: 32px;
  font-weight: 800;
  color: #f8fafc;
}

.prac-stat-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 2px;
}

.prac-complete-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.prac-complete-actions .prac-btn {
  flex: none;
  min-width: 130px;
}

/* ============================================================
   AI English Studio UI System v2
   Reference: docs/UI_STYLE_GUIDE.md
   ============================================================ */

:root {
  --ui-canvas: #f4f7f6;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f7faf9;
  --ui-primary: #0f766e;
  --ui-primary-hover: #0b635c;
  --ui-primary-soft: #e8f5f2;
  --ui-accent: #f97316;
  --ui-ink: #10201e;
  --ui-body: #425555;
  --ui-muted: #6b7f7c;
  --ui-line: #dde8e6;
  --ui-success: #16a34a;
  --ui-success-bg: #eaf7f0;
  --ui-warning: #d97706;
  --ui-warning-bg: #fff6e5;
  --ui-info: #2563eb;
  --ui-info-bg: #ebf3ff;
  --ui-danger: #dc2626;
  --ui-danger-bg: #fff1f1;
  --ui-radius: 16px;
  --ui-radius-sm: 10px;
  --ui-shadow: 0 8px 24px rgb(16 32 30 / .05);
  --ui-shadow-hover: 0 18px 42px rgb(16 32 30 / .09);
  --ui-focus: 0 0 0 4px rgb(15 118 110 / .14);
}

body {
  background: var(--ui-canvas);
  color: var(--ui-ink);
  font-family: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.font-display { font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif; letter-spacing: 0; }

.app-shell {
  display: flex;
  width: 100%;
  max-width: 1560px;
  min-height: 100dvh;
  margin: 0 auto;
}

@media (max-width: 899px) {
  .app-shell { display: block; }
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: none;
  height: 100dvh;
  width: 216px;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--ui-line);
  background: var(--ui-surface);
  padding: 18px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: inherit;
  text-decoration: none;
}

.brand-mobile { margin-bottom: 0; min-width: 0; }
.brand-mobile .font-display { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #15803d, var(--ui-primary));
  color: #fff;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 19px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgb(15 118 110 / .18);
}

.brand-title { display: block; color: var(--ui-ink); font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: 16px; font-weight: 600; line-height: 1.2; }
.brand-subtitle { display: block; margin-top: 2px; color: var(--ui-muted); font-size: 11px; font-weight: 700; }

.app-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  border-radius: var(--ui-radius-sm);
  padding: 8px 10px;
  color: var(--ui-body);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { background: var(--ui-surface-muted); color: var(--ui-ink); }
.nav-link.bg-teal-50 { background: var(--ui-primary-soft); color: var(--ui-primary); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-muted);
  padding: 12px;
}
.user-avatar { display: grid; width: 34px; height: 34px; flex-shrink: 0; place-items: center; border-radius: 10px; background: var(--ui-primary-soft); color: var(--ui-primary); font-size: 13px; font-weight: 800; }
.user-name { overflow: hidden; color: var(--ui-ink); font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.user-email { overflow: hidden; color: var(--ui-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-card .icon-button { margin-left: auto; color: var(--ui-muted); }

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ui-line);
  background: rgb(255 255 255 / .92);
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
  backdrop-filter: blur(14px);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .icon-button { width: 42px; height: 42px; }
.topbar-actions .icon-button svg { width: 20px; height: 20px; }
.mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 10px;
  right: 10px;
  z-index: 50;
  max-height: calc(100dvh - 76px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-surface);
  box-shadow: 0 22px 55px rgb(16 32 30 / .18);
  padding: 12px;
}
.mobile-menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ui-line);
  padding: 4px 6px 12px;
}
.mobile-menu-user .user-name,
.mobile-menu-user .user-email { display: block; }
.mobile-app-nav { overflow: visible; }
.app-main {
  min-height: calc(100dvh - 68px);
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}

@media (min-width: 900px) {
  .app-sidebar { display: flex; }
  .mobile-topbar { display: none; }
  .app-main { min-height: 100dvh; padding: 32px; }
}

@media (max-width: 380px) {
  .mobile-topbar { padding: 8px 12px; }
  .brand-mobile .font-display { font-size: 16px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button { width: 40px; height: 40px; }
  .app-main { padding: 14px; }
}

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-title { margin: 0; color: var(--ui-ink); font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: 28px; font-weight: 600; line-height: 1.2; }
.page-desc { margin: 8px 0 0; max-width: 640px; color: var(--ui-body); font-size: 14px; line-height: 1.6; }
.section-title { margin: 0; color: var(--ui-ink); font-size: 19px; font-weight: 800; line-height: 1.3; }
.section-description { margin: 6px 0 0; color: var(--ui-muted); font-size: 13px; line-height: 1.55; }

.panel {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}
.panel-tight { padding: 20px; }
.panel-lg { padding: 24px; }
.panel-hover { transition: border-color .2s ease, box-shadow .2s ease; }
.panel-hover:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-title { margin: 0; color: var(--ui-ink); font-size: 18px; font-weight: 800; line-height: 1.3; }
.panel-subtitle { margin: 6px 0 0; color: var(--ui-muted); font-size: 13px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  padding: 10px 18px;
  color: var(--ui-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ui-primary); color: #fff; box-shadow: 0 10px 22px rgb(15 118 110 / .18); }
.btn-primary:hover:not(:disabled) { background: var(--ui-primary-hover); box-shadow: 0 14px 28px rgb(15 118 110 / .22); }
.btn-secondary { border-color: var(--ui-line); background: var(--ui-surface); color: var(--ui-body); }
.btn-secondary:hover:not(:disabled) { border-color: #a9d8d0; background: var(--ui-surface-muted); color: var(--ui-ink); }
.btn-ghost { background: transparent; color: var(--ui-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--ui-surface-muted); color: var(--ui-ink); }
.btn-danger { border-color: #f5c4c4; background: var(--ui-surface); color: var(--ui-danger); }
.btn-danger:hover:not(:disabled) { background: var(--ui-danger-bg); border-color: #ecaeae; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }

.primary-button, .secondary-button, .danger-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.primary-button { background: var(--ui-primary); color: #fff; box-shadow: 0 10px 22px rgb(15 118 110 / .18); }
.primary-button:hover:not(:disabled) { background: var(--ui-primary-hover); }
.secondary-button { border-color: var(--ui-line); background: var(--ui-surface); color: var(--ui-body); }
.secondary-button:hover:not(:disabled) { border-color: #a9d8d0; background: var(--ui-surface-muted); color: var(--ui-ink); }
.danger-button { border-color: #f5c4c4; background: var(--ui-surface); color: var(--ui-danger); }
.danger-button:hover:not(:disabled) { background: var(--ui-danger-bg); border-color: #ecaeae; }
.ghost-button { border: 0; background: transparent; color: var(--ui-muted); cursor: pointer; }
.ghost-button:hover { background: var(--ui-surface-muted); color: var(--ui-ink); }

button:focus-visible, a:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}
.btn[aria-busy="true"], .primary-button[aria-busy="true"], .secondary-button[aria-busy="true"], .danger-button[aria-busy="true"] {
  opacity: .72;
  cursor: progress;
}
.route-error { max-width: 680px; margin: 48px auto; text-align: center; }
.route-error .page-desc { margin-left: auto; margin-right: auto; }
.route-error .page-actions { justify-content: center; }

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(16 32 30 / .38);
  backdrop-filter: blur(5px);
}
.confirm-card {
  width: min(100%, 420px);
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-surface);
  padding: 24px;
  box-shadow: 0 28px 80px rgb(16 32 30 / .24);
}
.confirm-title { margin: 0; color: var(--ui-ink); font-size: 19px; font-weight: 800; }
.confirm-message { margin: 10px 0 0; color: var(--ui-body); font-size: 14px; line-height: 1.65; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.status-message {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-muted);
  color: var(--ui-body);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 750;
}
.status-message:empty { display: none; }
.status-message.error { border-color: #f2c5c5; background: var(--ui-danger-bg); color: var(--ui-danger); }
.status-message.success { border-color: #b9e2d3; background: var(--ui-success-bg); color: #147c53; }
.skeleton-page { display: grid; gap: 18px; }
.skeleton-line { border-radius: 999px; background: linear-gradient(90deg, #e6eeec 25%, #f3f8f7 45%, #e6eeec 65%); background-size: 300% 100%; animation: skeleton-move 1.2s ease infinite; }
.skeleton-panel { border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); padding: 24px; }
.section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.section-tabs::-webkit-scrollbar { height: 5px; }
.section-tabs::-webkit-scrollbar-thumb { border-radius: 999px; background: #c9dbd8; }

.field { display: block; }
.field-label { display: block; margin-bottom: 8px; color: var(--ui-body); font-size: 13px; font-weight: 800; }
.field-help { margin-top: 6px; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-muted);
  color: var(--ui-ink);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
textarea.input { min-height: 104px; }
.input:focus { border-color: #83c8bd; background: #fff; box-shadow: var(--ui-focus); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.chip-neutral { color: var(--ui-body); background: var(--ui-surface-muted); }
.chip:not([class*="chip-"]) { color: var(--ui-body); background: var(--ui-surface-muted); }
.chip-primary { color: var(--ui-primary); background: var(--ui-primary-soft); }
.chip-success { color: var(--ui-success); background: var(--ui-success-bg); }
.chip-warning { color: var(--ui-warning); background: var(--ui-warning-bg); }
.chip-info { color: var(--ui-info); background: var(--ui-info-bg); }
.chip-danger { color: var(--ui-danger); background: var(--ui-danger-bg); }

.card-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .card-grid-2 { grid-template-columns: repeat(2, 1fr); } .card-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } .card-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .card-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.media-card {
  display: flex;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.media-card:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); }
.media-card-media { position: relative; aspect-ratio:3/4; overflow: hidden; background: linear-gradient(135deg, #f8fbfa, #edf4f2); }
.media-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.media-card.contain .media-card-media img, .media-card-media.contain img { object-fit: contain; padding: 10px; }
.media-card:hover .media-card-media img { transform: scale(1.035); }
.card-body { display: flex; min-height: 0; flex: 1; flex-direction: column; padding: 18px; }
.card-title { overflow: hidden; margin: 0; color: var(--ui-ink); font-size: 17px; font-weight: 800; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.card-text { margin: 6px 0 0; color: var(--ui-body); font-size: 13px; line-height: 1.55; }
.card-meta { margin-top: auto; padding-top: 16px; }

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  padding: 20px;
  box-shadow: var(--ui-shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.stat-card:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); }
.stat-icon { display: grid; width: 42px; height: 42px; flex-shrink: 0; place-items: center; border-radius: 12px; background: var(--ui-primary-soft); color: var(--ui-primary); font-weight: 800; }
.stat-label { display: block; color: var(--ui-muted); font-size: 13px; font-weight: 700; }
.stat-value { display: block; margin-top: 6px; color: var(--ui-ink); font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: 28px; font-weight: 600; line-height: 1; }
.stat-caption { display: block; margin-top: 10px; overflow: hidden; color: var(--ui-muted); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.task-card {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  color: inherit;
  text-decoration: none;
  padding: 18px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.task-card:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); }

.word-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 24px;
  align-items: center;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  padding: 24px;
}
.word-hero-title {
  margin: 14px 0 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 38px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.word-hero-subtitle { margin: 8px 0 0; color: var(--ui-muted); font-size: 16px; font-weight: 700; }
.word-hero-meaning { margin: 10px 0 0; color: var(--ui-body); font-size: 15px; line-height: 1.6; }
.word-hero-phrase {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 14px;
  border: 1px solid #d7eae5;
  border-radius: 12px;
  background: #f2fbf8;
  padding: 10px 12px;
}
.word-hero-phrase span {
  flex-shrink: 0;
  color: #5b8c85;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}
.word-hero-phrase strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.word-hero-phrase small {
  min-width: 0;
  overflow: hidden;
  color: #687d79;
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.word-hero-actions {
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 10px;
}
.word-hero-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed var(--ui-line);
}
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
  color: var(--ui-body);
  padding: 6px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.quiet-button:hover { border-color: #a9d8d0; background: var(--ui-surface-muted); color: var(--ui-ink); }
.quiet-button.danger { color: var(--ui-danger); }
.quiet-button.danger:hover { border-color: #f0b7b7; background: var(--ui-danger-bg); }
.workbench {
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}
.workbench-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-muted);
  padding: 12px;
}
.workbench-tab {
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ui-muted);
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  transition: all .18s ease;
}
.workbench-tab strong { color: inherit; font-size: 16px; font-weight: 800; }
.workbench-tab small { color: inherit; font-size: 12px; font-weight: 700; }
.workbench-tab:hover { border-color: var(--ui-line); color: var(--ui-ink); }
.workbench-tab.active {
  border-color: #a9d8d0;
  background: var(--ui-surface);
  color: var(--ui-primary);
  box-shadow: var(--ui-shadow-sm);
}
.workbench-panel { padding: 20px 24px 24px; }
.workbench-panel[hidden] { display: none !important; }
.step-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.step-rail[data-rail="scene"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.step-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-muted);
  color: var(--ui-muted);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: all .18s ease;
}
.step-index {
  display: grid;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 999px;
  background: #e3eeeb;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 800;
}
.step-copy { min-width: 0; }
.step-copy strong { display: block; overflow: hidden; color: inherit; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.step-copy small { display: block; overflow: hidden; color: var(--ui-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.step-state {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  margin-left: auto;
  border-radius: 999px;
  background: #d7e2e0;
}
.step-state.done { background: var(--ui-success); }
.step-tab:hover { border-color: #a9d8d0; color: var(--ui-ink); }
.step-tab.active {
  border-color: var(--ui-primary);
  background: #edfaf7;
  color: var(--ui-primary);
}
.step-tab.active .step-index { background: var(--ui-primary); color: #fff; }
.step-stage { min-height: 320px; }
.step-card { display: none; }
.step-card.active {
  display: block;
  animation: fade-in-up .25s cubic-bezier(.22, 1, .36, 1);
}
.step-card {
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface-muted);
  padding: 22px;
  box-shadow: var(--ui-shadow-sm);
}
.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.step-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.step-head p { margin: 5px 0 0; color: var(--ui-muted); font-size: 12.5px; line-height: 1.5; }
.step-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px solid var(--ui-line);
  padding-top: 16px;
}
.step-footer .ghost-button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
  color: var(--ui-body);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}
.step-footer .ghost-button:hover:not(:disabled) { border-color: #a9d8d0; color: var(--ui-ink); }
.step-footer-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
  flex-wrap: wrap;
}
.step-tools { display: flex; justify-content: flex-end; }
.video-action-row { display: flex; justify-content: flex-end; }
.step-instruction input { background: #f8fbfa; }
.step-form .field-label { color: var(--ui-ink); }
.prompt-preview {
  width: min(320px, 100%);
  margin: 18px auto 0;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  box-shadow: var(--ui-shadow-sm);
  text-align: center;
}
.prompt-preview img {
  display: block;
  width: 100%;
  aspect-ratio:3/4;
  border-radius: 11px;
  object-fit: cover;
}
.prompt-preview figcaption {
  margin-top: 8px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
}
.word-task-list { display: grid; gap: 12px; }
.word-task {
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-muted);
  padding: 14px;
}
.word-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.word-task-title { margin: 0; font-size: 15px; font-weight: 800; }
.word-task-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 0; color: var(--ui-muted); font-size: 12px; font-weight: 700; }
.word-task-error { margin: 10px 0 0; color: var(--ui-danger); font-size: 13px; line-height: 1.5; }

.video-stage {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.video-frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
}
.video-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #061b1f;
}
.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio:3/4;
  object-fit: cover;
  background: #061b1f;
}
.video-frame.tall video {
  max-width: min(300px, 100%);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}
.video-frame.wide video {
  aspect-ratio: 16 / 9;
}
.video-frame figcaption {
  padding: 9px 12px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
}
.video-frame-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  gap: 10px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 800;
  padding: 20px;
}
.video-form {
  display: grid;
  gap: 18px;
}
.video-form textarea.input {
  width: 100%;
  line-height: 1.65;
  resize: vertical;
}
.video-story-textarea {
  min-height: 168px;
}
.video-prompt-textarea {
  min-height: 320px;
}
.video-substep {
  border-top: 1px solid var(--ui-line);
  padding-top: 16px;
}
.video-form .video-substep:first-child {
  border-top: 0;
  padding-top: 0;
}
.video-substep header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.video-substep header span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--ui-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.video-substep h4 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 15px;
  font-weight: 900;
}
.video-substep p {
  margin: 2px 0 0;
  color: var(--ui-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.ai-result {
  display: grid;
  gap: 6px;
  border: 1px solid #cdeae2;
  border-radius: 14px;
  background: #f2fbf8;
  padding: 13px;
}
.ai-result strong {
  color: var(--ui-ink);
  font-size: 14px;
  line-height: 1.55;
}
.ai-result small {
  color: #476b65;
  font-size: 12.5px;
  line-height: 1.5;
}
.storyboard-list {
  display: grid;
  gap: 9px;
}
.storyboard-shot {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: var(--ui-surface);
  padding: 11px;
}
.shot-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #e9f3f1;
  color: var(--ui-primary);
  font-size: 13px;
  font-weight: 900;
}
.storyboard-shot strong {
  display: block;
  color: var(--ui-ink);
  font-size: 13.5px;
  line-height: 1.45;
}
.storyboard-shot small {
  display: block;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.45;
}
.storyboard-shot small span {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef6f4;
  color: #486963;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}
.storyboard-shot .shot-prompt span {
  background: #fff2d9;
  color: #8a5a00;
}
.storyboard-shot .shot-subtitle span {
  background: #e7f2ff;
  color: #215a8f;
}
.storyboard-shot .shot-dialogue span {
  background: #ece9ff;
  color: #5145a4;
}
.storyboard-shot .shot-voice span {
  background: #ffeaf1;
  color: #a03b64;
}
.video-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.video-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgb(15 118 110 / .2);
  border-top-color: var(--ui-primary);
  border-radius: 999px;
  animation: video-spin 1s linear infinite;
}
@keyframes video-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .word-hero { align-items: stretch; grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .word-hero-title { font-size: 32px; }
  .word-hero-phrase { align-items: flex-start; flex-wrap: wrap; row-gap: 5px; }
  .word-hero-phrase strong { width: 100%; white-space: normal; }
  .word-hero-phrase small { width: 100%; white-space: normal; }
  .word-hero-actions { justify-items: stretch; }
  .word-hero-actions .primary-button,
  .word-hero-actions .secondary-button { width: 100%; }
  .word-hero-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .word-task { padding: 13px; }
  .workbench-tabs { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px; }
  .workbench-panel { padding: 14px; }
  .step-rail,
  .step-rail[data-rail="scene"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .video-stage { grid-template-columns: minmax(0, 1fr); }
  .video-frame,
  .video-frame.tall { max-width: 340px; margin: 0 auto; width: 100%; }
  .video-options { grid-template-columns: 1fr; }
  .step-card { padding: 18px; }
  .step-footer { align-items: stretch; flex-direction: column; gap: 10px; }
  .step-footer .ghost-button { width: 100%; }
  .step-footer-main { margin-left: 0; width: 100%; }
  .step-footer-main .primary-button,
  .step-footer-main .secondary-button { flex: 1 1 calc(50% - 5px); }
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed #c7dad6;
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  padding: 40px 24px;
  text-align: center;
}
.empty-title { margin: 0; color: var(--ui-ink); font-size: 17px; font-weight: 800; }
.empty-desc { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.6; }
.empty-media { display: grid; place-items: center; width: 100%; height: 100%; background-color: #f7faf9; }
.empty-media::before { content: ""; width: 42px; height: 42px; background-color: #9db2af; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h14v16H5zM8 9h8M8 13h5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h14v16H5zM8 9h8M8 13h5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }

.data-tile {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-muted);
  padding: 16px;
}
.data-card {
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-muted);
  padding: 18px;
}
.picker-list {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-muted);
  padding: 10px;
  color: var(--ui-muted);
  font-size: 13px;
}
.picker-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
}
.picker-list input[type="checkbox"] { accent-color: var(--ui-primary); }
.text-success { color: var(--ui-success); }
.text-danger { color: var(--ui-danger); }
.text-muted { color: var(--ui-muted); }

.auth-shell {
  display: grid;
  min-height: 100dvh;
  background: var(--ui-canvas);
}
.auth-side {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background:
    radial-gradient(circle at 80% 10%, rgb(15 118 110 / .12), transparent 34%),
    radial-gradient(circle at 20% 90%, rgb(249 115 22 / .08), transparent 36%),
    var(--ui-surface);
  border-right: 1px solid var(--ui-line);
  padding: 40px;
}
.auth-title { margin: 0; color: var(--ui-ink); font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: clamp(34px, 4vw, 50px); font-weight: 600; line-height: 1.08; }
.auth-copy { margin: 20px 0 0; max-width: 32rem; color: var(--ui-body); font-size: 16px; line-height: 1.7; }
.auth-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.auth-panel { display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(100%, 420px);
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-hover);
  padding: 28px 24px;
}
.auth-switch { margin: 24px 0 0; color: var(--ui-muted); font-size: 13px; text-align: center; }
.auth-switch a { color: var(--ui-primary); font-weight: 800; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
@media (min-width: 900px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
  .auth-side { display: flex; }
  .auth-panel { padding: 40px; }
  .auth-card { padding: 32px; }
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 800;
}
.breadcrumb a { color: var(--ui-muted); text-decoration: none; transition: color .2s ease; }
.breadcrumb a:hover { color: var(--ui-primary); }
.breadcrumb [aria-current] { overflow: hidden; color: var(--ui-ink); max-width: min(58vw, 360px); text-overflow: ellipsis; white-space: nowrap; }

.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.unit-search { width: min(100%, 300px); }
.unit-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .unit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .unit-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .unit-grid { grid-template-columns: repeat(4, 1fr); } }
.unit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  color: inherit;
  padding: 14px;
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.unit-card:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); transform: translateY(-1px); }
.unit-card-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.unit-index {
  display: grid;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 12px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.unit-title { overflow: hidden; margin: 0; color: var(--ui-ink); font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.unit-help { overflow: hidden; margin: 3px 0 0; color: var(--ui-muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.unit-empty { display: grid; justify-items: center; margin: 18px 0 0; color: var(--ui-muted); font-size: 13px; font-weight: 700; }
.panel-collapse { overflow: hidden; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.panel-collapse > summary {
  display: flex;
  align-items: center;
  min-height: 58px;
  cursor: pointer;
  padding: 14px 20px;
  color: var(--ui-ink);
  font-size: 15px;
  font-weight: 800;
  list-style: none;
}
.panel-collapse > summary::-webkit-details-marker { display: none; }
.panel-collapse > summary::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: auto;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s ease;
}
.panel-collapse[open] > summary::after { transform: rotate(180deg); }
.panel-collapse > summary ~ * { padding-left: 20px; padding-right: 20px; }
.panel-collapse > summary + * { padding-top: 20px; }
.panel-collapse > summary ~ :last-child { padding-bottom: 20px; }
.panel-collapse.panel-lg > summary ~ * { padding-left: 24px; padding-right: 24px; }
.panel-collapse.panel-lg > summary + * { padding-top: 24px; }
.panel-collapse.panel-lg > summary ~ :last-child { padding-bottom: 24px; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-link { border-color: var(--ui-line); background: var(--ui-surface); color: var(--ui-body); }
.filter-link.active { border-color: #a9d8d0; background: var(--ui-primary-soft); color: var(--ui-primary); }
.style-preset {
  min-height: 38px;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
}
.style-preset.active {
  border-color: #7ac0b4;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  box-shadow: 0 0 0 3px rgb(15 118 110 / .08);
}
.page-actions .input { min-height: 44px; }

.course-topbar {
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.course-topbar-title {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  min-width: 0;
}
.course-title-block { min-width: min(100%, 280px); }
.course-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--ui-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.course-topbar-title .page-title {
  margin: 0;
  line-height: 1.1;
}
.course-title-desc {
  margin: 7px 0 0;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 700;
}
.course-title-stats {
  display: flex;
  gap: 8px;
  padding-bottom: 3px;
}
.course-title-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid #dcedd8;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgb(16 32 38 / .04);
  color: var(--ui-muted);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 850;
}
.course-title-stats strong {
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 15px;
  line-height: 1;
}
.course-topbar-actions button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.course-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.course-nav-panel {
  overflow: hidden;
  border: 1px solid #dfeeeb;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #fbfefd 100%);
  box-shadow: var(--ui-shadow);
  padding: 8px 24px 18px;
}
.course-nav-path {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid #edf5f3;
  margin: 4px 0 2px;
  padding: 10px 0 12px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 800;
}
.course-nav-path a {
  color: var(--ui-muted);
  text-decoration: none;
}
.course-nav-path a:hover {
  color: var(--ui-primary);
}
.course-nav-path i {
  width: 12px;
  height: 1px;
  background: #b9d3cd;
}
.course-nav-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px 20px;
  align-items: start;
  border-bottom: 1px solid #f0f7f5;
  padding: 14px 0 15px;
}
.course-nav-row:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.course-nav-label {
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 36px;
  white-space: nowrap;
}
.course-nav-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.course-nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid #e2efec;
  border-radius: 999px;
  background: #f7fbfa;
  color: var(--ui-body);
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.course-nav-chip:hover {
  border-color: #9fd0c7;
  background: #fff;
  color: var(--ui-ink);
}
.course-nav-chip small {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
}
.course-nav-chip.active {
  border-color: #94cfc4;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  box-shadow: 0 8px 20px rgb(15 118 110 / .07);
}
.course-nav-chip.active small {
  color: var(--ui-primary);
}

.category-manage-panel {
  display: grid;
  gap: 16px;
  border: 1px solid #e5f1ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #f9fdfc, #fff);
  box-shadow: inset 0 1px 0 #fff;
  margin-top: 14px;
  padding: 18px;
}
.category-manage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.category-manage-head h2 {
  margin: 0;
  font-size: 17px;
}
.category-manage-head p {
  margin: 4px 0 0;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 700;
}
.category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.category-create-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.category-create-form .field { margin: 0; }
.category-create-form .btn {
  min-height: 44px;
  white-space: nowrap;
}
.category-create-help {
  margin: -8px 0 0;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 700;
}
.category-create-foot {
  display: grid;
  gap: 8px;
}
.category-create-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: var(--ui-body);
  font-size: 12px;
  font-weight: 800;
}
.category-status {
  display: flex;
  align-items: center;
  min-height: 22px;
  margin: 0;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
}
.category-status.success { color: var(--ui-success); }
.category-status.error { color: var(--ui-danger); }
.category-status.loading { color: var(--ui-primary); }
.category-manage-current {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
  border-top: 1px solid #e5f1ee;
  padding-top: 14px;
}
.category-manage-current > div span {
  display: block;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 850;
}
.category-manage-current > div strong {
  display: block;
  margin-top: 3px;
  color: var(--ui-ink);
  font-size: 15px;
}
.category-actions-horizontal {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.category-actions-horizontal .category-form {
  min-width: min(100%, 340px);
}

.course-list-section {
  margin-top: 24px;
}
.course-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.course-list-head .section-description {
  margin: 5px 0 0;
}
.course-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 20px;
}

.media-card.course-card {
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgb(16 32 38 / .06);
}

.media-card.course-card:hover {
  box-shadow: 0 20px 44px rgb(16 32 38 / .10);
}

.course-card-media {
  aspect-ratio:3/4;
}
.course-card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46px;
  background: linear-gradient(180deg, transparent, rgb(16 32 38 / .07));
  pointer-events: none;
}
.course-cover-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    radial-gradient(circle at 22% 18%, rgb(20 184 166 / .14), transparent 32%),
    linear-gradient(145deg, #eaf6f3, #dceeea 48%, #f8fbfa);
}
.course-cover-fallback span {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 4px solid rgb(255 255 255 / .72);
  border-radius: 24px;
  background: rgb(255 255 255 / .38);
  color: var(--ui-primary);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 16px 32px rgb(15 118 110 / .10);
}
.course-card-path {
  overflow: hidden;
  min-width: 0;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.course-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.course-card-count {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 25px;
  border-radius: 999px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
}
.course-card .card-title {
  overflow: hidden;
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.course-card-words {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 850;
}
.course-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
.course-card-actions .primary-button,
.course-card-actions .secondary-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.course-hero {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  border: 1px solid #e2eeeb;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff, #f8fdfb);
  box-shadow: var(--ui-shadow);
  padding: 22px;
}
.course-hero-cover {
  overflow: hidden;
  aspect-ratio:3/4;
  border-radius: 18px;
  background: #eaf4f1;
  box-shadow: 0 18px 40px rgb(15 118 110 / .10);
}
.course-hero-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-hero-cover .course-cover-fallback span {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border-width: 3px;
  font-size: 25px;
}
.course-hero-body {
  min-width: 0;
}
.course-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.course-hero-title {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
}
.course-hero-desc {
  max-width: 900px;
  margin: 9px 0 0;
  color: var(--ui-body);
  font-size: 14px;
  line-height: 1.7;
}
.course-hero-stats {
  display: flex;
  align-items: center;
  gap: 10px 24px;
  flex-wrap: wrap;
  border-top: 1px solid #eaf3f1;
  margin-top: 18px;
  padding-top: 16px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 800;
}
.course-hero-stats strong {
  margin-right: 5px;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.course-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.chapter-section {
  margin-top: 26px;
}
.chapter-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chapter-section-head .section-description {
  margin: 5px 0 0;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.chapter-card {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid #e2eeeb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(16 32 38 / .05);
  color: inherit;
  padding: 16px;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.chapter-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ui-shadow-hover);
  transform: translateY(-2px);
}
.chapter-card.is-complete {
  border-color: #bfe0d9;
  background: linear-gradient(145deg, #fff, #f5fbf9);
}
.chapter-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.chapter-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.chapter-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
}
.chapter-index {
  color: #9db2ae;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 13px;
  font-weight: 650;
}

.hierarchy-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8ece7;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  color: var(--ui-primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.course-cover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgb(10 18 30 / .48);
  padding: 18px;
  backdrop-filter: blur(6px);
}
.course-cover-modal {
  width: min(100%, 680px);
  max-height: min(92dvh, 760px);
  overflow: auto;
  border: 1px solid #e4efec;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgb(9 60 54 / .24);
  padding: 22px;
}
.course-cover-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.course-cover-modal-head h2 {
  margin: 10px 0 0;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 22px;
  line-height: 1.25;
}
.course-cover-modal-sub {
  margin: 7px 0 0;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.6;
}
.course-cover-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.course-cover-modal-foot > span {
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 750;
}
.course-cover-modal-foot > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e5edeb; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12857a, #0f766e); transition: width .4s ease; }

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-body);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { border-color: #a9d8d0; background: var(--ui-primary-soft); color: var(--ui-primary); }

.voice-button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; border: 0; border-radius: var(--ui-radius-sm); background: var(--ui-primary-soft); color: var(--ui-primary); padding: 8px 12px; font-weight: 800; font-size: 13px; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.voice-button:hover { background: #d5efe9; }

#toast { border: 1px solid rgb(255 255 255 / .08); border-radius: 14px; font-size: 13px; font-weight: 800; }

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

/* Global interaction feedback */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #14b8a6 55%, #f59e0b);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
}

.route-progress.is-active {
  opacity: 1;
  transform: scaleX(.72);
  animation: route-progress-glide 1.4s ease-in-out infinite;
}

@keyframes route-progress-glide {
  0% { transform: scaleX(.12); transform-origin: left center; }
  55% { transform: scaleX(.78); transform-origin: left center; }
  100% { transform: scaleX(.94); transform-origin: left center; }
}

.app-toast {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(calc(100vw - 32px), 480px);
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 16px;
  background: #0d1a18;
  color: #f8fafc;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  box-shadow: 0 24px 60px rgb(4 20 17 / .28);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -12px) scale(.98);
  transition: opacity .22s ease, transform .22s cubic-bezier(.22, 1, .36, 1), visibility .22s;
  pointer-events: none;
}

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

.app-toast svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-toast[data-type="success"] { background: #0d5b4d; }
.app-toast[data-type="error"] { background: #a32222; }

.button-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: .92;
  animation: button-spin .75s linear infinite;
}

@keyframes button-spin { to { transform: rotate(360deg); } }

.btn[aria-busy="true"],
.primary-button[aria-busy="true"],
.secondary-button[aria-busy="true"],
.danger-button[aria-busy="true"] {
  opacity: .82;
  cursor: progress;
}

.nav-link.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--ui-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui-primary);
}

body[aria-busy="true"] {
  cursor: progress;
}

.boot-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.boot-card {
  width: min(100%, 360px);
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  background: #fff;
  padding: 26px;
  box-shadow: var(--ui-shadow);
}

.boot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.boot-title {
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.boot-lines {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.boot-lines i {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e6eeec 25%, #f4faf8 45%, #e6eeec 65%);
  background-size: 300% 100%;
  animation: skeleton-move 1.2s ease infinite;
}

.boot-lines i:nth-child(2) { width: 78%; animation-delay: .08s; }
.boot-lines i:nth-child(3) { width: 52%; animation-delay: .16s; }
.boot-note {
  margin: 22px 0 0;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-menu-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1024px) {
  .course-topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .course-topbar-actions { width: 100%; }
  .course-title-stats { flex-wrap: wrap; }
  .course-nav-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .course-nav-chips { width: 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .course-nav-chips::-webkit-scrollbar { display: none; }
  .category-manage-panel { padding: 16px; }
  .category-create-form { grid-template-columns: 1fr 1fr; }
  .category-create-form .btn { width: 100%; }
  .category-manage-current { grid-template-columns: 1fr; align-items: stretch; }
  .category-manage-current .btn { width: 100%; }
  .course-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-hero { grid-template-columns: 116px minmax(0, 1fr); }
  .course-hero-cover { aspect-ratio:3/4; }
}

@media (max-width: 640px) {
  .course-topbar-actions .secondary-button,
  .course-topbar-actions .primary-button { flex: 1 1 auto; }
  .course-nav-path { padding: 10px 12px; }
  .course-nav-path a { max-width: 46vw; }
  .course-nav-row-label { width: auto; }
  .course-nav-chips { gap: 8px; }
  .category-manage-panel { padding: 14px; }
  .category-create-form { grid-template-columns: 1fr; }
  .category-create-form button { width: 100%; }
  .category-manage-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .category-manage-current { gap: 10px; }
  .category-manage-actions { align-items: stretch; flex-direction: column; }
  .category-manage-actions button { width: 100%; }
  .course-card-grid { grid-template-columns: 1fr; }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero-cover { max-width: 170px; }
  .course-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-hero-actions { align-items: stretch; flex-direction: column; }
  .course-hero-actions .secondary-button,
  .course-hero-actions .primary-button { justify-content: center; width: 100%; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-card-top { align-items: flex-start; flex-direction: column; gap: 8px; }
  .chapter-card-foot { align-items: flex-start; flex-direction: column; }
  .course-card-meta,
  .course-card-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .course-card-head { align-items: flex-start; }
  .course-card-actions .primary-button,
  .course-card-actions .secondary-button { flex: 1 1 auto; }
  .course-cover-backdrop { padding: 12px; }
  .course-cover-modal { border-radius: 18px; padding: 18px; }
  .course-cover-modal-head { align-items: center; margin-bottom: 16px; }
  .course-cover-modal-foot { align-items: stretch; flex-direction: column; }
  .course-cover-modal-foot > div { width: 100%; }
  .course-cover-modal-foot > div button { flex: 1 1 auto; }
}

/* 响应式 */
@media (max-width: 640px) {
  .prac-wood-main { font-size: 18px; padding: 6px 20px; }
  .prac-main-inner { padding: 14px; gap: 10px; }
  .prac-meaning-text { font-size: 18px; }
  .prac-input { font-size: 16px; padding: 12px 14px 12px 40px; }
  .prac-btn { padding: 12px 18px; font-size: 15px; border-radius: 16px; }
  .prac-card-grid { grid-template-columns: 1fr; }
  .prac-bottom-decor { display: none; }
  .prac-tree { display: none; }
  .prac-filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .prac-select-sm { flex-shrink: 0; }
}

@media (max-width: 640px) {
  .home-hero-media { min-height: 260px; }
  .learning-heatmap-head { flex-direction: column; }
  .heatmap-badges { width: 100%; justify-content: flex-start; }
  .heatmap-body { gap: .45rem; }
  .heatmap-grid { grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 2px; }
  .heatmap-cell { width: 12px; height: 12px; }
  .heatmap-week-labels { grid-template-rows: repeat(7, 12px); line-height: 12px; }
}

/* Admin console */
body.admin-mode #app { max-width: none; }
.admin-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; background: #f4f6f8; color: #172033; }
.admin-sidebar {
  position: sticky; top: 0; z-index: 30; display: flex; height: 100dvh; flex-direction: column; gap: 20px;
  border-right: 1px solid #253350; background: #101a2c; padding: 22px 16px; color: #dbe2f0;
}
.admin-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 800; line-height: 1.2; }
.admin-brand span:first-child {
  display: grid; width: 40px; height: 40px; flex-shrink: 0; place-items: center; border-radius: 12px;
  background: #4f46e5; color: #fff; font-size: 20px; font-weight: 900; box-shadow: 0 10px 24px rgb(79 70 229 / .28);
}
.admin-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; overflow: auto; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; border-radius: 10px; padding: 10px 12px;
  color: #c2cbdd; font-size: 14px; font-weight: 800; text-decoration: none; transition: background-color .18s, color .18s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgb(255 255 255 / .08); color: #fff; }
.admin-nav a.active { box-shadow: inset 3px 0 0 #8b8ffa; }
.admin-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-side-foot { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / .08); }
.admin-return, .admin-exit {
  display: flex; align-items: center; justify-content: center; min-height: 38px; border: 0; border-radius: 9px;
  background: rgb(255 255 255 / .08); color: #e8ecf5; font-weight: 800; font-size: 13px; text-decoration: none; cursor: pointer;
}
.admin-exit:hover, .admin-return:hover { background: rgb(255 255 255 / .14); }
.admin-content { min-width: 0; }
.admin-topbar {
  position: sticky; top: 0; z-index: 25; display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid #dfe4ec; background: rgb(255 255 255 / .94); padding: 14px 24px; backdrop-filter: blur(12px);
}
.admin-topbar > div:first-child { display: flex; align-items: center; gap: 12px; }
.admin-topbar strong { font-size: 17px; font-weight: 900; }
.admin-user { display: grid; text-align: right; font-size: 13px; font-weight: 900; }
.admin-user span { color: #667389; font-size: 11px; font-weight: 800; }
.admin-menu-button { display: none; width: 40px; height: 40px; border: 1px solid #d8dde7; border-radius: 10px; background: #fff; color: #172033; font-size: 18px; }
.admin-mobile-menu {
  position: absolute; z-index: 35; right: 12px; left: 12px; overflow: auto; border: 1px solid #d8dee8; border-radius: 14px;
  background: #fff; box-shadow: 0 20px 50px rgb(16 26 44 / .18); padding: 10px;
}
.admin-mobile-menu a { display: flex; min-height: 44px; align-items: center; border-radius: 9px; padding: 0 12px; color: #2b3648; font-weight: 800; text-decoration: none; }
.admin-mobile-menu a.active { background: #e9e8ff; color: #3730a3; }
.admin-main { padding: 28px; }
.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-page-head h1 { margin: 0; font-family: 'Baloo 2', 'Fredoka', sans-serif; font-size: 26px; font-weight: 600; }
.admin-page-head p { margin: 6px 0 0; color: #64748b; font-size: 13px; font-weight: 800; }
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.admin-stats article {
  border: 1px solid #dfe5ee; border-radius: 14px; background: #fff; padding: 18px;
  box-shadow: 0 8px 24px rgb(15 26 44 / .05);
}
.admin-stats span { color: #667389; font-size: 12px; font-weight: 900; }
.admin-stats strong { display: block; margin-top: 8px; font-size: 27px; line-height: 1; }
.admin-stats small { display: block; margin-top: 10px; color: #7a8698; font-size: 12px; font-weight: 700; }
.admin-panel { overflow: hidden; border: 1px solid #dfe5ee; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgb(15 26 44 / .05); margin-bottom: 20px; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.admin-panel h2 { margin: 0; font-size: 17px; font-weight: 900; }
.admin-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; margin-bottom: 18px; }
.admin-input { width: 100%; min-height: 40px; border: 1px solid #d8dfe9; border-radius: 9px; background: #fff; padding: 9px 11px; font: inherit; font-size: 14px; }
.admin-input:focus { border-color: #8b8ffa; outline: 3px solid rgb(79 70 229 / .12); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid #edf0f5; padding: 14px 16px; font-size: 13px; text-align: left; vertical-align: middle; }
.admin-table th { white-space: nowrap; background: #f8fafc; color: #667389; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.admin-table td strong { display: block; color: #172033; font-size: 14px; }
.admin-table td small { display: block; overflow: hidden; max-width: 280px; color: #68758a; text-overflow: ellipsis; white-space: nowrap; }
.admin-chip { display: inline-flex; min-height: 24px; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 900; }
.admin-chip.success { background: #dff7ea; color: #157347; }
.admin-chip.warning { background: #fff3d6; color: #a16207; }
.admin-chip.info { background: #e8f0ff; color: #2457d6; }
.admin-chip.danger { background: #ffe8e8; color: #c02b2b; }
.admin-chip.muted { background: #eef1f5; color: #63707f; }
.admin-actions { display: flex; justify-content: flex-end; gap: 6px; }
.admin-action { min-height: 32px; border: 1px solid #d8dfe9; border-radius: 8px; background: #fff; color: #37455a; padding: 5px 10px; font-size: 12px; font-weight: 900; cursor: pointer; }
.admin-action:hover { border-color: #8b8ffa; color: #3730a3; }
.admin-action.danger { color: #c02b2b; }
.admin-action.danger:hover { border-color: #f3a6a6; background: #fff5f5; }
.admin-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 16px; color: #63707f; font-size: 13px; font-weight: 800; }
.admin-page { min-width: 68px; border: 1px solid #d8dfe9; border-radius: 8px; background: #fff; color: #37455a; padding: 7px 10px; text-align: center; text-decoration: none; }
.admin-page.current, .admin-page:hover { border-color: #8b8ffa; color: #3730a3; }
.admin-page.disabled { opacity: .45; pointer-events: none; }
.admin-modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgb(10 18 30 / .52); backdrop-filter: blur(5px); }
.admin-modal { width: min(100%, 620px); max-height: 90dvh; overflow: auto; border-radius: 16px; background: #fff; padding: 22px; }
.admin-modal h2 { margin: 0 0 18px; font-size: 19px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form-grid label { display: grid; gap: 7px; color: #4b5769; font-size: 12px; font-weight: 900; }
.admin-form-grid .span-2 { grid-column: 1 / -1; }
.admin-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.admin-settings-body { padding: 14px 20px 20px; }
.admin-provider-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-provider-option { position: relative; display: grid; gap: 5px; align-content: start; border: 1px solid #dce3ec; border-radius: 12px; background: #fbfcfe; padding: 15px; cursor: pointer; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.admin-provider-option:hover { border-color: #8b8ffa; background: #fff; }
.admin-provider-option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.admin-provider-option span { color: #18213a; font-size: 15px; font-weight: 900; }
.admin-provider-option small { color: #66738a; font-size: 12px; font-weight: 750; line-height: 1.5; }
.admin-provider-option.active { border-color: #7048f8; background: #fff; box-shadow: 0 0 0 3px rgb(112 72 248 / .11); }
.admin-provider-option.active span { color: #4c2bd4; }
.admin-settings-help { margin: 14px 0 0; color: #64748b; font-size: 12px; font-weight: 700; }
.admin-settings-actions { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.admin-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; padding: 18px; }
.admin-asset-grid article { display: grid; gap: 8px; align-content: start; border: 1px solid #e2e7ef; border-radius: 12px; overflow: hidden; background: #fff; }
.admin-asset-thumb { aspect-ratio:3/4; background: #f3f5f8; }
.admin-asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-asset-grid strong, .admin-asset-grid small { padding: 0 12px; font-size: 13px; }
.admin-asset-grid small { overflow: hidden; color: #64748b; text-overflow: ellipsis; white-space: nowrap; }
.admin-asset-grid .admin-action { margin: 4px 12px 12px; width: calc(100% - 24px); }
.admin-denied { display: grid; min-height: 50dvh; place-items: center; text-align: center; }
.admin-denied h1 { margin: 0 0 8px; }
.admin-denied p { margin: 0 0 20px; color: #64748b; }
@media (min-width: 901px) { .admin-mobile-menu { display: none; } }
@media (max-width: 900px) {
  .admin-shell { display: block; }
  .admin-sidebar { display: none; }
  .admin-topbar { padding: 12px 14px; }
  .admin-menu-button { display: grid; place-items: center; }
  .admin-mobile-menu { position: fixed; top: 68px; }
  .admin-main { padding: 16px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-toolbar { grid-template-columns: 1fr 1fr; }
  .admin-toolbar button { grid-column: 1 / -1; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-provider-switch { grid-template-columns: 1fr; }
  .admin-table th, .admin-table td { padding: 12px; }
  .admin-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .admin-stats, .admin-toolbar, .admin-form-grid { grid-template-columns: 1fr; }
  .admin-page-head { align-items: flex-start; flex-direction: column; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border-bottom: 1px solid #edf0f5; }
  .admin-table td { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
  .admin-table td::before { color: #667389; content: attr(data-label); flex-shrink: 0; font-size: 11px; font-weight: 900; }
  .admin-table td strong { max-width: 58vw; }
}
.practice-wrongbook {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgb(244 63 94 / .38);
  border-radius: 999px;
  background: rgb(244 63 94 / .10);
  padding: 0 14px;
  color: #fda4af;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: .18s ease;
}
.practice-wrongbook:hover, .practice-wrongbook.active {
  border-color: rgb(244 63 94 / .75);
  background: rgb(244 63 94 / .22);
  color: #fff;
}
.practice-wrongbook span:last-child {
  min-width: 22px;
  border-radius: 999px;
  background: rgb(255 255 255 / .14);
  padding: 2px 6px;
  text-align: center;
}
.picture-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
.picture-choice {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 4px;
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: 18px;
  background: rgb(255 255 255 / .07);
  padding: 12px 14px;
  color: #fff;
  cursor: pointer;
  transition: .18s ease;
}
.picture-choice:hover:not(:disabled) {
  border-color: rgb(45 212 191 / .55);
  background: rgb(45 212 191 / .12);
  transform: translateY(-1px);
}
.picture-choice.correct {
  border-color: rgb(52 211 153 / .8);
  background: rgb(16 185 129 / .18);
}
.picture-choice.wrong {
  border-color: rgb(251 113 133 / .8);
  background: rgb(244 63 94 / .16);
}
.picture-choice-word {
  font-size: 19px;
  font-weight: 900;
  text-transform: lowercase;
}
.picture-choice-meaning {
  overflow: hidden;
  color: rgb(226 232 240 / .72);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.storybook {
  min-height: calc(100dvh - 150px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  border: 1px solid #dfeee9;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / .92), rgb(242 251 247 / .94)),
    linear-gradient(90deg, #e9f5f0 1px, transparent 1px),
    linear-gradient(180deg, #e9f5f0 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  box-shadow: 0 22px 60px rgb(15 43 38 / .08);
  padding: 18px;
}
.storybook-top,
.storybook-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.storybook-top h1 {
  margin: 5px 0 0;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 700;
  line-height: 1.15;
}
.storybook-top p:last-child,
.storybook-kicker {
  margin: 6px 0 0;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 800;
}
.storybook-eyebrow {
  margin: 0;
  color: #12796d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.storybook-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid #d9ece6;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
  color: #3c5350;
  padding: 9px 16px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  transition: all .18s ease;
}
.storybook-back:hover { border-color: #a9d8d0; color: var(--ui-primary); transform: translateY(-1px); }
.storybook-stage { min-height: 0; }
.storybook-track {
  height: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.storybook-track::-webkit-scrollbar { display: none; }
.storybook-page {
  position: relative;
  min-height: 0;
  scroll-snap-align: center;
  display: grid;
  grid-template-rows: minmax(210px, 48%) minmax(0, 1fr);
  gap: 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 42px rgb(15 43 38 / .07);
  padding: 16px;
  transition: opacity .2s ease, transform .2s ease;
}
.storybook-page:not(.is-active) { opacity: .3; }
.storybook-media {
  position: relative;
  overflow: hidden;
  min-height: 0;
  margin: 0;
  border: 1px solid #e2efea;
  border-radius: 18px;
  background: #eaf4f1;
}
.storybook-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.storybook-media span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / .9);
  box-shadow: 0 6px 18px rgb(9 60 54 / .12);
  color: #26635b;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}
.storybook-content {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}
.storybook-title {
  overflow: hidden;
  margin: 0;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: clamp(21px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.2;
}
.storybook-copy {
  min-height: 0;
  overflow: auto;
  align-self: center;
  display: grid;
  gap: 12px;
  padding-right: 3px;
}
.storybook-text,
.storybook-chinese {
  margin: 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.storybook-text {
  color: #213a37;
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 750;
}
.storybook-chinese {
  border-top: 1px dashed #dcebe6;
  color: #66807c;
  font-size: clamp(14px, 1.3vw, 17px);
  font-weight: 650;
  padding-top: 12px;
}
.storybook-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid #edf5f2;
  padding-top: 12px;
}
.storybook-word {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #d9ece6;
  border-radius: 999px;
  background: #f4fbf8;
  color: #0b705f;
  padding: 7px 12px;
}
.storybook-word strong,
.storybook-word small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.storybook-word strong { font-size: 14px; font-weight: 900; }
.storybook-word small { color: #63807b; font-size: 12px; font-weight: 800; }
.storybook-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.storybook-actions .voice-button {
  border: 1px solid #dbebe6;
  background: #fff;
}
.storybook-nav {
  display: grid;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid #d9ece6;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
  color: #3c5350;
  cursor: pointer;
  transition: all .18s ease;
}
.storybook-nav:hover { border-color: #a9d8d0; background: #f5fbf9; color: var(--ui-primary); transform: translateY(-1px); }
.storybook-nav:disabled { opacity: .4; transform: none; cursor: not-allowed; }
.storybook-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.storybook-progress {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #dfeee9;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
  padding: 8px 15px;
}
.storybook-progress strong {
  color: #12796d;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.storybook-dots { display: flex; overflow: hidden; gap: 6px; }
.storybook-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #cfe5de;
  transition: all .2s ease;
}
.storybook-dot.active { background: var(--ui-primary); width: 21px; }
@media (min-width: 900px) {
  .storybook { min-height: calc(100dvh - 185px); padding: 22px; }
  .storybook-page {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    padding: 20px;
  }
  .storybook-page::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: calc(49% - 1px);
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, #dbeae5 18%, #dbeae5 82%, transparent);
  }
  .storybook-content { padding: 10px 16px 2px 8px; }
  .picture-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .storybook { min-height: calc(100dvh - 132px); gap: 12px; border-radius: 22px; padding: 12px; }
  .storybook-top { align-items: flex-start; flex-direction: column; }
  .storybook-back { min-height: 38px; }
  .storybook-page { grid-template-rows: minmax(190px, 42%) minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 18px; }
  .storybook-content { gap: 8px; padding: 2px; }
  .storybook-copy { gap: 9px; }
  .storybook-foot { align-items: stretch; flex-direction: column; }
  .storybook-word { justify-content: center; }
  .storybook-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storybook-actions .voice-button { justify-content: center; }
  .storybook-dock { gap: 8px; }
  .storybook-progress { flex: 1; justify-content: center; min-width: 0; }
}

/* === Dashboard === */
.dash-hero {
  border-radius: 24px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #2dd4bf 100%);
  color: #fff;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: "";
  position: absolute;
  right: -100px;
  top: -100px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.dash-hero::after {
  content: "";
  position: absolute;
  right: 60px;
  bottom: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.dash-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.dash-hero-text { flex: 1; min-width: 0; }
.dash-hero-hi {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  opacity: .85;
}
.dash-hero-hi strong { font-weight: 700; }
.dash-hero-title {
  margin: 0.5rem 0 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
}
.dash-hero-sub {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  opacity: .85;
}
.dash-hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.25rem;
  border-radius: 12px;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s ease;
  cursor: pointer;
  border: 0;
}
.dash-btn svg { width: 17px; height: 17px; }
.dash-btn-primary {
  background: #fff;
  color: #0f766e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.dash-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
}
.dash-btn-secondary {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
}
.dash-btn-secondary:hover {
  background: rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}
.dash-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}
.dash-stat {
  min-width: 140px;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px);
}
.dash-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: .8;
}
.dash-stat-value {
  display: block;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 0.35rem;
}
.dash-stat-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  opacity: .75;
  text-decoration: none;
  transition: opacity .15s ease;
}
.dash-stat-link:hover { opacity: 1; }

/* Section */
.dash-section { margin-top: 2.5rem; }
.dash-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-section-title {
  margin: 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
}
.dash-section-sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}
.dash-more-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0d9488;
  text-decoration: none;
  transition: gap .15s ease;
}
.dash-more-link:hover { color: #0f766e; }

/* Project cards */
.dash-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.dash-project-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 12px rgba(0, 0, 0, .04);
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid #e2e8f0;
}
.dash-project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
}
.dash-project-cover {
  position: relative;
  aspect-ratio:3/4;
  background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
  overflow: hidden;
}
.dash-project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.dash-project-card:hover .dash-project-cover img {
  transform: scale(1.05);
}
.dash-project-cover-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.dash-project-cover-empty svg {
  width: 64px;
  height: 64px;
}
.dash-project-overlay {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 800;
  color: #0f766e;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}
.dash-project-body {
  padding: 1.1rem 1.25rem 1.25rem;
}
.dash-project-title {
  margin: 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-project-style {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.dash-project-char {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}
.dash-project-progress { margin-top: 1rem; }
.dash-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}
.dash-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dd4bf, #0d9488);
  transition: width .5s ease;
}
.dash-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

/* Empty state */
.dash-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: 20px;
  background: #fff;
  border: 1px dashed #cbd5e1;
}
.dash-empty-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin: 0 auto;
  border: 1px solid #d8e9e4;
  border-radius: 22px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}
.dash-empty-icon svg { width: 36px; height: 36px; }
.dash-empty-title {
  margin: 1rem 0 0;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}
.dash-empty-desc {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

/* Skeleton */
.dash-skeleton { gap: 1.5rem; }
.dash-skeleton-hero {
  height: 220px;
  border-radius: 24px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.dash-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.dash-skeleton-card {
  height: 320px;
  border-radius: 20px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .dash-hero { padding: 1.5rem; }
  .dash-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-hero-stats {
    flex-direction: row;
    width: 100%;
    gap: 0.75rem;
  }
  .dash-stat { flex: 1; min-width: 0; padding: 0.75rem; }
  .dash-stat-value { font-size: 1.5rem; }
  .dash-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
}
@media (max-width: 480px) {
  .dash-project-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Interface polish pass
   Keep this at the end so it unifies the older component styles.
   ============================================================ */
:root {
  --ui-radius: 18px;
  --ui-radius-sm: 12px;
  --ui-shadow-sm: 0 1px 2px rgb(16 32 30 / .04);
  --ui-shadow: 0 1px 2px rgb(16 32 30 / .04), 0 14px 32px rgb(16 32 30 / .06);
  --ui-shadow-hover: 0 2px 4px rgb(16 32 30 / .05), 0 20px 46px rgb(16 32 30 / .1);
}

::selection {
  color: var(--ui-ink);
  background: #b9f0e4;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ui-ink);
  letter-spacing: 0;
}

/* Application frame */
.app-shell { max-width: 1560px; }
.app-sidebar {
  width: 248px;
  border-right-color: #dcebe8;
  background: #fff;
  padding: 22px 16px;
}
.brand { margin-bottom: 26px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #11997e, #0a665c);
  box-shadow: 0 10px 22px rgb(15 118 110 / .2);
}
.brand-title { font-size: 17px; font-weight: 700; }
.brand-subtitle { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.app-nav { gap: 5px; }
.nav-link {
  position: relative;
  min-height: 42px;
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13.5px;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-link:hover { background: #f2f8f6; color: var(--ui-ink); }
.nav-link.bg-teal-50 {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--ui-primary);
}
.user-card {
  border-color: #e4efec;
  background: #f7faf9;
  padding: 11px;
}
.user-avatar { border-radius: 11px; }
.app-main { padding: 18px; }

@media (min-width: 900px) {
  .app-main { padding: 34px 38px 42px; }
}

/* Page rhythm */
.page-header {
  align-items: flex-start;
  gap: 16px 24px;
  margin-bottom: 26px;
}
.page-title {
  font-size: clamp(25px, 3vw, 31px);
  font-weight: 700;
  line-height: 1.18;
}
.page-desc { color: var(--ui-body); font-size: 14px; line-height: 1.65; }
.section-title { font-size: 19px; font-weight: 800; }

/* Panels and forms */
.panel:not(.panel-collapse) {
  border-color: #e2eeeb;
  box-shadow: var(--ui-shadow);
}
.panel-tight { padding: 20px; }
.panel-lg { padding: clamp(20px, 2.6vw, 28px); }
.panel-title { font-size: 18px; }
.panel-head { gap: 14px 20px; }
.panel-subtitle { color: var(--ui-muted); font-size: 13px; }

.field-label { color: #3c5350; margin-bottom: 7px; }
.field-help { color: var(--ui-muted); }
.input, select.input, textarea.input {
  border-color: #dcebe8;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
  font-weight: 700;
}
.input:hover { border-color: #b9d8d1; }
.input:focus {
  border-color: #7ac0b4;
  box-shadow: 0 0 0 4px rgb(15 118 110 / .12);
}

.btn, .primary-button, .secondary-button, .danger-button {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 17px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}
.btn-primary, .primary-button {
  border: 0;
  background: linear-gradient(180deg, #118879 0%, var(--ui-primary) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgb(15 118 110 / .16);
}
.btn-primary:hover:not(:disabled), .primary-button:hover:not(:disabled) {
  background: linear-gradient(180deg, #0e7c6e 0%, var(--ui-primary-hover) 100%);
  box-shadow: 0 14px 28px rgb(15 118 110 / .2);
}
.btn-secondary, .secondary-button {
  border-color: #dbeae6;
  background: #fff;
  color: #3c5350;
  box-shadow: var(--ui-shadow-sm);
}
.btn-secondary:hover:not(:disabled), .secondary-button:hover:not(:disabled) {
  border-color: #a9d8d0;
  background: #f7fbfa;
  color: var(--ui-ink);
}
.btn-danger, .danger-button {
  border-color: #f2c4c4;
  background: #fff;
  color: var(--ui-danger);
}
.btn-danger:hover:not(:disabled), .danger-button:hover:not(:disabled) {
  background: var(--ui-danger-bg);
  border-color: #ecadad;
}
.btn-ghost, .ghost-button { color: var(--ui-muted); }
.filter-row { gap: 8px; }
.filter-link {
  border-radius: 999px;
  font-weight: 800;
}
.filter-link.active {
  border-color: #a9d8d0;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

/* Data cards */
.chip { border-radius: 999px; font-weight: 800; }
.media-card {
  border-color: #e2eeeb;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.media-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ui-shadow-hover);
}
.media-card-media { background: linear-gradient(145deg, #f8fbfa, #edf4f2); }
.card-body { padding: 17px 18px 18px; }
.card-title { font-size: 17px; font-weight: 800; }
.card-text { color: var(--ui-body); }

.data-tile {
  border-color: #e2eeeb;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
  padding: 17px;
}
.data-tile .stat-label { color: var(--ui-muted); }
.task-card {
  border-color: #e2eeeb;
  border-radius: 16px;
  box-shadow: var(--ui-shadow-sm);
  padding: 17px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.task-card:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); }
.unit-card {
  border-color: #e2eeeb;
  border-radius: 15px;
  box-shadow: var(--ui-shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.unit-card:hover { border-color: #a9d8d0; box-shadow: var(--ui-shadow-hover); }
.empty-state {
  border: 1px dashed #bfd9d3;
  border-radius: 18px;
  background: #fbfdfc;
  padding: 38px 24px;
}
.empty-title { color: var(--ui-ink); font-weight: 800; }
.picker-list { border-radius: 15px; background: #f7faf9; }
.picker-list label { border-radius: 11px; transition: background-color .18s ease; }
.picker-list label:hover { background: var(--ui-primary-soft); }

/* Dashboard */
.dash-hero {
  border: 1px solid #0a665c;
  border-radius: 26px;
  background:
    linear-gradient(120deg, rgb(255 255 255 / .07) 0%, transparent 45%),
    linear-gradient(135deg, #0a665c 0%, #10856f 48%, #17a686 100%);
  box-shadow: 0 24px 60px rgb(9 60 54 / .18);
}
.dash-hero::before,
.dash-hero::after {
  content: "";
  background: linear-gradient(90deg, rgb(255 255 255 / .1), transparent 70%);
  border-radius: 999px;
  filter: none;
}
.dash-hero::before { width: 180px; height: 360px; transform: rotate(18deg); }
.dash-hero::after { width: 120px; height: 260px; transform: rotate(18deg); }
.dash-hero-title, .dash-section-title { letter-spacing: 0; }
.dash-stat {
  border-color: rgb(255 255 255 / .18);
  background: rgb(255 255 255 / .12);
}
.dash-stat-value { font-weight: 700; }
.dash-project-card {
  border: 1px solid #e2eeeb;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--ui-shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.dash-project-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ui-shadow-hover);
}
.dash-project-cover {
  background: linear-gradient(145deg, #f0faf7, #e8f2ef);
}
.dash-project-style { border-radius: 999px; background: #f2f8f6; color: var(--ui-muted); }
.dash-progress-bar { background: #e7f1ee; }
.dash-progress-fill { background: linear-gradient(90deg, #11997e, #0d7d6e); }

/* Responsive refinements */
@media (max-width: 768px) {
  .page-header { margin-bottom: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn,
  .page-actions .primary-button,
  .page-actions .secondary-button { flex: 1 1 44%; }
  .panel-lg { padding: 20px; }
  .panel-head { align-items: center; }
}

@media (max-width: 560px) {
  .page-header { display: grid; }
  .page-title { font-size: 25px; }
  .page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .page-actions .btn,
  .page-actions .primary-button,
  .page-actions .secondary-button { width: 100%; }
  .page-actions .danger-button,
  .page-actions .btn-ghost { grid-column: 1 / -1; }
  .app-main { padding: 16px 15px calc(22px + env(safe-area-inset-bottom)); }
  .panel-lg { padding: 18px; }
  .card-grid { gap: 14px; }
  .data-tile, .task-card { padding: 15px; }
  .panel-head { align-items: flex-start; }
  .unit-search { width: 100%; }
  .filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filter-row::-webkit-scrollbar { display: none; }
}

/* Learning heatmap */
.learning-heatmap {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  border: 1px solid #dfeae6;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f9fdfc 100%);
  box-shadow: var(--ui-shadow);
  padding: clamp(20px, 2.4vw, 26px);
}
.heatmap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.heatmap-eyebrow {
  display: block;
  color: var(--ui-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.heatmap-title {
  margin: 5px 0 0;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}
.heatmap-sub {
  margin: 6px 0 0;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.55;
}
.heatmap-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #dbe9e5;
  border-radius: 999px;
  background: #fff;
  padding: 0 13px;
  color: #425555;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.heatmap-state i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f59e0b;
}
.heatmap-state.done {
  border-color: #a9d8d0;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}
.heatmap-state.done i { background: var(--ui-primary); }

.heatmap-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.heatmap-stat {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid #e4efec;
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
}
.heatmap-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
}
.heatmap-stat-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.heatmap-stat-value {
  overflow: hidden;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.heatmap-stat-value small {
  margin-left: 3px;
  color: var(--ui-muted);
  font-family: 'Nunito Sans', 'PingFang SC', sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.heatmap-body {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0 8px;
  margin-top: 20px;
}
.heatmap-months {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(var(--heatmap-weeks, 18), 14px);
  gap: 3px;
  width: max-content;
  margin-bottom: 6px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.heatmap-months span {
  overflow: visible;
  white-space: nowrap;
}
.heatmap-week-labels {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
}
.heatmap-week-labels span:first-child { grid-row: 1; }
.heatmap-week-labels span:nth-child(2) { grid-row: 4; }
.heatmap-week-labels span:last-child { grid-row: 7; }
.heatmap-scroll {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 14px);
  grid-auto-columns: 14px;
  gap: 3px;
  width: max-content;
}
.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: #eaf2ef;
  box-shadow: inset 0 0 0 1px rgb(16 32 30 / .03);
  transition: box-shadow .18s ease, background-color .18s ease;
}
.heatmap-cell:hover { box-shadow: inset 0 0 0 1px #b9d8d1, 0 0 0 3px rgb(15 118 110 / .08); }
.heatmap-cell.level-1 { background: #c9e9da; }
.heatmap-cell.level-2 { background: #6cc8ae; }
.heatmap-cell.level-3 { background: #18a58a; }
.heatmap-cell.level-4 { background: #0d7b6b; }
.heatmap-cell.today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b; }
.heatmap-cell.future {
  background: #f5f8f7;
  box-shadow: inset 0 0 0 1px #e8efec;
}
.heatmap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.heatmap-meta {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 800;
}
.heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
}
.heatmap-legend .heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.heatmap-cta {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff9f43, #f97316);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 26px rgb(249 115 22 / .2);
  transition: filter .18s ease, box-shadow .18s ease;
}
.heatmap-cta svg { width: 17px; height: 17px; }
.heatmap-cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 32px rgb(249 115 22 / .24);
}

@media (max-width: 640px) {
  .learning-heatmap {
    margin-top: 18px;
    border-radius: 20px;
    padding: 18px;
  }
  .heatmap-title { font-size: 21px; }
  .heatmap-body { grid-template-columns: 16px minmax(0, 1fr); gap: 0 6px; }
  .heatmap-months { grid-template-columns: repeat(var(--heatmap-weeks, 18), 13px); gap: 2px; }
  .heatmap-week-labels { grid-template-rows: repeat(7, 13px); line-height: 13px; }
  .heatmap-grid {
    grid-template-rows: repeat(7, 13px);
    grid-auto-columns: 13px;
    gap: 2px;
  }
  .heatmap-cell { width: 13px; height: 13px; border-radius: 4px; }
}

/* Dashboard workbench */
.dash-workbench {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.dash-skeleton {
  display: grid;
  gap: 16px;
}
.dash-skeleton-header {
  height: 124px;
  border-radius: 22px;
  background: linear-gradient(90deg, #f4f8f7 25%, #e9f1ef 50%, #f4f8f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.dash-skeleton-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.dash-skeleton-panel {
  height: 280px;
  border-radius: 22px;
  background: linear-gradient(90deg, #f4f8f7 25%, #e9f1ef 50%, #f4f8f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.dash-skeleton-card {
  height: 148px;
  border-radius: 18px;
  background: linear-gradient(90deg, #f4f8f7 25%, #e9f1ef 50%, #f4f8f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 24px;
  overflow: hidden;
  position: relative;
  border: 1px solid #e2eeeb;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgb(15 118 110 / .06), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fdfb 58%, #eff8f5 100%);
  box-shadow: var(--ui-shadow);
  padding: clamp(20px, 2.4vw, 28px);
}
.dash-hero::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -58px;
  width: 158px;
  height: 158px;
  border: 24px solid rgb(15 118 110 / .05);
  border-radius: 50%;
}
.dash-hero-heading {
  position: relative;
  min-width: 0;
  z-index: 1;
}
.dash-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid #dcebe8;
  border-radius: 999px;
  background: rgb(255 255 255 / .72);
  padding: 0 12px;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}
.dash-date-chip svg {
  width: 14px;
  height: 14px;
}
.dash-hero-hi {
  margin: 12px 0 0;
  color: var(--ui-primary);
  font-size: 13px;
  font-weight: 800;
}
.dash-hero-title {
  margin: 5px 0 0;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700;
  line-height: 1.18;
}
.dash-hero-sub {
  margin: 7px 0 0;
  max-width: 560px;
  color: var(--ui-body);
  font-size: 14px;
  line-height: 1.6;
}
.dash-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.dash-btn svg {
  width: 16px;
  height: 16px;
}
.dash-btn-primary {
  border: 0;
  background: linear-gradient(180deg, #118879, #0f766e);
  color: #fff;
  box-shadow: 0 10px 22px rgb(15 118 110 / .16);
}
.dash-btn-primary:hover {
  background: linear-gradient(180deg, #0f7f71, #0d6a62);
  box-shadow: 0 14px 26px rgb(15 118 110 / .2);
}
.dash-btn-secondary {
  border: 1px solid #dbeae6;
  background: #fff;
  color: #3c5350;
  box-shadow: var(--ui-shadow-sm);
}
.dash-btn-secondary:hover {
  border-color: #a9d8d0;
  background: #f7fbfa;
  color: var(--ui-ink);
}

.dash-bento {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.dash-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #e2eeeb;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
  padding: 17px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.dash-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ui-shadow-hover);
}
.dash-card-progress {
  border-color: #cfe7e1;
  background: linear-gradient(145deg, #ffffff 0%, #f6fdfb 52%, #ecf7f4 100%);
}
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dash-card-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 800;
}
.dash-card-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--ui-primary);
}
.dash-card-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #e4efec;
  border-radius: 999px;
  background: #f7faf9;
  padding: 0 8px;
  color: var(--ui-muted);
  font-size: 11.5px;
  font-weight: 800;
}
.dash-card-chip.good {
  border-color: #bfe5db;
  background: #effaf6;
  color: #0d7d6e;
}
.dash-card-chip.warning {
  border-color: #f0dcb0;
  background: #fff8e8;
  color: #b45309;
}
.dash-card-value {
  margin-top: 18px;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.dash-card-value small {
  color: var(--ui-muted);
  font-size: 15px;
  font-weight: 800;
}
.dash-card-caption {
  margin-top: 6px;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}
.dash-card-progress .dash-progress {
  margin-top: auto;
  padding-top: 22px;
}
.dash-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6f1ee;
}
.dash-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #11997e, #0d7d6e);
}

.dash-workbench .learning-heatmap,
.dash-workbench .dash-section {
  margin-top: 0;
}
.heatmap-cta {
  width: fit-content;
  min-height: 42px;
  gap: 7px;
  border: 1px solid #bfe5db;
  border-radius: 12px;
  background: #e9f7f3;
  padding: 0 16px;
  color: #0d7d6e;
  font-size: 13.5px;
  box-shadow: none;
}
.heatmap-cta:hover {
  background: #dcf1ec;
  border-color: #a9d8d0;
  filter: none;
  box-shadow: none;
}

.dash-project-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.dash-project-cover {
  background: linear-gradient(145deg, #f8fbfa, #edf4f2);
}
.dash-project-card {
  border-color: #e2eeeb;
  box-shadow: var(--ui-shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.dash-project-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ui-shadow-hover);
}
.dash-project-body {
  padding: 15px 16px 16px;
}
.dash-progress-bar {
  background: #e9f2ef;
}
.dash-empty {
  border-color: #bfd9d3;
  border-radius: 18px;
  background: #fbfdfc;
}

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

@media (max-width: 760px) {
  .dash-workbench { gap: 14px; }
  .dash-hero {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 20px;
  }
  .dash-hero-actions {
    width: 100%;
    justify-content: stretch;
  }
  .dash-hero-actions .dash-btn {
    flex: 1 1 calc(50% - 5px);
  }
  .dash-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-card { padding: 15px; }
  .dash-card-value { font-size: 26px; margin-top: 14px; }
  .dash-card-progress .dash-progress { padding-top: 16px; }
  .dash-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dash-skeleton-bento { gap: 14px; }
}

@media (max-width: 480px) {
  .dash-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-card-progress { grid-column: 1 / -1; }
  .dash-card { gap: 2px; }
  .dash-card-value { margin-top: 16px; }
  .dash-card-caption { font-size: 12px; }
  .dash-project-grid { grid-template-columns: 1fr; }
}

/* Home workbench redesign */
.home-workbench {
  display: grid;
  gap: 20px;
}

.home-skeleton {
  display: grid;
  gap: 18px;
}
.home-skeleton-hero {
  min-height: 280px;
  border-radius: 28px;
  background: linear-gradient(90deg, #eef4f2 25%, #e2ecea 50%, #eef4f2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.home-skeleton-heatmap {
  min-height: 300px;
  border-radius: 24px;
  background: linear-gradient(90deg, #f5f8f7 25%, #e9f0ee 50%, #f5f8f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.home-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.home-skeleton-card {
  height: 300px;
  border-radius: 20px;
  background: linear-gradient(90deg, #f5f8f7 25%, #e9f0ee 50%, #f5f8f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .82fr);
  align-items: center;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 8%, rgb(125 231 205 / .18), transparent 34%),
    linear-gradient(125deg, #053933 0%, #08594e 46%, #0d7d6e 100%);
  box-shadow: 0 24px 70px rgb(8 51 45 / .18);
  padding: clamp(24px, 3.2vw, 42px);
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255 255 255 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255 255 255 / .05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(115deg, transparent 32%, #000 78%);
}
.home-hero::after {
  content: none;
}
.home-hero-main {
  min-width: 0;
  color: #fff;
}
.home-hero-chips {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.home-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  padding: 0 13px;
  color: rgb(234 255 247 / .88);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}
.home-chip svg { width: 14px; height: 14px; }
.home-chip.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
}
.home-chip.status.done i { background: #7ce7cc; }
.home-hero-greeting {
  margin: 22px 0 0;
  color: rgb(234 255 247 / .76);
  font-size: 14px;
  font-weight: 800;
}
.home-hero-title {
  margin: 7px 0 0;
  max-width: 19ch;
  color: #fff;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 700;
  line-height: 1.12;
}
.home-hero-sub {
  margin: 14px 0 0;
  max-width: 32rem;
  color: rgb(234 255 247 / .72);
  font-size: 14.5px;
  line-height: 1.7;
}
.home-hero-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 14px;
  padding: 0 21px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-btn svg { width: 16px; height: 16px; }
.home-btn.primary {
  border: 0;
  background: #fff;
  color: #06564b;
  box-shadow: 0 16px 34px rgb(4 35 31 / .24);
}
.home-btn.primary:hover { background: #eafff7; box-shadow: 0 20px 40px rgb(4 35 31 / .28); }
.home-btn.secondary {
  border: 1px solid rgb(255 255 255 / .24);
  background: rgb(255 255 255 / .08);
  color: #eafff7;
  backdrop-filter: blur(12px);
}
.home-btn.secondary:hover {
  border-color: rgb(255 255 255 / .38);
  background: rgb(255 255 255 / .14);
}

.home-overview {
  min-width: 0;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 24px;
  background: linear-gradient(150deg, rgb(255 255 255 / .14), rgb(255 255 255 / .05));
  box-shadow: 0 18px 48px rgb(4 35 31 / .18), inset 0 1px 0 rgb(255 255 255 / .12);
  padding: 22px;
  color: #fff;
  backdrop-filter: blur(16px);
}
.home-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.home-overview-head > span {
  color: rgb(234 255 247 / .72);
  font-size: 12.5px;
  font-weight: 800;
}
.home-overview-head > strong {
  color: #fff;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 21px;
  line-height: 1;
}
.home-overview-head small {
  color: rgb(234 255 247 / .64);
  font-size: 13px;
  font-weight: 800;
}
.home-ring {
  display: grid;
  width: 148px;
  margin: 22px auto 0;
  place-items: center;
  position: relative;
}
.home-ring svg {
  width: 148px;
  height: 148px;
  transform: rotate(-90deg);
}
.home-ring circle {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}
.home-ring .track { stroke: rgb(255 255 255 / .18); }
.home-ring .value {
  stroke: #7ce7cc;
  stroke-dasharray: 100;
  filter: drop-shadow(0 6px 14px rgb(124 231 204 / .22));
}
.home-ring b {
  position: absolute;
  color: #fff;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.home-ring small {
  margin-left: 2px;
  color: rgb(234 255 247 / .68);
  font-size: 12px;
  font-weight: 800;
}
.home-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.home-overview-stats > div {
  min-width: 0;
  border-top: 1px solid rgb(255 255 255 / .14);
  padding-top: 12px;
}
.home-overview-stats span {
  display: block;
  overflow: hidden;
  color: rgb(234 255 247 / .64);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-overview-stats strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}
.home-overview-stats small {
  margin-left: 2px;
  color: rgb(234 255 247 / .6);
  font-size: 11px;
  font-weight: 800;
}

.home-workbench .home-heatmap {
  margin-top: 0;
  border: 1px solid #e2eeeb;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ui-shadow);
}
.home-workbench .heatmap-title { font-size: 22px; }
.home-workbench .heatmap-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}
.home-workbench .heatmap-stat {
  position: relative;
  min-width: 0;
  gap: 8px;
  border: 1px solid #e4efec;
  border-radius: 15px;
  background: linear-gradient(145deg, #fff 0%, #fafdfc 100%);
  padding: 12px 13px;
  overflow: hidden;
}
.home-workbench .heatmap-stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  border-top: 2px solid #11997e;
  pointer-events: none;
}
.home-workbench .heatmap-stat-label { color: #647b78; font-size: 11.5px; }
.home-workbench .heatmap-stat-value { font-size: 23px; }

.home-workbench .heatmap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 234px);
  gap: 14px 16px;
  align-items: stretch;
  margin-top: 14px;
}
.home-workbench .heatmap-body {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px 6px;
  min-width: 0;
  min-height: 178px;
  margin-top: 0;
}
.home-workbench .heatmap-months {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(var(--heatmap-weeks, 18), minmax(0, 1fr));
  width: 100%;
  margin-bottom: 0;
  overflow: hidden;
}
.home-workbench .heatmap-months span {
  overflow: hidden;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
}
.home-workbench .heatmap-week-labels {
  grid-column: 1;
  grid-row: 2;
  grid-template-rows: repeat(7, minmax(14px, 1fr));
  gap: 3px;
  line-height: 1;
}
.home-workbench .heatmap-week-labels span { display: flex; align-items: center; }
.home-workbench .heatmap-grid {
  grid-column: 2;
  grid-row: 2;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, minmax(14px, 1fr));
  grid-template-columns: repeat(var(--heatmap-weeks, 18), minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  min-width: 0;
}
.home-workbench .heatmap-cell {
  width: 100%;
  height: 100%;
  min-height: 14px;
  border-radius: 5px;
}
.home-workbench .heatmap-cell.today { box-shadow: inset 0 0 0 1px #fff, 0 0 0 2px #f59e0b; }

.home-workbench .heatmap-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid #dcebe7;
  border-radius: 17px;
  background: linear-gradient(160deg, #f5fbf9 0%, #fff 58%);
  padding: 13px 14px;
}
.home-workbench .heatmap-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #58706c;
  font-size: 12px;
  font-weight: 800;
}
.home-workbench .heatmap-side-head strong {
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}
.home-workbench .heatmap-side-head small { margin-left: 2px; color: var(--ui-muted); font-size: 10px; }
.home-workbench .heatmap-trend {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-content: center;
  min-height: 104px;
  margin-top: 13px;
}
.home-workbench .heatmap-trend-item {
  display: grid;
  grid-template-rows: 15px minmax(0, 1fr) 13px;
  gap: 4px;
  align-items: center;
  justify-items: center;
  min-width: 0;
}
.home-workbench .heatmap-trend-item b {
  max-width: 100%;
  overflow: hidden;
  color: #526966;
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-workbench .heatmap-trend-bar {
  display: flex;
  width: min(18px, 100%);
  height: 100%;
  align-items: flex-end;
}
.home-workbench .heatmap-trend-bar i {
  display: block;
  width: 100%;
  height: var(--value, 8%);
  min-height: 6px;
  border-radius: 7px;
  background: linear-gradient(180deg, #22c2a1, #0e8472);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}
.home-workbench .heatmap-trend-item.empty .heatmap-trend-bar i { background: #e3efec; box-shadow: none; }
.home-workbench .heatmap-trend-item.today .heatmap-trend-bar i { background: linear-gradient(180deg, #ffc46a, #f97316); }
.home-workbench .heatmap-trend-item small { color: var(--ui-muted); font-size: 9.5px; font-weight: 800; }
.home-workbench .heatmap-trend-item.today small { color: #f97316; }
.home-workbench .heatmap-side-note {
  margin: 12px 0 0;
  color: #859692;
  font-size: 10.5px;
  line-height: 1.4;
}
.home-workbench .heatmap-foot { margin-top: 13px; }
.home-workbench .heatmap-meta { font-size: 12px; }

.home-workbench .heatmap-cta { margin-top: 0; }

.home-section { margin-top: 0; }
.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 20px;
  margin-bottom: 18px;
}
.home-section-head h2 {
  margin: 0;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 23px;
  font-weight: 700;
}
.home-section-head p {
  margin: 6px 0 0;
  color: var(--ui-muted);
  font-size: 13.5px;
}
.home-section-head a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ui-primary);
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
}
.home-section-head a::after {
  content: "→";
  transition: transform .18s ease;
}
.home-section-head a:hover::after { transform: translateX(3px); }

.home-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.home-project-card {
  overflow: hidden;
  border: 1px solid #e2eeeb;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--ui-shadow);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.home-project-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ui-shadow-hover);
}
.home-project-cover {
  position: relative;
  aspect-ratio:3/4;
  overflow: hidden;
  background: linear-gradient(145deg, #f2faf7, #e9f3f0);
}
.home-project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.home-project-card:hover .home-project-cover img { transform: scale(1.04); }
.home-project-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #86b3aa;
}
.home-project-empty svg { width: 58px; height: 58px; }
.home-project-word {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border: 1px solid rgb(255 255 255 / .64);
  border-radius: 999px;
  background: rgb(255 255 255 / .86);
  padding: 5px 10px;
  color: var(--ui-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  backdrop-filter: blur(10px);
}
.home-project-body { padding: 16px 17px 17px; }
.home-project-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.home-project-title-row h3 {
  margin: 0;
  overflow: hidden;
  color: var(--ui-ink);
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 16.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-project-title-row span {
  flex-shrink: 0;
  border-radius: 999px;
  background: #f2f8f6;
  padding: 4px 8px;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
}
.home-project-body > p {
  margin: 5px 0 0;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 700;
}
.home-progress {
  height: 6px;
  overflow: hidden;
  margin-top: 16px;
  border-radius: 999px;
  background: #e9f2ef;
}
.home-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #11997e, #0d7d6e);
}
.home-project-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--ui-muted);
  font-size: 11.5px;
  font-weight: 800;
}

.home-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  border: 1px dashed #bfd9d3;
  border-radius: 22px;
  background: linear-gradient(180deg, #fbfdfc, #f5faf8);
  padding: 46px 24px;
  text-align: center;
}
.home-empty > span {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid #d5ebe5;
  border-radius: 22px;
  background: #fff;
  color: var(--ui-primary);
}
.home-empty svg { width: 32px; height: 32px; }
.home-empty h3 {
  margin: 17px 0 0;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: 21px;
  font-weight: 700;
}
.home-empty p {
  margin: 7px 0 0;
  max-width: 34rem;
  color: var(--ui-muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.home-empty .home-btn { margin-top: 21px; }

@media (max-width: 1080px) {
  .home-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .home-overview { margin-top: 26px; }
  .home-skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-workbench .heatmap-layout { grid-template-columns: minmax(0, 1fr); }
  .home-workbench .heatmap-side { margin-top: 2px; }
}

@media (max-width: 640px) {
  .home-workbench { gap: 16px; }
  .home-hero {
    border-radius: 22px;
    padding: 22px 19px;
  }
  .home-hero-greeting { margin-top: 18px; }
  .home-hero-actions { margin-top: 24px; }
  .home-hero-actions .home-btn { flex: 1 1 calc(50% - 6px); padding: 0 12px; }
  .home-overview {
    margin-top: 20px;
    border-radius: 20px;
    padding: 19px;
  }
  .home-ring { margin-top: 18px; }
  .home-overview-stats { gap: 8px; margin-top: 18px; }
  .home-overview-stats > div { padding-top: 10px; }
  .home-overview-stats strong { font-size: 19px; }
  .home-workbench .heatmap-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-workbench .heatmap-body { min-height: 154px; }
  .home-section-head { align-items: flex-start; flex-direction: column; }
  .home-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-project-body { padding: 13px 14px 14px; }
  .home-skeleton-hero { min-height: 250px; border-radius: 22px; }
  .home-skeleton-grid { gap: 12px; }
  .home-skeleton-card { height: 250px; border-radius: 17px; }
}

@media (max-width: 430px) {
  .home-workbench .heatmap-body { min-height: 148px; }
  .home-workbench .heatmap-trend { min-height: 96px; }
  .home-workbench .heatmap-trend-item b,
  .home-workbench .heatmap-trend-item small { font-size: 9px; }
  .home-workbench .heatmap-side-note { font-size: 10px; }
  .home-project-grid { grid-template-columns: 1fr; }
  .home-chip.status { white-space: normal; min-height: auto; padding-top: 6px; padding-bottom: 6px; }
}

/* Home library card polish */
.home-project-card {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.home-project-card:hover {
  transform: translateY(-2px);
}
.home-project-card:focus-visible {
  outline: 2px solid #11997e;
  outline-offset: 3px;
}
.home-project-cover {
  aspect-ratio:3/4;
}
.home-project-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(6 43 38 / .16) 0%, transparent 38%, rgb(6 43 38 / .22) 100%);
  pointer-events: none;
}
.home-project-cover-top {
  position: absolute;
  top: 11px;
  left: 11px;
  right: 11px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.home-project-state {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid rgb(255 255 255 / .38);
  border-radius: 999px;
  background: rgb(255 255 255 / .88);
  padding: 0 10px;
  color: #4a625e;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.home-project-state.active { background: #dff5ee; color: #0d7d6e; }
.home-project-state.done { background: #0d7d6e; color: #fff; }
.home-project-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / .38);
  border-radius: 999px;
  background: rgb(255 255 255 / .88);
  color: #0d7d6e;
  transition: transform .18s ease, background-color .18s ease;
  backdrop-filter: blur(10px);
}
.home-project-arrow svg { width: 14px; height: 14px; }
.home-project-card:hover .home-project-arrow {
  transform: translateX(2px);
  background: #fff;
}
.home-project-empty b {
  color: #0d7d6e;
  font-family: 'Baloo 2', 'Fredoka', 'Nunito Sans', sans-serif;
  font-size: clamp(42px, 5vw, 56px);
  font-weight: 700;
  line-height: 1;
}
.home-project-word {
  z-index: 2;
  max-width: calc(100% - 24px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-project-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.home-project-meta span {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #f2f8f6;
  padding: 4px 8px;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-progress {
  height: 7px;
}
.home-progress span {
  background: linear-gradient(90deg, #1aa98b, #0d7d6e);
}
.home-project-progress-meta {
  align-items: center;
}
.home-project-progress-meta strong {
  color: var(--ui-ink);
  font-size: 12.5px;
}
.home-section-head h2 b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  margin-left: 4px;
  border-radius: 999px;
  background: #dff5ee;
  padding: 0 8px;
  color: #0d7d6e;
  font-size: 13px;
  font-weight: 800;
}

/* ============================================================
   Experience refresh 2026-10
   Primary: warm leaf green. Accents: coral, sun, sky.
   ============================================================ */
:root {
  --ux-brand: #10836f;
  --ux-brand-deep: #04564c;
  --ux-brand-soft: #e5f4f0;
  --ux-canvas: #f3f6f4;
  --ux-surface: #ffffff;
  --ux-line: #dcebe7;
  --ux-ink: #172d2a;
  --ux-body: #466159;
  --ux-muted: #6d847d;
  --ux-coral: #ff8a5b;
  --ux-sun: #ffc55c;
  --ux-sky: #6aa5f8;
  --ux-radius: 22px;
  --ux-radius-sm: 14px;
  --ux-shadow: 0 2px 6px rgb(23 45 42 / .04), 0 18px 42px rgb(23 45 42 / .07);
  --ux-shadow-hover: 0 4px 10px rgb(23 45 42 / .05), 0 26px 58px rgb(23 45 42 / .12);
  --ux-focus: 0 0 0 4px rgb(16 131 111 / .16);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgb(255 197 92 / .14), transparent 28%),
    radial-gradient(circle at 95% 5%, rgb(106 165 248 / .10), transparent 26%),
    linear-gradient(180deg, #f7faf8 0%, var(--ux-canvas) 58%, #eef4f1 100%);
  color: var(--ux-ink);
  font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ux-ink);
  letter-spacing: 0;
}

::selection {
  background: #b8f1e4;
  color: var(--ux-ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--ux-focus);
}

/* Application navigation */
.app-shell {
  max-width: 1580px;
}

.app-sidebar {
  width: 260px;
  border-right-color: var(--ux-line);
  background: rgb(255 255 255 / .86);
  backdrop-filter: blur(20px);
  padding: 24px 16px 20px;
}

.brand {
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, #22c3a4, var(--ux-brand-deep));
  box-shadow: 0 12px 26px rgb(4 86 76 / .22);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--ux-muted);
  letter-spacing: .07em;
}

.nav-link {
  position: relative;
  min-height: 46px;
  border-radius: var(--ux-radius-sm);
  padding: 10px 12px;
  color: var(--ux-body);
  font-size: 14px;
  font-weight: 800;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.nav-link:hover {
  background: #f0f7f4;
  color: var(--ux-ink);
  transform: translateX(2px);
}

.nav-link.active,
.nav-link.bg-teal-50 {
  background: linear-gradient(135deg, #e9f9f5 0%, #d7f1e9 100%);
  color: var(--ux-brand-deep);
  box-shadow: inset 0 0 0 1px rgb(16 131 111 / .14), 0 8px 22px rgb(4 86 76 / .07);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ux-coral);
  transform: translateY(-50%);
}

.user-card {
  border-color: var(--ux-line);
  background: #f8fbf9;
  padding: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(145deg, #dff7f0, #b9ede0);
  color: var(--ux-brand-deep);
}

.mobile-topbar {
  border-bottom-color: rgb(220 235 231 / .9);
  background: rgb(255 255 255 / .88);
  backdrop-filter: blur(22px);
}

.app-main {
  padding: 18px 16px 92px;
}

@media (min-width: 900px) {
  .app-main {
    padding: 36px 42px 48px;
  }
}

.mobile-bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid rgb(220 235 231 / .86);
  background: rgb(255 255 255 / .92);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  backdrop-filter: blur(22px);
}

.mobile-bottom-nav a {
  display: grid;
  justify-items: center;
  gap: 3px;
  border-radius: 14px;
  padding: 5px 0;
  color: var(--ux-muted);
  font-size: 10.5px;
  font-weight: 800;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.mobile-bottom-nav a svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-bottom-nav a.active {
  background: var(--ux-brand-soft);
  color: var(--ux-brand-deep);
}

.mobile-bottom-nav a.cta.active {
  background: linear-gradient(145deg, #22c3a4, var(--ux-brand-deep));
  color: #fff;
  box-shadow: 0 10px 20px rgb(4 86 76 / .16);
}

@media (min-width: 900px) {
  .mobile-bottom-nav { display: none; }
}

/* Shared controls */
.btn,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 46px;
  border-radius: 15px;
  padding: 11px 19px;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, filter .16s ease;
}

.btn:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.btn-primary,
.primary-button {
  border: 0;
  background: linear-gradient(145deg, #1cae90 0%, var(--ux-brand) 54%, var(--ux-brand-deep) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgb(4 86 76 / .16);
}

.btn-primary:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
  background: linear-gradient(145deg, #1dae8f 0%, #0d7462 54%, var(--ux-brand-deep) 100%);
  box-shadow: 0 15px 32px rgb(4 86 76 / .21);
}

.btn-secondary,
.secondary-button {
  border: 1px solid var(--ux-line);
  background: var(--ux-surface);
  color: var(--ux-body);
  box-shadow: 0 3px 12px rgb(23 45 42 / .05);
}

.btn-secondary:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  border-color: #a9d8d0;
  background: #f7fbfa;
  color: var(--ux-ink);
}

.input,
select.input,
textarea.input {
  min-height: 46px;
  border-color: var(--ux-line);
  border-radius: 14px;
  background: #fbfdfc;
  box-shadow: inset 0 1px 0 #fff;
  color: var(--ux-ink);
  font-weight: 700;
}

.input:hover {
  border-color: #b9d8d1;
}

.input:focus {
  border-color: #69bda9;
  background: #fff;
  box-shadow: var(--ux-focus);
}

.panel:not(.panel-collapse) {
  border-color: var(--ux-line);
  border-radius: var(--ux-radius);
  background: var(--ux-surface);
  box-shadow: var(--ux-shadow);
}

.media-card,
.stat-card,
.task-card {
  border-color: var(--ux-line);
  border-radius: 18px;
  background: var(--ux-surface);
  box-shadow: var(--ux-shadow);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.media-card:hover,
.stat-card:hover,
.task-card:hover,
.unit-card:hover {
  border-color: #a9d8d0;
  box-shadow: var(--ux-shadow-hover);
  transform: translateY(-2px);
}

.chip {
  border-radius: 999px;
  font-weight: 850;
}

.chip-primary {
  background: var(--ux-brand-soft);
  color: var(--ux-brand-deep);
}

.app-toast {
  border-radius: 18px;
  box-shadow: 0 18px 42px rgb(11 35 31 / .22);
}

/* Auth experience */
.auth-shell {
  position: relative;
  overflow: hidden;
  background: var(--ux-canvas);
}

.auth-side {
  position: relative;
  border-right-color: var(--ux-line);
  background:
    radial-gradient(circle at 72% 14%, rgb(255 197 92 / .28), transparent 26%),
    radial-gradient(circle at 20% 78%, rgb(106 165 248 / .18), transparent 28%),
    linear-gradient(160deg, #fbfefd 0%, #eaf6f2 100%);
}

.auth-side::before {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  border: 2px solid rgb(16 131 111 / .12);
  border-radius: 50%;
}

.auth-title {
  font-size: clamp(35px, 4.2vw, 54px);
  font-weight: 800;
  line-height: 1.08;
}

.auth-title::after,
.home-hero-title::after {
  content: none;
}

.auth-card {
  border-color: rgb(220 235 231 / .9);
  border-radius: 26px;
  box-shadow: 0 24px 68px rgb(23 45 42 / .12);
  padding: 34px 30px;
}

.auth-side .brand-mark {
  background: linear-gradient(145deg, #22c3a4, #04564c);
}

.auth-chips .chip {
  min-height: 32px;
  background: #fff;
  color: var(--ux-brand-deep);
  box-shadow: 0 6px 16px rgb(4 86 76 / .07);
}

.auth-features {
  display: grid;
  gap: 10px;
  margin-top: 32px;
  max-width: 430px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgb(220 235 231 / .9);
  border-radius: 16px;
  background: rgb(255 255 255 / .74);
  padding: 12px 14px;
  backdrop-filter: blur(12px);
}

.auth-feature i {
  display: grid;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 11px;
  font-size: 16px;
}

.auth-feature:nth-child(1) i { background: #e5f4f0; color: #04564c; }
.auth-feature:nth-child(2) i { background: #fff0e4; color: #c25b28; }
.auth-feature:nth-child(3) i { background: #eaf2ff; color: #33619f; }

.auth-feature b {
  display: block;
  color: var(--ux-ink);
  font-size: 14px;
  font-weight: 850;
}

.auth-feature small {
  display: block;
  color: var(--ux-muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (min-width: 900px) {
  .auth-card { padding: 38px 34px; }
}

/* Dashboard */
.home-workbench {
  gap: 22px;
}

.home-hero {
  border: 1px solid rgb(4 86 76 / .28);
  border-radius: 30px;
  background:
    radial-gradient(circle at 86% 8%, rgb(255 197 92 / .18), transparent 28%),
    radial-gradient(circle at 6% 90%, rgb(106 165 248 / .12), transparent 26%),
    linear-gradient(126deg, #06413a 0%, #086557 44%, #128a76 100%);
  box-shadow: 0 26px 74px rgb(5 48 42 / .2);
  padding: clamp(24px, 3vw, 44px);
}

.home-hero::before {
  background:
    linear-gradient(rgba(255 255 255 / .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255 255 255 / .06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(118deg, transparent 38%, #000 86%);
}

.home-chip {
  border-color: rgb(255 255 255 / .22);
  background: rgb(255 255 255 / .12);
  color: #ecfff9;
}

.home-hero-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
}

.home-hero-sub {
  color: rgb(236 255 249 / .78);
  font-size: 15px;
}

.home-btn {
  height: 50px;
  border-radius: 16px;
  font-size: 15px;
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.home-btn:active { transform: translateY(1px); }
.home-btn.primary { box-shadow: 0 16px 34px rgb(4 35 31 / .26); }
.home-overview { border-radius: 26px; }
.home-ring { width: 158px; }
.home-ring svg { width: 158px; height: 158px; }

.home-workbench .home-heatmap {
  border-radius: 26px;
}

.home-workbench .heatmap-stat {
  border-radius: 18px;
  box-shadow: 0 3px 12px rgb(23 45 42 / .04);
}

.home-project-card {
  border-radius: 22px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.home-project-card:hover {
  transform: translateY(-3px);
}

.home-project-cover {
  aspect-ratio:3/4;
}

.home-project-cover-top { z-index: 2; }
.home-project-cover::after { z-index: 1; }
.home-project-word { z-index: 2; }

.home-empty {
  border-radius: 26px;
}

.home-empty > span {
  border-radius: 24px;
}

.learning-heatmap {
  border-radius: 26px;
}

.heatmap-stat {
  border-radius: 18px;
}

/* Practice: replace hard black with calm evening green */
.practice-body {
  background:
    radial-gradient(circle at 84% 5%, rgb(255 197 92 / .12), transparent 25%),
    radial-gradient(circle at 4% 92%, rgb(45 212 191 / .12), transparent 28%),
    linear-gradient(155deg, #04201d 0%, #063832 48%, #0a4b40 100%) !important;
  color: #f4fdfb;
}

.practice-topbar,
.practice-bottombar {
  border-bottom-color: rgb(255 255 255 / .09) !important;
  background: rgb(4 32 29 / .78) !important;
  backdrop-filter: blur(20px);
}

.practice-topbar { border-bottom: 1px solid rgb(255 255 255 / .09); }
.practice-bottombar { border-top: 1px solid rgb(255 255 255 / .09); }
.practice-progress-bar { background: rgb(255 255 255 / .08) !important; }
.practice-progress-fill { background: linear-gradient(90deg, #ffc55c, #22c3a4) !important; }
.practice-dot { background: rgb(255 255 255 / .18) !important; }
.practice-dot.done { background: #22c3a4 !important; }
.practice-dot.active { background: #ffc55c !important; }
.practice-mini-select,
.practice-icon-btn {
  border-color: rgb(255 255 255 / .13) !important;
  border-radius: 11px !important;
  background: rgb(255 255 255 / .08) !important;
  color: #d8efe9 !important;
}
.practice-mini-select:hover,
.practice-icon-btn:hover {
  background: rgb(255 255 255 / .15) !important;
  color: #fff !important;
}
.practice-chip-btn {
  border-color: rgb(255 255 255 / .13) !important;
  border-radius: 999px !important;
  background: rgb(255 255 255 / .08) !important;
  color: #d8efe9 !important;
}
.practice-chip-btn.active {
  background: #e5f4f0 !important;
  border-color: #e5f4f0 !important;
  color: #04564c !important;
}
.practice-chip-btn span { background: var(--ux-coral) !important; color: #fff !important; }
.practice-icon-btn svg { width: 17px; height: 17px; }

.practice-image {
  border: 6px solid rgb(255 255 255 / .86);
  border-radius: 28px !important;
  background: #fff !important;
  box-shadow: 0 26px 66px rgb(0 0 0 / .3);
}

.practice-input {
  height: 62px !important;
  border-color: rgb(255 255 255 / .16) !important;
  border-radius: 20px !important;
  background: rgb(255 255 255 / .09) !important;
  color: #fff !important;
  font-size: 24px !important;
}

.practice-input:focus {
  border-color: #22c3a4 !important;
  background: rgb(255 255 255 / .13) !important;
  box-shadow: 0 0 0 4px rgb(34 195 164 / .18) !important;
}

.practice-btn-primary {
  height: 50px !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, #22c3a4, #04564c) !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  box-shadow: 0 14px 32px rgb(4 86 76 / .24) !important;
}

.practice-btn-secondary {
  height: 50px !important;
  border-color: rgb(255 255 255 / .16) !important;
  border-radius: 16px !important;
  background: rgb(255 255 255 / .08) !important;
  color: #e7fbf5 !important;
}

.practice-btn-secondary:hover {
  background: rgb(255 255 255 / .15) !important;
  color: #fff !important;
}

.picture-choice {
  min-height: 94px;
  border-color: rgb(255 255 255 / .16);
  border-radius: 20px;
  background: rgb(255 255 255 / .08);
}

.picture-choice-word { font-size: 21px; font-weight: 900; }
.picture-choice.correct { background: rgb(34 195 164 / .2); }
.picture-choice.wrong { background: rgb(255 138 91 / .18); }
.practice-kbd-btn {
  border-color: rgb(255 255 255 / .12) !important;
  border-radius: 14px !important;
  background: rgb(255 255 255 / .08) !important;
  color: #cfe8e2 !important;
}
.practice-kbd-btn.primary {
  background: linear-gradient(145deg, #22c3a4, #04564c) !important;
  color: #fff !important;
}
.practice-celebration-core {
  border-color: rgb(255 255 255 / .18);
  border-radius: 26px;
  background: rgb(4 32 29 / .82);
}

.answer-modal-content {
  border-color: rgb(255 255 255 / .16);
  border-radius: 28px;
  background: linear-gradient(160deg, #074139 0%, #04201d 100%);
}

.answer-close {
  border-color: rgb(255 255 255 / .16);
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  color: #e6fbf4;
}

/* Motion and polish */
.fade-in {
  animation: fade-in .36s cubic-bezier(.22, 1, .36, 1);
}

.fade-in-up {
  animation: fade-in-up .42s cubic-bezier(.22, 1, .36, 1);
}

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

/* Admin stays neutral and readable, but shares the new tone */
body.admin-mode .admin-shell {
  background: var(--ux-canvas);
}

body.admin-mode .admin-sidebar {
  background: linear-gradient(180deg, #0a4b40 0%, #04201d 100%);
}

body.admin-mode .admin-brand span:first-child {
  background: linear-gradient(145deg, #22c3a4, #04564c);
}

body.admin-mode .admin-nav a.active {
  background: rgb(255 255 255 / .12);
  box-shadow: inset 3px 0 0 var(--ux-coral);
}

body.admin-mode .admin-panel,
body.admin-mode .admin-stats article {
  border-color: var(--ux-line);
  border-radius: 18px;
  box-shadow: var(--ux-shadow);
}

body.admin-mode .admin-input:focus {
  border-color: #69bda9;
  outline: 0;
  box-shadow: var(--ux-focus);
}

body.admin-mode .admin-action:hover,
body.admin-mode .admin-page.current,
body.admin-mode .admin-page:hover {
  border-color: #69bda9;
  color: var(--ux-brand-deep);
}

body.admin-mode .admin-provider-option.active {
  border-color: #69bda9;
  background: var(--ux-brand-soft);
  box-shadow: var(--ux-focus);
}

body.admin-mode .admin-provider-option.active span {
  color: var(--ux-brand-deep);
}

/* UX refresh: cohesive product layer */
:root {
  --ui-canvas: #f4f8f6;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f7faf9;
  --ui-primary: #0d9488;
  --ui-primary-hover: #0f766e;
  --ui-primary-soft: #ccfbf1;
  --ui-accent: #ea580c;
  --ui-ink: #134e4a;
  --ui-body: #456a65;
  --ui-muted: #6b807c;
  --ui-line: #dcebe6;
  --ui-radius: 18px;
  --ui-radius-sm: 12px;
  --ui-shadow: 0 8px 24px rgb(19 42 38 / .06);
  --ui-shadow-hover: 0 20px 50px rgb(19 42 38 / .12);
  --ui-focus: 0 0 0 4px rgb(13 122 104 / .16);
}

body {
  background:
    radial-gradient(circle at 88% 4%, rgb(13 122 104 / .07), transparent 34%),
    radial-gradient(circle at 8% 82%, rgb(242 109 79 / .05), transparent 36%),
    linear-gradient(180deg, #f4f8f6 0%, #f7f9f7 100%);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
  background-color: #c9dcd6;
}
::-webkit-scrollbar-thumb:hover { background-color: #a9c7c0; }

.app-shell { max-width: 1580px; }

.app-sidebar {
  border-right: 1px solid rgb(220 235 231 / .8);
  background: linear-gradient(180deg, rgb(255 255 255 / .94) 0%, rgb(247 250 249 / .94) 100%);
  backdrop-filter: blur(22px);
  padding: 26px 18px 20px;
}

.brand { margin-bottom: 30px; }
.brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 15px;
  background: linear-gradient(145deg, #17a58a, #0a6555);
  box-shadow: 0 12px 28px rgb(10 101 85 / .22), inset 0 1px 0 rgb(255 255 255 / .24);
}
.brand-title { color: var(--ui-ink); font-size: 18px; font-weight: 700; }
.brand-subtitle { color: var(--ui-muted); letter-spacing: .06em; text-transform: uppercase; }

.app-nav {
  border: 1px solid rgb(220 235 231 / .72);
  border-radius: 18px;
  background: rgb(255 255 255 / .72);
  padding: 10px;
  box-shadow: 0 8px 22px rgb(19 42 38 / .04);
}

.nav-link {
  position: relative;
  min-height: 45px;
  border-radius: 12px;
  color: var(--ui-body);
  font-size: 14px;
}
.nav-link:hover { background: #eff7f4; color: var(--ui-ink); }
.nav-link.active,
.nav-link.bg-teal-50 {
  background: linear-gradient(135deg, #e5f6f1 0%, #d9f1ea 100%);
  color: var(--ui-primary-hover);
  box-shadow: inset 0 0 0 1px rgb(13 122 104 / .14), 0 8px 22px rgb(10 101 85 / .08);
}
.nav-link.active::after {
  width: 6px;
  height: 6px;
  right: 12px;
  background: var(--ui-accent);
}

.user-card {
  border: 1px solid rgb(220 235 231 / .9);
  border-radius: 18px;
  background: #f7faf9;
  box-shadow: 0 8px 22px rgb(19 42 38 / .04);
  padding: 13px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(145deg, #dff5ee, #bfe9dd);
  color: var(--ui-primary-hover);
}

.app-main { padding: 38px 38px 48px; }

.page-title {
  color: var(--ui-ink);
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 700;
}
.page-desc { max-width: 640px; font-size: 14.5px; line-height: 1.7; }

.panel,
.media-card,
.task-card,
.workbench,
.word-hero {
  border-color: rgb(220 235 231 / .9);
  border-radius: 22px;
  background: rgb(255 255 255 / .96);
  box-shadow: 0 12px 32px rgb(19 42 38 / .07);
}

.primary-button,
.btn-primary {
  border-radius: 14px;
  background: linear-gradient(145deg, #17a58a, #0a6555);
  box-shadow: 0 12px 28px rgb(10 101 85 / .22), inset 0 1px 0 rgb(255 255 255 / .22);
}
.primary-button:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(145deg, #12967e, #085a4c);
  box-shadow: 0 16px 36px rgb(10 101 85 / .24);
}
.secondary-button,
.btn-secondary {
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #fff;
}

.chip { font-weight: 800; }
.chip-primary { background: #e4f5f0; color: #0a6555; }

/* Home */
.home-workbench { gap: 24px; }

.home-hero {
  overflow: hidden;
  border: 1px solid rgb(7 70 60 / .28);
  border-radius: 30px;
  background:
    radial-gradient(circle at 86% 12%, rgb(255 197 92 / .2), transparent 28%),
    radial-gradient(circle at 12% 88%, rgb(106 165 248 / .12), transparent 28%),
    linear-gradient(125deg, #075e54 0%, #0d9488 48%, #2dd4bf 100%);
  box-shadow: 0 28px 78px rgb(5 48 42 / .2), inset 0 1px 0 rgb(255 255 255 / .08);
}
.home-hero::before {
  background:
    linear-gradient(rgba(255 255 255 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255 255 255 / .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(118deg, transparent 30%, #000 82%);
}

.home-chip {
  border-color: rgb(255 255 255 / .24);
  background: rgb(255 255 255 / .12);
  color: #ecfff9;
}
.home-hero-greeting { color: rgb(236 255 249 / .78); }
.home-hero-title {
  max-width: 20ch;
  color: #fff;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
}
.home-hero-sub { max-width: 34rem; color: rgb(236 255 249 / .8); font-size: 15px; }
.home-btn {
  height: 50px;
  border-radius: 16px;
  font-size: 15px;
  cursor: pointer;
}
.home-btn.primary {
  background: linear-gradient(145deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 18px 38px rgb(234 88 12 / .26);
}
.home-btn.primary:hover {
  background: linear-gradient(145deg, #ea580c, #c2410c);
  box-shadow: 0 22px 44px rgb(234 88 12 / .3);
}
.home-btn.secondary {
  border: 1px solid rgb(255 255 255 / .24);
  background: rgb(255 255 255 / .1);
}

.home-overview {
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 26px;
  background: linear-gradient(150deg, rgb(255 255 255 / .16), rgb(255 255 255 / .06));
  box-shadow: 0 20px 50px rgb(4 35 31 / .18), inset 0 1px 0 rgb(255 255 255 / .14);
  padding: 24px;
  backdrop-filter: blur(18px);
}
.home-ring { width: 156px; }
.home-ring svg { width: 156px; height: 156px; }
.home-ring .value { stroke: #2dd4bf; }
.home-overview-stats > div { border-top-color: rgb(255 255 255 / .16); padding-top: 13px; }

.home-workbench .home-heatmap {
  border: 1px solid rgb(220 235 231 / .9);
  border-radius: 26px;
  background: rgb(255 255 255 / .96);
  box-shadow: 0 12px 32px rgb(19 42 38 / .07);
  padding: 26px;
}
.home-workbench .heatmap-title { font-size: 23px; }
.home-workbench .heatmap-stat {
  border: 1px solid #e2efeb;
  border-radius: 17px;
  background: linear-gradient(145deg, #fff 0%, #fafdfc 100%);
  box-shadow: 0 4px 14px rgb(19 42 38 / .04);
}
.home-workbench .heatmap-stat::before { border-top: 2px solid #12a186; }

.home-project-grid { grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 20px; }
.home-project-card {
  overflow: hidden;
  border: 1px solid rgb(220 235 231 / .9);
  border-radius: 22px;
  background: rgb(255 255 255 / .96);
  box-shadow: 0 12px 32px rgb(19 42 38 / .07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-project-card:hover {
  border-color: #b9e2d6;
  box-shadow: 0 22px 52px rgb(19 42 38 / .12);
  transform: translateY(-3px);
}
.home-project-cover { aspect-ratio:3/4; background: linear-gradient(145deg, #eef9f6, #e7f3ef); }
.home-project-cover::after {
  background: linear-gradient(180deg, rgb(6 43 38 / .12) 0%, transparent 38%, rgb(6 43 38 / .24) 100%);
}
.home-project-body { padding: 17px 18px 18px; }
.home-project-title-row h3 { font-size: 17px; }
.home-project-meta span { background: #f3f9f7; color: #66817c; }
.home-progress { background: #e6f2ee; }
.home-progress span { background: linear-gradient(90deg, #1bab8c, #0a6555); }
.home-project-progress-meta { color: #66817c; }
.home-project-progress-meta strong { color: var(--ui-ink); }

/* Project cards and lists */
.media-card { border-radius: 22px; }
.media-card-media { aspect-ratio:3/4; }
.media-card-media img { transform: translateZ(0); }
.media-card:hover {
  border-color: #b9e2d6;
  box-shadow: 0 22px 52px rgb(19 42 38 / .12);
  transform: translateY(-3px);
}
.media-card .card-title { color: var(--ui-ink); font-size: 17px; }
.media-card .card-text { color: var(--ui-body); font-size: 13.5px; line-height: 1.6; }

.page-header { align-items: flex-start; margin-bottom: 28px; }
.breadcrumb { color: var(--ui-muted); font-size: 13px; font-weight: 700; }
.breadcrumb a:hover { color: var(--ui-primary); }
.filter-row .input { border-radius: 14px; }

/* Word workbench */
.word-hero {
  overflow: hidden;
  padding: 26px;
  position: relative;
}
.word-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #17a58a, #f26d4f, #ffc85c);
}
.word-hero-title { color: var(--ui-ink); font-size: clamp(36px, 4vw, 48px); font-weight: 700; }
.word-hero-subtitle { color: var(--ui-primary-hover); font-size: 16px; }
.word-hero-phrase {
  border-color: #d9ece7;
  border-radius: 16px;
  background: linear-gradient(145deg, #f2fbf8 0%, #fbfefc 100%);
  padding: 12px 14px;
}

.workbench { overflow: hidden; }
.workbench-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--ui-line);
  background: linear-gradient(180deg, #fbfdfc, #f7faf9);
  padding: 14px;
}
.workbench-tab {
  border-radius: 16px;
  padding: 14px 16px;
}
.workbench-tab.active {
  border-color: #bce4d8;
  background: #fff;
  color: var(--ui-primary-hover);
  box-shadow: 0 10px 26px rgb(19 42 38 / .08);
}
.workbench-panel { padding: 24px 26px 28px; }
.step-rail { gap: 12px; margin-bottom: 22px; }
.step-tab {
  min-height: 64px;
  border: 1px solid #e0efeb;
  border-radius: 16px;
  background: #f8fbfa;
  color: var(--ui-body);
  padding: 11px;
}
.step-tab.active {
  border-color: #12a186;
  background: #ecfaf6;
  color: #0a6555;
  box-shadow: 0 10px 24px rgb(13 122 104 / .1);
}
.step-index { background: #e5f0ed; color: var(--ui-body); }
.step-tab.active .step-index { background: #12a186; color: #fff; }
.step-state.done { background: #17a58a; }
.step-card {
  border: 1px solid #e0efeb;
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfdfc 0%, #ffffff 100%);
  box-shadow: 0 10px 28px rgb(19 42 38 / .05);
  padding: 24px;
}
.step-head h3 { color: var(--ui-ink); font-size: 17px; }
.step-head p { color: var(--ui-muted); }
.step-footer { border-top-color: #e7f1ee; margin-top: 22px; padding-top: 17px; }
.step-form .input { border-radius: 13px; }
.media-card-media { background: linear-gradient(145deg, #f3faf7, #ecf6f2); }
.empty-media { background: linear-gradient(135deg, #f0fdfa 0%, #fff7ed 100%); }

@media (min-width: 900px) {
  .app-main { padding: 40px 42px 48px; }
}

@media (max-width: 1080px) {
  .app-main { padding: 30px 24px 42px; }
}

@media (max-width: 640px) {
  .app-main { padding: 22px 16px 86px; }
  .home-hero { border-radius: 24px; padding: 23px 20px; }
  .home-workbench .home-heatmap { padding: 20px; }
  .workbench-panel { padding: 18px 16px 20px; }
  .step-card { padding: 18px; }
  .word-hero { padding: 21px; }
}

@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fade-in .36s cubic-bezier(.22, 1, .36, 1); }
  .fade-in-up { animation: fade-in-up .42s cubic-bezier(.22, 1, .36, 1); }
}
