@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --bg-main: #f8fcf9;
  --bg-surface: #FFFFFF;
  --text-main: #1a2c24;
  --text-muted: #60746a;
  --border-soft: #d9e8df;

  --primary: #1f9d62;
  --primary-dark: #136a40;
  --primary-ink: #0f5e3b;
  --primary-soft: #e7f6ed;
  --secondary: #7bcfa8;
  --accent-blue: #2a7be4;
  --accent-blue-soft: #e9f1ff;
  --accent-amber: #cc8818;
  --accent-amber-soft: #fff3df;
  --accent-coral: #ce5b43;
  --accent-coral-soft: #ffece7;
  --accent-violet: #7454cb;
  --accent-violet-soft: #f1ebff;
  --accent-teal: #108a83;
  --accent-teal-soft: #e5f8f6;
  --accent-slate: #5a6d88;
  --accent-slate-soft: #ecf2f9;

  --highlight-same: rgba(47, 170, 112, 0.18);
  --highlight-other: rgba(42, 123, 228, 0.16);

  --dash-ink: #173b2f;
  --dash-card-border: #d7eadf;
  --dash-hero-start: #e8f8ef;
  --dash-hero-mid: #f7fcf9;
  --dash-hero-end: #eef9f2;
  --dash-accent: #1f9d62;
  --dash-accent-2: #45b67b;
  --dash-accent-3: #0f7f50;

  --bs-primary: var(--primary);
  --bs-primary-rgb: 31, 157, 98;
  --bs-secondary: var(--secondary);
  --bs-secondary-rgb: 123, 207, 168;
  --bs-link-color: var(--primary);
  --bs-border-color: var(--border-soft);
  --bs-body-bg: var(--bg-main);
  --bs-body-color: var(--text-main);
  --bs-body-color-rgb: 26, 44, 36;
}

body {
  background:
    radial-gradient(circle at 90% 0%, rgba(42, 123, 228, 0.08), transparent 34%),
    radial-gradient(circle at 8% 2%, rgba(31, 157, 98, 0.11), transparent 36%),
    linear-gradient(180deg, #fcfefd 0%, var(--bg-main) 100%);
  color: var(--text-main);
  font-family: "Plus Jakarta Sans", "Instrument Sans", "Segoe UI", sans-serif;
  min-height: 100vh;
}

#nprogress .bar {
  background: linear-gradient(90deg, #1f9d62 0%, #58c98c 100%) !important;
  height: 3px !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px rgba(31, 157, 98, 0.45), 0 0 5px rgba(31, 157, 98, 0.35) !important;
}

#nprogress .spinner-icon {
  border-top-color: #1f9d62 !important;
  border-left-color: #1f9d62 !important;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.form-control,
.form-select,
.input-group-text {
  border-radius: 12px;
  border-color: var(--border-soft);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(31, 157, 98, 0.18);
  border-color: var(--primary);
}

.ts-wrapper.single .ts-control {
  border-radius: 12px;
  min-height: 42px;
  border-color: var(--border-soft);
  padding: 0.5rem 0.75rem;
  box-shadow: none;
  background: #ffffff;
}

.ts-wrapper.single.input-active .ts-control,
.ts-wrapper.focus .ts-control {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 157, 98, 0.18);
}

.ts-dropdown {
  border-color: var(--border-soft);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.ts-dropdown .option.active {
  background: #eaf8f0;
  color: #0f5e3b;
}

main {
  padding-bottom: 4rem;
}

.balance-warning-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  z-index: 1800;
  pointer-events: none;
}

.balance-warning-banner.is-visible {
  pointer-events: auto;
}

.balance-warning-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #f0cf89;
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 205, 112, 0.32), transparent 40%),
    linear-gradient(145deg, #fff9ed 0%, #fff4df 60%, #ffefcf 100%);
  box-shadow: 0 12px 24px rgba(102, 74, 22, 0.18);
  padding: 11px 14px;
}

.balance-warning-text {
  color: #6a480f;
  font-weight: 700;
  font-size: 0.92rem;
}

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

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10px;
}

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

.mk-page {
  --mk-bg: #f2f7f3;
  --mk-surface: #ffffff;
  --mk-text: #163126;
  --mk-muted: #5d756b;
  --mk-border: #d6e8dc;
  --mk-primary: #1f9d62;
  --mk-primary-dark: #157949;
  --mk-primary-soft: #eaf8ef;
  --mk-shadow: 0 14px 28px rgba(12, 82, 50, 0.1);
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 4px 44px;
  color: var(--mk-text);
}

.mk-nav {
  position: sticky;
  top: 10px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid var(--mk-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  box-shadow: var(--mk-shadow);
}

.mk-brand {
  display: inline-flex;
  align-items: center;
  color: var(--mk-text);
  text-decoration: none;
  font-weight: 800;
}

.mk-brand-wordmark {
  width: auto;
  height: 34px;
  display: block;
}

.mk-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.mk-nav-links a {
  font-weight: 700;
  font-size: 0.9rem;
  color: #2f5a46;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.mk-nav-links a:hover,
.mk-nav-links a.active {
  border-color: #cde5d7;
  background: #f6fcf8;
  color: #144f36;
}

.mk-nav-actions {
  display: inline-flex;
  gap: 8px;
}

.mk-hero {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 14px;
  border: 1px solid var(--mk-border);
  border-radius: 24px;
  padding: 24px;
  background:
    radial-gradient(520px 240px at 0% -10%, rgba(31, 157, 98, 0.14), transparent 72%),
    linear-gradient(145deg, #f7fcf9 0%, #eff8f3 56%, #f8fcfa 100%);
  box-shadow: var(--mk-shadow);
}

.mk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1f6f49;
  border: 1px solid #cde5d7;
  border-radius: 999px;
  background: #ffffff;
  padding: 7px 12px;
}

.mk-hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
  color: #123d2b;
}

.mk-hero p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.72;
  color: var(--mk-muted);
  max-width: 56ch;
}

.mk-hero-points {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.mk-hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #285541;
  font-weight: 600;
  font-size: 0.92rem;
}

.mk-hero-points i {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dff3e8;
  color: #1f9d62;
  font-size: 0.7rem;
}

.mk-hero-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mk-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mk-kpi-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mk-stat {
  border: 1px solid #d7e9de;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
}

.mk-stat .value {
  display: block;
  font-size: 1.2rem;
  line-height: 1.1;
  color: #11573a;
  font-weight: 800;
}

.mk-stat .label {
  display: block;
  font-size: 0.78rem;
  color: #5f786e;
  font-weight: 700;
}

.mk-hero-card {
  border: 1px solid #cfe5d8;
  border-radius: 18px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 14px 24px rgba(13, 72, 47, 0.1);
  animation: mkFloat 5s ease-in-out infinite;
}

.mk-hero-card h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #134a32;
}

.mk-mini-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mk-mini-grid > div {
  border: 1px solid #d6e8dc;
  border-radius: 12px;
  padding: 9px 10px;
  background: #f8fcfa;
}

.mk-mini-grid span {
  display: block;
  font-size: 0.72rem;
  color: #688178;
  font-weight: 700;
}

.mk-mini-grid strong {
  display: block;
  margin-top: 2px;
  color: #17583b;
  font-size: 1rem;
}

.mk-progress-lines {
  margin-top: 12px;
}

.mk-progress-lines p {
  margin: 8px 0 4px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #5f786e;
  font-weight: 700;
}

.mk-progress-lines div {
  height: 9px;
  border-radius: 999px;
  background: #e2f0e8;
  overflow: hidden;
}

.mk-progress-lines i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f9d62 0%, #4db985 100%);
  animation: mkGrow 1.3s ease both;
}

.mk-hero-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: #5f786e;
}

.mk-section {
  margin-top: 18px;
  border: 1px solid var(--mk-border);
  border-radius: 22px;
  background: var(--mk-surface);
  padding: 22px;
  box-shadow: var(--mk-shadow);
}

.mk-section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  color: #113b29;
}

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

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

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

.mk-grid article {
  border: 1px solid #d7e9de;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f7fcf9 100%);
  padding: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mk-grid article:hover {
  transform: translateY(-3px);
  border-color: #c6dfd1;
  box-shadow: 0 12px 22px rgba(12, 75, 46, 0.1);
}

.mk-grid i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f9d62;
  background: #ebf8f1;
  border: 1px solid #cfe8da;
}

.mk-grid h3 {
  margin: 10px 0 6px;
  font-size: 1.22rem;
  color: #154d34;
}

.mk-grid p {
  margin: 0;
  color: var(--mk-muted);
  font-size: 0.91rem;
  line-height: 1.58;
}

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

.mk-step-card {
  border: 1px solid #d7e9de;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f7fcf9 100%);
  padding: 14px;
}

.mk-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1a6b45;
  background: #e3f4eb;
}

.mk-step-card h3 {
  margin: 10px 0 6px;
  font-size: 1.08rem;
  color: #154d34;
}

.mk-step-card p {
  margin: 0;
  color: var(--mk-muted);
  line-height: 1.56;
  font-size: 0.9rem;
}

.mk-content {
  margin-top: 14px;
  border: 1px solid var(--mk-border);
  border-radius: 22px;
  background: linear-gradient(145deg, #f7fcf9 0%, #eff8f3 100%);
  padding: 22px;
  box-shadow: var(--mk-shadow);
}

.mk-content h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: #113f2b;
}

.mk-content p {
  margin-top: 10px;
  max-width: 70ch;
  color: var(--mk-muted);
  line-height: 1.75;
}

.mk-content a {
  color: #137949;
  font-weight: 700;
}

.mk-cta {
  margin-top: 18px;
  text-align: center;
  border: 1px solid #cde5d7;
  border-radius: 22px;
  background: linear-gradient(145deg, #f2fbf6 0%, #e9f8ef 70%, #f6fcf9 100%);
  padding: 26px;
  box-shadow: var(--mk-shadow);
}

.mk-cta h2 {
  margin: 0;
  color: #11412c;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
}

.mk-cta p {
  margin: 8px 0 14px;
  color: #5f786e;
}

@keyframes mkGrow {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}

@keyframes mkFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}



@media (prefers-reduced-motion: reduce) {
  .mk-hero-card,
  .mk-step-card,
  .mk-grid article,
  .mk-progress-lines i {
    animation: none;
    transition: none;
    transform: none;
  }
}

.app-top-header {
  position: sticky;
  top: 10px;
  z-index: 900;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #d6e7de;
  background:
    radial-gradient(circle at 95% 16%, rgba(42, 123, 228, 0.09), transparent 38%),
    radial-gradient(circle at 72% -15%, rgba(31, 157, 98, 0.15), transparent 52%),
    linear-gradient(132deg, #ffffff 0%, #f9fdfb 56%, #f2faf6 100%);
  box-shadow: 0 10px 24px rgba(15, 88, 56, 0.1);
}

.app-top-left {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 0 0 auto;
}

.app-top-page-name {
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #174a33;
}

.app-top-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.app-top-chip {
  --chip-icon-color: #1d6a45;
  --chip-icon-bg: #e9f6f0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-width: 38px;
  height: 38px;
  gap: 6px;
  font-size: 0.76rem;
  color: #365346;
  border: 1px solid #d4e5dc;
  border-radius: 999px;
  padding: 0 10px 0 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfefd 100%);
  font-weight: 600;
  overflow: hidden;
  cursor: default;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.app-top-chip[href] {
  cursor: pointer;
}

.app-top-chip i {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--chip-icon-color);
  background: var(--chip-icon-bg);
  font-size: 0.84rem;
  flex: 0 0 auto;
}

.app-top-chip .chip-text {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: max-width 0.24s ease, opacity 0.16s ease, margin-left 0.24s ease;
}

.app-top-chip .chip-value {
  display: inline-block;
  color: var(--chip-icon-color);
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1;
  min-width: 0.3rem;
}

.app-top-chip:hover,
.app-top-chip:focus-visible {
  box-shadow: 0 9px 18px rgba(21, 74, 56, 0.12);
  border-color: #bdd7ca;
  transform: translateY(-1px);
}

.app-top-chip:hover .chip-text,
.app-top-chip:focus-visible .chip-text {
  max-width: 300px;
  opacity: 1;
  margin-left: 2px;
}

.chip-user { --chip-icon-color: #6a4dc2; --chip-icon-bg: #f1ecff; }
.chip-streak { --chip-icon-color: #c6553c; --chip-icon-bg: #ffece8; }
.chip-best { --chip-icon-color: #a36a10; --chip-icon-bg: #fff3de; }
.chip-language { --chip-icon-color: #375bbd; --chip-icon-bg: #edf1ff; }
.chip-balance { --chip-icon-color: #136b42; --chip-icon-bg: #e1f5eb; }
.chip-actions { --chip-icon-color: #1f80c8; --chip-icon-bg: #e8f4ff; }
.chip-words { --chip-icon-color: #0f8574; --chip-icon-bg: #e6f8f4; }
.chip-texts { --chip-icon-color: #1f8a5a; --chip-icon-bg: #e5f8ef; }
.chip-date { --chip-icon-color: #5b6880; --chip-icon-bg: #edf1f7; }

.app-shell-auth {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.app-left-sidebar {
  position: sticky;
  top: 14px;
  align-self: start;
  height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 94% 8%, rgba(42, 123, 228, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfefc 42%, #f4faf7 100%);
  border: 1px solid #d3e4db;
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #136a44;
  margin-bottom: 8px;
}

.app-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  flex: 0 0 auto;
}

.app-logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

.app-logo-mark.compact {
  width: 30px;
  height: 30px;
}

.app-brand-label {
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.app-brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f5d3a;
}

.app-brand-subtitle {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b8d7c;
  font-weight: 700;
}

.app-sidebar-meta {
  font-size: 0.76rem;
  color: #4e6b5b;
  margin-bottom: 10px;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  margin-right: -2px;
}

.app-sidebar-link,
.app-sidebar-summary,
.app-sidebar-sublink {
  --nav-accent: var(--primary);
  --nav-soft: var(--primary-soft);
  --nav-ink: var(--primary-dark);
}

.app-sidebar-link,
.app-sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px 10px;
  text-decoration: none;
  color: #2d4338;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.app-sidebar-link i,
.app-sidebar-summary i,
.app-sidebar-sublink i {
  width: 16px;
  text-align: center;
  color: var(--nav-accent);
}

.app-sidebar-link:hover,
.app-sidebar-sublink:hover {
  background: var(--nav-soft);
  color: var(--nav-ink);
  border-color: #d9e7e0;
}

.app-sidebar-link.active,
.app-sidebar-sublink.active {
  background: var(--nav-soft);
  color: var(--nav-ink);
  border-color: #c9ddd2;
  box-shadow: inset 0 0 0 1px rgba(15, 94, 62, 0.06);
}

.app-sidebar-link.active i,
.app-sidebar-sublink.active i {
  color: var(--nav-ink);
}

.app-sidebar-group {
  border-top: 1px dashed #d8e9df;
  margin-top: 8px;
  padding-top: 8px;
}

.app-sidebar-summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2d4338;
  border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.app-sidebar-summary::-webkit-details-marker {
  display: none;
}

.app-sidebar-summary:hover {
  background: var(--nav-soft);
  color: var(--nav-ink);
  border-color: #d9e7e0;
}

.app-sidebar-submenu {
  margin-top: 6px;
  padding-left: 14px;
}

.app-sidebar-sublink {
  font-size: 0.84rem;
  font-weight: 600;
}

.nav-texts { --nav-accent: #1f9d62; --nav-soft: #e7f6ed; --nav-ink: #11643e; }
.nav-flashcards { --nav-accent: #2a7be4; --nav-soft: #e9f1ff; --nav-ink: #1a5fc3; }
.nav-review { --nav-accent: #cc8818; --nav-soft: #fff3df; --nav-ink: #935e0b; }
.nav-review-page { --nav-accent: #7454cb; --nav-soft: #f1ebff; --nav-ink: #56389c; }
.nav-review-choice { --nav-accent: #ce5b43; --nav-soft: #ffece7; --nav-ink: #9a3f2d; }
.nav-review-match { --nav-accent: #108a83; --nav-soft: #e5f8f6; --nav-ink: #0f6762; }
.nav-dashboard { --nav-accent: #247ecf; --nav-soft: #e8f2ff; --nav-ink: #1f5f9a; }
.nav-profile { --nav-accent: #6a4dc2; --nav-soft: #f2edff; --nav-ink: #50359a; }
.nav-payment { --nav-accent: #ba7a14; --nav-soft: #fff1dc; --nav-ink: #8f5907; }
.nav-usage { --nav-accent: #11827d; --nav-soft: #e4f7f5; --nav-ink: #0d645f; }
.nav-admin { --nav-accent: #a1324a; --nav-soft: #ffeaf0; --nav-ink: #7e2437; }
.nav-settings { --nav-accent: #5a6d88; --nav-soft: #edf2f9; --nav-ink: #405267; }

.app-sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-sidebar-footer form {
  margin: 0;
}

.app-sidebar-footer-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #d6e7dc;
  background: linear-gradient(135deg, #f1fbf5 0%, #ffffff 100%);
  padding: 9px 10px;
  text-decoration: none;
  color: #183c2e;
}

.app-sidebar-user:hover {
  border-color: #b9d8c5;
  background: #edf9f2;
  color: #123728;
}

.app-sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f5d3a;
  background: #dff3e8;
  border: 1px solid #cbe8d8;
  flex: 0 0 auto;
  overflow: hidden;
}

.app-sidebar-user-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.app-sidebar-user-meta {
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}

.app-sidebar-user-email {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f3a2d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.app-sidebar-user-link {
  font-size: 0.72rem;
  color: #2d8158;
  font-weight: 600;
}

.sidebar-toggle-btn {
  position: fixed;
  left: 14px;
  top: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid #cce2d4;
  border-radius: 10px;
  background: #ffffff;
  color: #1e7b52;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  z-index: 1200;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1090;
}

body.sidebar-collapsed .app-shell-auth {
  grid-template-columns: 82px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .app-sidebar-meta {
  display: none;
}

body.sidebar-collapsed .app-sidebar-brand,
body.sidebar-collapsed .app-sidebar-summary,
body.sidebar-collapsed .app-sidebar-link,
body.sidebar-collapsed .app-sidebar-sublink,
body.sidebar-collapsed .app-sidebar-footer-btn {
  justify-content: center;
}

body.sidebar-collapsed .app-sidebar-submenu {
  display: none;
}

body.sidebar-collapsed .app-sidebar-group {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

body.sidebar-collapsed .app-sidebar-user {
  justify-content: center;
  padding: 8px;
}



.content-wrapper {
  max-width: 1160px;
  margin: 0 auto;
}

.profile-form-card {
  max-width: 720px;
}

.account-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-hero {
  border-color: #d3e7da;
  background:
    radial-gradient(circle at 86% 15%, rgba(123, 207, 168, 0.26), transparent 38%),
    linear-gradient(135deg, #f0fbf4 0%, #fcfffd 58%, #eef9f2 100%);
}

.account-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.82rem);
  letter-spacing: -0.02em;
  color: #133f2f;
}

.account-subtitle {
  color: #597c6c;
  font-size: 0.95rem;
}

.account-alert {
  border-radius: 14px;
}

.account-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
}

.account-side-card {
  align-self: start;
  border-color: #d8e9df;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf9 100%);
}

.account-avatar-xl,
.account-photo-preview {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  border-radius: 999px;
  border: 1px solid #cbe5d7;
  background: #e5f5ec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #145f3d;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 88, 56, 0.12);
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-side-email {
  margin-top: 14px;
  text-align: center;
  font-weight: 700;
  color: #18382d;
  word-break: break-word;
}

.account-side-since {
  margin-top: 4px;
  text-align: center;
  color: #5d7d6d;
  font-size: 0.82rem;
}

.account-side-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.account-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d6e8de;
  border-radius: 999px;
  background: #f3faf6;
  color: #2f5846;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
}

.account-main-card,
.settings-main-card,
.settings-side-card {
  border-color: #d8e9df;
  background: linear-gradient(180deg, #ffffff 0%, #f9fdfb 100%);
}

.account-section {
  border: 1px solid #deece3;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.account-section + .account-section {
  margin-top: 12px;
}

.account-section-title {
  margin: 0 0 12px;
  font-size: 0.98rem;
  color: #1f4d3b;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-section-title i {
  color: #208556;
}

.account-field-label {
  font-size: 0.84rem;
  color: #355646;
  font-weight: 700;
}

.account-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.account-photo-preview {
  width: 120px;
  height: 120px;
}

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

.settings-switch {
  background: #f4faf7;
  border: 1px solid #dcebe2;
  border-radius: 12px;
  padding: 10px 12px;
}

.settings-switch .form-check-input {
  margin-top: 0;
}

.settings-side-card {
  align-self: start;
}

.extension-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.extension-download-card,
.extension-instructions-card,
.extension-smart-card {
  border-color: #d8e8df;
  background: linear-gradient(180deg, #ffffff 0%, #f9fdfb 100%);
}

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

.extension-steps {
  padding-left: 1.15rem;
  display: grid;
  gap: 10px;
}

.extension-steps li {
  color: #2f4d40;
}

.extension-steps code {
  color: #175e3d;
  background: #edf8f2;
  border-radius: 8px;
  padding: 0.16rem 0.38rem;
}

.extension-smart-form .form-label {
  font-weight: 700;
  color: #1f4d3a;
}

.extension-smart-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.extension-smart-lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #335f51;
  background: #ecf8f3;
  border: 1px solid #d5eadf;
  border-radius: 10px;
  padding: 8px 10px;
}

.extension-smart-result {
  border: 1px solid #dce9e2;
  border-radius: 12px;
  background: #fbfefc;
  padding: 12px;
}

.extension-smart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #45695b;
  font-size: 0.9rem;
}

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

.payment-balance-card,
.payment-form-card {
  border-color: #d8e9df;
  background: linear-gradient(180deg, #ffffff 0%, #f9fdfb 100%);
}

.payment-balance-card {
  align-self: start;
}

.payment-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4d705f;
  font-weight: 800;
}

.payment-balance-value {
  margin-top: 8px;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: #145c3a;
  font-weight: 800;
}

.payment-note {
  margin-top: 8px;
  color: #5d7d6d;
  font-size: 0.85rem;
}

.payment-quick-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.payment-quick-btn {
  font-weight: 700;
}

.usage-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.usage-hero {
  border-color: #d4e7dc;
  background:
    radial-gradient(circle at 88% 12%, rgba(127, 213, 167, 0.24), transparent 42%),
    radial-gradient(circle at 74% -12%, rgba(42, 123, 228, 0.08), transparent 36%),
    linear-gradient(135deg, #f1fbf5 0%, #ffffff 58%, #eff9f4 100%);
}

.usage-metrics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.usage-metric-card {
  --metric-accent: var(--primary);
  --metric-soft: var(--primary-soft);
  --metric-ink: var(--primary-dark);
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e9df;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  padding: 14px;
  box-shadow: 0 9px 20px rgba(16, 60, 43, 0.06);
}

.usage-metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--metric-accent) 0%, var(--metric-soft) 100%);
}

.usage-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.usage-metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--metric-soft);
  color: var(--metric-accent);
  font-size: 0.86rem;
  border: 1px solid #d7e7df;
}

.usage-metric-label {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--metric-ink);
}

.usage-metric-value {
  margin-top: 5px;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.15;
  font-weight: 800;
  color: #1a4232;
}

.usage-metric-sub {
  margin-top: 4px;
  color: #5f756a;
  font-size: 0.8rem;
}

.usage-metric-requests {
  --metric-accent: #1f9d62;
  --metric-soft: #e7f6ed;
  --metric-ink: #11643e;
}

.usage-metric-tokens {
  --metric-accent: #2a7be4;
  --metric-soft: #e9f1ff;
  --metric-ink: #1c5fba;
}

.usage-metric-cached {
  --metric-accent: #7454cb;
  --metric-soft: #f1ebff;
  --metric-ink: #53379a;
}

.usage-metric-voice {
  --metric-accent: #0f766e;
  --metric-soft: #e3faf7;
  --metric-ink: #0f5f59;
}

.usage-metric-audio {
  --metric-accent: #2563eb;
  --metric-soft: #e9f1ff;
  --metric-ink: #1f4db2;
}

.usage-metric-cost {
  --metric-accent: #cc8818;
  --metric-soft: #fff3df;
  --metric-ink: #935e0b;
}

.usage-panel {
  border-color: #d8e8df;
  background:
    radial-gradient(circle at 96% 10%, rgba(42, 123, 228, 0.05), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  box-shadow: 0 10px 22px rgba(13, 51, 36, 0.05);
}

.usage-panel-title {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #184133;
  font-weight: 800;
}

.usage-chart-wrap {
  position: relative;
  min-height: 330px;
  border: 1px solid #dfe9e3;
  border-radius: 14px;
  background: #fcfffd;
  padding: 8px 10px 2px;
}

.usage-table th {
  color: #365a4c;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: #f4f9f6;
  border-bottom-color: #d9e8e0;
}

.usage-table td {
  vertical-align: middle;
  font-size: 0.86rem;
  border-color: #e5efe9;
}

.usage-assistant-name {
  font-weight: 800;
  color: #1d4a39;
}

.usage-assistant-desc {
  color: #587064;
  min-width: 220px;
}

.usage-table tbody tr:nth-child(even) {
  background: #fbfefd;
}

.usage-table code {
  color: #14583a;
  font-weight: 700;
  background: #edf8f2;
  border-radius: 8px;
  padding: 0.16rem 0.38rem;
}



.texts-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.texts-hero {
  border-color: #d1e6d9;
  background:
    radial-gradient(circle at 88% 12%, rgba(127, 213, 167, 0.3), transparent 40%),
    linear-gradient(135deg, #f0fbf4 0%, #fcfffd 55%, #eef8f2 100%);
}

.texts-hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.texts-hero-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

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

.texts-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #dff3e8 0%, #c7ead8 100%);
  border: 1px solid #bfe1cd;
  color: #166b44;
  font-size: 1.08rem;
  box-shadow: 0 10px 18px rgba(21, 121, 73, 0.14);
}

.texts-hero-title {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  letter-spacing: -0.02em;
  color: #133d2f;
}

.texts-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.texts-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #d0e5d8;
  background: #ffffff;
  color: #214335;
  font-size: 0.78rem;
  font-weight: 600;
}

.texts-stat-chip i {
  font-size: 0.8rem;
}

.texts-stat-chip strong {
  color: #123e2f;
  font-size: 0.84rem;
}

.texts-stat-chip small {
  color: #628273;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.texts-stat-chip.is-total i { color: #2563eb; }
.texts-stat-chip.is-complete i { color: #15803d; }
.texts-stat-chip.is-progress i { color: #ea580c; }
.texts-stat-chip.is-avg i { color: #7c3aed; }

.texts-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.texts-filter-card {
  border-color: #dcebe2;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
}

.texts-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #1a3f32;
}

.texts-filter-label i {
  color: #268659;
  font-size: 0.84rem;
}

.texts-filter-actions .btn {
  min-height: 42px;
}

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

.text-story-card {
  border-color: #dbeae1;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.text-story-card:hover {
  transform: translateY(-2px);
  border-color: #c8dfd1;
  box-shadow: 0 14px 28px rgba(14, 58, 39, 0.11) !important;
}

.text-story-title {
  margin: 0;
  font-size: clamp(1.08rem, 1.5vw, 1.45rem);
  letter-spacing: -0.01em;
  color: #172d24;
}

.text-story-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.text-story-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d9e9e0;
  background: #f6fbf8;
  color: #355a4a;
  font-size: 0.79rem;
  font-weight: 600;
}

.text-story-meta i {
  color: #248356;
}

.text-story-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  border-color: #d9e9e0 !important;
  background: #f8fcf9 !important;
  color: #284d3d !important;
}

.text-story-tag i {
  color: #3f8f66;
  font-size: 0.67rem;
}

.text-story-actions {
  flex-wrap: wrap;
}

.text-progress-block {
  border: 1px solid #dbece2;
  border-radius: 14px;
  padding: 12px 13px 11px;
  background: linear-gradient(180deg, #fbfefc 0%, #f5faf7 100%);
}

.text-progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.text-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #244c3b;
}

.text-progress-label i {
  color: #1f9d62;
}

.text-progress-percent {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #def3e7;
  border: 1px solid #c5e7d4;
  color: #166d45;
  font-weight: 800;
  font-size: 0.78rem;
}

.text-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #e5f1ea;
  overflow: hidden;
  border: 1px solid #d2e8dc;
}

.text-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f9d62 0%, #2fb174 58%, #5ac990 100%);
  box-shadow: 0 0 0 1px rgba(22, 109, 69, 0.14), 0 4px 12px rgba(31, 157, 98, 0.28);
}

.text-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 32%,
    transparent 64%
  );
  transform: translateX(-120%);
  animation: textProgressShine 2.3s ease-in-out infinite;
}

.text-progress-caption {
  margin-top: 7px;
  font-size: 0.77rem;
  color: #557669;
  font-weight: 600;
}

.texts-pagination .pagination {
  gap: 4px;
}

.texts-pagination .page-link {
  border-radius: 10px;
  border-color: #d7e8de;
  color: #1d6f48;
  font-weight: 700;
}

.texts-pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.texts-pagination .page-item.disabled .page-link {
  background: #f4faf6;
  color: #9db7aa;
}

@keyframes textProgressShine {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(130%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .text-story-card {
    transition: none;
  }

  .text-story-card:hover {
    transform: none;
  }

  .text-progress-fill::after {
    animation: none;
  }
}


.reading-wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

.reading-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #d2e8da;
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(132deg, #f6fcf8 0%, #ecf7f1 58%, #f2fbf6 100%);
  box-shadow: 0 14px 28px rgba(15, 89, 57, 0.1);
}

.reading-hero::before,
.reading-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.reading-hero::before {
  width: 280px;
  height: 280px;
  top: -170px;
  right: -90px;
  background: radial-gradient(circle, rgba(47, 170, 112, 0.22) 0%, rgba(47, 170, 112, 0) 70%);
}

.reading-hero::after {
  width: 220px;
  height: 220px;
  bottom: -140px;
  left: -90px;
  background: radial-gradient(circle, rgba(30, 144, 255, 0.12) 0%, rgba(30, 144, 255, 0) 72%);
}

.reading-hero-main,
.reading-hero-controls {
  position: relative;
  z-index: 1;
}

.reading-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.reading-hero-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.reading-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d5e9dc;
  background: rgba(255, 255, 255, 0.8);
  color: #2b6f50;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reading-hero-title {
  margin: 14px 0 10px;
  font-size: clamp(1.5rem, 2.7vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #153e2d;
}

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

.reading-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2f5f49;
  background: #ffffff;
  border: 1px solid #d5e8dc;
}

.reading-hero-chip i {
  color: #1f9d62;
  font-size: 0.8rem;
}

.reading-hero-progress {
  --reading-progress: 0%;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 330px;
  border-radius: 22px;
  border: 1px solid #cfe5d8;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 252, 248, 0.95) 100%);
  box-shadow: 0 10px 24px rgba(15, 88, 56, 0.1);
  padding: 14px 16px;
}

.reading-progress-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(#1f9d62 0 var(--reading-progress), #dceee3 var(--reading-progress) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(31, 157, 98, 0.12), 0 8px 16px rgba(15, 88, 56, 0.1);
  flex: 0 0 auto;
}

.reading-progress-ring-inner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fbfffc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.15rem;
  color: #14583a;
  letter-spacing: -0.01em;
}

.reading-progress-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.reading-progress-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f7669;
}

.reading-progress-count {
  margin-top: 5px;
  color: #214334;
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
  line-height: 1.15;
  font-weight: 800;
}

.reading-progress-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reading-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d6e8de;
  border-radius: 999px;
  background: #f6fbf8;
  color: #3c5f4f;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.34rem 0.62rem;
}

.reading-progress-pill i {
  color: #1f8d5a;
}

.reading-progress-pill strong {
  color: #125e3d;
  font-weight: 800;
}

.reading-hero-controls {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.reading-audio-controls {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 1250;
}

.reading-audio-controls-inner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(193, 215, 203, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(23, 55, 42, 0.1);
  backdrop-filter: blur(7px);
  padding: 7px 10px;
}

.reading-audio-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #3f5f50;
  padding: 0 4px 0 2px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-audio-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #d6e8de;
  background: #fdfefe;
  color: #276e4b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.reading-audio-btn:hover,
.reading-audio-btn:focus-visible {
  background: #f1f8f4;
  border-color: #bfd8cb;
  color: #17583a;
}

.reading-audio-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.reading-audio-stop {
  color: #955444;
}

.reading-audio-stop:hover,
.reading-audio-stop:focus-visible {
  color: #7d3a2a;
  background: #fff2ed;
  border-color: #f1cdc0;
}

.reading-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d3e8db;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.82);
  min-height: 42px;
}

.reading-switch .form-check-input {
  float: none;
  margin: 0;
}

.reading-switch .form-check-label {
  margin: 0;
  color: #2b5946;
  font-weight: 700;
  font-size: 0.86rem;
}

.reading-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d3e8db;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.82);
  min-height: 42px;
}

.reading-control i {
  color: #1f9d62;
}

.font-size-control .form-select {
  width: 108px;
  min-height: 32px;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

.detect-words-btn {
  min-height: 42px;
  border-radius: 999px;
  padding-inline: 14px;
  font-weight: 700;
}

.paragraph-actions {
  align-items: center;
}

.paragraph-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-weight: 700;
  min-height: 35px;
}

.paragraph-action-btn i {
  font-size: 0.86rem;
}

.record-paragraph {
  border-radius: 999px;
  min-height: 35px;
  font-weight: 700;
}

.record-paragraph i {
  color: #1e8f60;
}



@media (prefers-reduced-motion: reduce) {
  .reading-hero,
  .reading-hero-chip,
  .reading-switch,
  .reading-control,
  .detect-words-btn {
    transition: none;
  }
}

.card,
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card.shadow-sm {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.reading-paragraph {
  font-size: var(--reading-size, 18px);
  line-height: 1.85;
  margin-bottom: 22px;
  color: #1F2937;
  text-align: justify;
}

.book-page-text {
  white-space: pre-line;
}

.ocr-paste {
  background: #F8FAFC;
  cursor: pointer;
  border-style: dashed;
  border-color: var(--border-soft);
}

.ocr-paste.border-primary {
  border-color: var(--secondary) !important;
  background: rgba(123, 207, 168, 0.2);
}

.phrase-popup {
  position: fixed;
  z-index: 1060;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.paragraph-translation-wrap {
  border-top: 1px solid var(--border-soft);
  margin-top: 10px;
  padding-top: 10px;
}

.paragraph-reading-wrap {
  border-top: 1px solid var(--border-soft);
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 95% 6%, rgba(42, 123, 228, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfefd 0%, #f4faf7 100%);
  border: 1px solid #dce9e2;
}

.paragraph-reading-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.paragraph-reading-title-wrap {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.paragraph-reading-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7f6ed;
  color: #176543;
  border: 1px solid #cfe7d8;
  flex: 0 0 auto;
}

.paragraph-reading-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #234637;
  line-height: 1.2;
}

.paragraph-reading-title-sub {
  margin-top: 2px;
  color: #5b7569;
  font-size: 0.8rem;
}

.paragraph-reading-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.paragraph-reading-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #cfe2d7;
  padding: 0.28rem 0.62rem;
  font-weight: 700;
  font-size: 0.78rem;
  color: #2d5745;
  background: #f6fbf8;
}

.paragraph-reading-provider::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.paragraph-reading-provider.is-openai::before {
  content: "\f544";
  color: #1f9d62;
}

.paragraph-reading-provider.is-browser::before {
  content: "\f108";
  color: #2a7be4;
}

.paragraph-reading-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #d5e7de;
  padding: 0.26rem 0.6rem;
  font-weight: 700;
  font-size: 0.75rem;
  color: #4a6659;
  background: #ffffff;
}

.paragraph-reading-step i {
  color: #2c8664;
}

.paragraph-reading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.start-paragraph-recording,
.stop-paragraph-recording,
.cancel-paragraph-recording,
.play-user-recording,
.repeat-user-recording {
  border-radius: 999px;
  min-height: 35px;
  padding-inline: 11px;
  font-weight: 700;
}

.paragraph-reading-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid #d8e8df;
  background: #ffffff;
  padding: 0.3rem 0.7rem;
}

.paragraph-reading-status-icon {
  color: #3578c2;
  font-size: 0.85rem;
}

.paragraph-reading-status {
  display: inline;
  min-height: 0;
}

.paragraph-reading-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.paragraph-reading-score-item {
  border: 1px solid #dfe9e3;
  border-radius: 14px;
  background: #ffffff;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.paragraph-reading-transcription {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dfe9e3;
  min-height: 68px;
}

.paragraph-reading-loading,
.paragraph-reading-error {
  margin-bottom: 6px;
}

.paragraph-reading-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5e7669;
  font-weight: 700;
}

.paragraph-reading-label i {
  color: #2f8760;
}

.paragraph-reading-summary {
  white-space: pre-line;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #dfe9e3;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 6px;
}

.paragraph-reading-tips {
  margin-top: 8px;
  padding-left: 1.1rem;
}


.progress {
  height: 8px;
  border-radius: 999px;
  background: #e8f2eb;
}

.progress-bar {
  background-color: var(--primary);
  border-radius: 999px;
}

.word-token {
  cursor: pointer;
  text-decoration: none;
  padding: 0 2px;
  border-radius: 4px;
}

.word-token:hover {
  background: rgba(31, 157, 98, 0.14);
}

.phrase-explained {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.translation-block {
  white-space: pre-line;
}

body[data-native-rtl="true"] .translation-block {
  direction: rtl;
  text-align: right;
}

body[data-native-rtl="true"] .rtl-block {
  direction: rtl;
  text-align: right;
}

.fc-known-same {
  background: var(--highlight-same);
  font-weight: 600;
}

.fc-known-other {
  background: var(--highlight-other);
  font-weight: 600;
}

body[data-highlight-known="false"] .fc-known-same,
body[data-highlight-known="false"] .fc-known-other {
  background: transparent;
  text-decoration: none;
  font-weight: inherit;
}

.legend-chip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-chip.same {
  background: #2FAA70;
}

.legend-chip.other {
  background: #2a7be4;
}

.sticky-bottom-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-soft);
  padding: 0.75rem 0;
  z-index: 1020;
}

.flashcard-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
}

.flashcard-review-image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
}

.confidence-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #dc2626;
}

.confidence-0 { background: #dc2626; }
.confidence-1 { background: #f97316; }
.confidence-2 { background: #22c55e; }

.btn {
  border-radius: 12px;
  font-weight: 700;
  border-width: 1.5px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

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

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(31, 157, 98, 0.22);
}

.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #0f643d;
  --bs-btn-active-border-color: #0f643d;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-bg: #67ba92;
  --bs-btn-disabled-border-color: #67ba92;
  box-shadow: 0 10px 20px rgba(31, 157, 98, 0.22);
}

.btn-outline-primary {
  --bs-btn-color: var(--primary-ink);
  --bs-btn-border-color: #84c9a8;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
  --bs-btn-disabled-color: #95b7a6;
  --bs-btn-disabled-border-color: #d2e7da;
  background: #ffffff;
}

.btn-outline-secondary {
  --bs-btn-color: #2f5f49;
  --bs-btn-border-color: #c9decf;
  --bs-btn-hover-color: #1d4e37;
  --bs-btn-hover-bg: #eef8f2;
  --bs-btn-hover-border-color: #a8ccb8;
  --bs-btn-active-color: #1d4e37;
  --bs-btn-active-bg: #e4f2eb;
  --bs-btn-active-border-color: #9fc4b1;
  --bs-btn-disabled-color: #93aca0;
  --bs-btn-disabled-border-color: #d9e7de;
  background: #ffffff;
}

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

.flashcard-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.flashcard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.flashcard-card-v2 {
  border: 1px solid #d9e7de;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
}

.flashcard-card-body-v2 {
  padding: 1rem 1.05rem;
}

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

.flashcard-word-wrap {
  min-width: 0;
}

.flashcard-tts-btn {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.74rem;
  white-space: nowrap;
}

.flashcard-thumb-wide {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

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

.flashcard-info-block {
  border: 1px solid #e1ece5;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.flashcard-example {
  border-left: 3px solid #93cfb0;
  padding-left: 9px;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  max-width: 880px;
  margin: 0 auto;
}

.match-drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.match-drop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-tile {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--bg-surface);
  min-height: 88px;
  font-weight: 600;
  text-align: left;
  word-break: break-word;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transform: rotateY(0deg);
  user-select: none;
  touch-action: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.match-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.match-tile.selected {
  transform: rotateY(8deg);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.match-tile.draggable {
  border-style: dashed;
}

.match-tile.drop-hover {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(123, 207, 168, 0.28);
}

.match-tile.success {
  border-color: #2FAA70;
  box-shadow: 0 0 0 3px rgba(47, 170, 112, 0.2);
}

.match-tile.fail {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}

.match-tile.matched {
  display: none;
}

.match-word-title {
  font-size: 1.4rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.match-word-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.match-word-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.match-tts-btn {
  border: 1px solid #9ccfb4;
  border-radius: 999px;
  background: #eef9f3;
  color: #1f6a46;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  white-space: nowrap;
}

.match-tts-btn:hover {
  background: #def2e8;
}

.match-dontknow-btn {
  border: 1px solid #e8b7b3;
  border-radius: 999px;
  background: #fff4f3;
  color: #a03d37;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  white-space: nowrap;
}

.match-dontknow-btn:hover {
  background: #ffe8e5;
}

.match-dontknow-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.match-example-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.match-word-example {
  font-size: 0.98rem;
  line-height: 1.5;
  color: #355546;
  font-weight: 500;
}

.match-meaning-text {
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 600;
  width: 100%;
  text-align: left;
}

.match-translation-toggle {
  border: 0;
  background: #eaf8f0;
  color: #1f6643;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  width: fit-content;
}

.match-translation-text {
  display: none;
  width: 100%;
  border-top: 1px dashed #c8dfd1;
  padding-top: 7px;
  color: #4f6f60;
  font-size: 0.88rem;
  line-height: 1.4;
}

.match-tile.show-translation .match-translation-text {
  display: block;
}

.match-tile.disabled {
  opacity: 1;
  pointer-events: none;
  cursor: not-allowed;
}

.match-tile.revealed-answer {
  border-color: #2FAA70;
  box-shadow: 0 0 0 3px rgba(47, 170, 112, 0.15);
  background: #f4fcf8;
}

.match-tile.revealed-answer .match-word-title,
.match-tile.revealed-answer .match-meaning-text {
  color: #166240;
}

.match-tile.revealed-missed {
  border-color: #d94848;
  box-shadow: 0 0 0 3px rgba(217, 72, 72, 0.16);
  background: #fff3f3;
}

.match-tile.revealed-missed .match-word-title,
.match-tile.revealed-missed .match-meaning-text {
  color: #a12f2f;
}

.match-solved-word {
  width: 100%;
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px dashed #b9dcc7;
  color: #176242;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.match-solved-word.is-missed {
  border-top-color: #efb8b8;
  color: #a83535;
}

.review-page {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.review-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #143428;
}

.review-subtitle {
  margin: 6px 0 0;
  color: #557a68;
  font-size: 0.96rem;
}

.review-mode-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid #cfe4d7;
  background: #edf8f2;
}

.review-mode-btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #24563f;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.review-mode-btn:hover {
  background: #dff1e7;
  color: #123f2b;
}

.review-mode-btn.is-active {
  background: #1f9d62;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 157, 98, 0.25);
}

.review-feedback {
  border-radius: 14px;
  border: 1px solid #d7eadf;
  background: #ffffff;
  padding: 10px 12px;
  color: #355546;
}

.review-feedback.is-correct {
  border-color: #9ed6b7;
  background: #f2fbf6;
}

.review-feedback.is-wrong {
  border-color: #efb4ac;
  background: #fff7f6;
}

.review-empty-state {
  border: 1px solid #d7eadf;
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf9 100%);
  color: #547665;
  box-shadow: 0 10px 24px rgba(15, 88, 56, 0.08);
}

.review-card {
  border: 1px solid #d7eadf;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf9 100%);
  box-shadow: 0 12px 28px rgba(15, 88, 56, 0.1);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.review-card-headline {
  min-width: 0;
}

.review-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #5b7a6a;
  margin-bottom: 6px;
}

.review-word {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #163a2c;
}

.review-word-hidden {
  color: #2f5f4b;
  letter-spacing: 0;
}

.review-guess-hint {
  margin-top: 6px;
  color: #5f7d6e;
  font-size: 0.9rem;
  font-weight: 600;
}

.review-choose-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.review-choose-filter {
  border: 1px solid #dcebe2;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-choose-filter-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #5f7d6e;
}

.review-choose-filter-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.review-choose-filter-controls .form-select,
.review-choose-filter-controls .ts-wrapper {
  flex: 1;
  min-width: 0;
}

.review-stats-card {
  border: 1px solid #dcebe2;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-stats-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.review-stats-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #375d4c;
}

.review-stats-scope {
  font-size: 0.8rem;
  color: #607f71;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.review-stat-item {
  border: 1px solid #e5efe9;
  border-radius: 10px;
  padding: 8px;
  background: #f9fcfa;
}

.review-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: #5d7b6d;
}

.review-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #204c3a;
  line-height: 1.15;
}

.review-stat-value.success {
  color: #1f8a52;
}

.review-stat-value.mistakes {
  color: #c73939;
}

.review-stats-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.review-stats-progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  border: 1px solid #dbe9e2;
  background: #edf3ef;
}

.review-stats-progress-segment {
  display: block;
  height: 100%;
}

.review-stats-progress-segment.success {
  background: linear-gradient(90deg, #3cc16c 0%, #2f9b56 100%);
}

.review-stats-progress-segment.mistakes {
  background: linear-gradient(90deg, #ef6666 0%, #cf3d3d 100%);
}

.review-stats-progress-segment.remaining {
  background: #bfcfc6;
}

.review-stats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.76rem;
  color: #5f7c6e;
}

.review-stats-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 5px;
}

.review-stats-legend .dot.success { background: #2f9b56; }
.review-stats-legend .dot.mistakes { background: #cf3d3d; }
.review-stats-legend .dot.remaining { background: #9fb2a8; }

.review-lemma {
  margin-top: 5px;
  color: #5f7d6e;
}

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

.review-info-block {
  border: 1px solid #dcebe2;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
  color: #2d4f40;
}

.review-info-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #5c7a6b;
  margin-bottom: 6px;
}

.review-example-block {
  grid-column: 1 / -1;
}

.review-translation-area {
  margin-top: 14px;
}

.review-translation-text {
  border: 1px solid #dcebe2;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.review-choice-form {
  margin-top: 14px;
}

.review-choice-list {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.review-choice-item {
  border: 1px solid #d9e7de;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #2f5845;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.review-choice-text {
  flex: 1;
  min-width: 0;
}

.review-choice-listen-inline {
  margin-left: auto;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 999px;
  border: 1px solid #cfe0d7;
  background: #f8fcfa;
  color: #355f4d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.68rem;
  line-height: 1;
  flex-shrink: 0;
}

.review-choice-listen-inline:hover,
.review-choice-listen-inline:focus-visible {
  border-color: #9ac8b2;
  background: #eef8f2;
  color: #215840;
}

.review-choice-listen-inline:focus-visible {
  outline: 2px solid rgba(39, 162, 95, 0.25);
  outline-offset: 1px;
}

.review-choice-item:hover,
.review-choice-item:focus-within {
  border-color: #8ccaa9;
  box-shadow: 0 0 0 3px rgba(123, 207, 168, 0.24);
  background: #f7fcf9;
}

.review-choice-item.is-locked {
  cursor: default;
}

.review-choice-item.is-locked:hover,
.review-choice-item.is-locked:focus-within {
  box-shadow: none;
}

.review-choice-item.is-correct-choice {
  border-color: #27a25f;
  background: #e9f9ef;
}

.review-choice-item.is-wrong-choice {
  border-color: #d64d4d;
  background: #fff1f1;
}

@media (max-width: 900px) {
  .review-choose-toolbar {
    grid-template-columns: 1fr;
  }

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

.review-answer {
  margin-top: 12px;
}

.review-answer:not(.d-none) {
  animation: reviewAnswerReveal 0.22s ease;
}

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

.review-actions form {
  margin: 0;
}

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


.heatmap-grid {
  display: grid;
  gap: 3px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: repeat(7, 12px);
  gap: 3px;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #ebedf0;
  border: 1px solid rgba(27, 31, 36, 0.06);
}

.heat-1 { background: #9be9a8; border-color: rgba(33, 110, 57, 0.15); }
.heat-2 { background: #40c463; border-color: rgba(33, 110, 57, 0.2); }
.heat-3 { background: #30a14e; border-color: rgba(33, 110, 57, 0.24); }
.heat-4 { background: #216e39; border-color: rgba(33, 110, 57, 0.32); }
.heat-5 { background: #0f5323; border-color: rgba(33, 110, 57, 0.42); }
.heatmap-cell.is-muted {
  background: #f6f8fa;
  border-color: transparent;
}

.dashboard-page {
  --dash-section-space: 16px;
  --dash-card-radius: 18px;
  font-family: "Plus Jakarta Sans", "Manrope", "Segoe UI", sans-serif;
  color: var(--dash-ink);
  display: flex;
  flex-direction: column;
  gap: var(--dash-section-space);
}

.dashboard-page > section {
  margin: 0;
}

.dashboard-reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: dashboardReveal 0.55s ease forwards;
  animation-delay: var(--reveal-delay, 0s);
}

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

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr);
  gap: 18px;
  padding: 24px;
  border-radius: var(--dash-card-radius);
  border: 1px solid var(--dash-card-border);
  background: linear-gradient(130deg, var(--dash-hero-start) 0%, var(--dash-hero-mid) 55%, var(--dash-hero-end) 100%);
  box-shadow: 0 16px 40px rgba(15, 88, 56, 0.12);
}

.dashboard-hero::before,
.dashboard-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.dashboard-hero::before {
  width: 220px;
  height: 220px;
  right: -90px;
  top: -110px;
  background: radial-gradient(circle, rgba(31, 157, 98, 0.22) 0%, rgba(31, 157, 98, 0) 72%);
}

.dashboard-hero::after {
  width: 200px;
  height: 200px;
  left: -80px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(123, 207, 168, 0.28) 0%, rgba(123, 207, 168, 0) 72%);
}

.dashboard-hero-content,
.dashboard-hero-side {
  position: relative;
  z-index: 1;
}

.dashboard-kicker {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
  color: #2a6d4d;
  margin-bottom: 8px;
}

.dashboard-title {
  font-family: "Instrument Sans", "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
  margin: 0;
  color: #143428;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.dashboard-subtitle {
  margin: 8px 0 0;
  color: #456856;
  max-width: 560px;
  line-height: 1.55;
}

.dashboard-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 109, 76, 0.24);
  background: rgba(255, 255, 255, 0.72);
  color: #24563f;
  font-size: 0.82rem;
}

.dashboard-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
}

.hero-mastery-ring {
  width: 184px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px;
  background: conic-gradient(var(--dash-accent) calc(var(--mastery, 0) * 1%), #dceee4 0);
  box-shadow: 0 14px 26px rgba(15, 88, 56, 0.2);
}

.hero-mastery-ring::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
}

.hero-mastery-label,
.hero-mastery-value,
.hero-mastery-help {
  position: relative;
  z-index: 1;
}

.hero-mastery-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  max-width: 120px;
}

.hero-mastery-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #4d7866;
  font-weight: 700;
  line-height: 1.05;
}

.hero-mastery-value {
  font-size: 2.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #17382b;
  line-height: 0.95;
}

.hero-mastery-help {
  font-size: 0.88rem;
  color: #557a68;
  line-height: 1.15;
}

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

.dashboard-metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5fcf8 100%);
  border: 1px solid var(--dash-card-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 88, 56, 0.1);
}

.metric-label {
  color: #4f6f60;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.metric-value {
  margin-top: 8px;
  font-size: 1.56rem;
  line-height: 1.1;
  font-weight: 800;
  color: #17402f;
  letter-spacing: -0.02em;
}

.metric-sub {
  margin-top: 6px;
  color: #557a68;
  font-size: 0.86rem;
}

.momentum-value {
  font-size: 1.05rem;
  line-height: 1.2;
}

.momentum-value.is-up {
  color: #0e8a6a;
}

.momentum-value.is-down {
  color: #c4493f;
}

.momentum-value.is-flat {
  color: #4d7563;
}

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

.dashboard-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  border: 1px solid var(--dash-card-border);
  border-radius: var(--dash-card-radius);
  padding: 18px;
  box-shadow: 0 12px 28px rgba(15, 88, 56, 0.1);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-title {
  font-family: "Instrument Sans", "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 1.18rem;
  margin: 0;
  color: #194432;
}

.panel-meta {
  color: #557a68;
  font-size: 0.84rem;
  white-space: nowrap;
}

.mastery-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5f1ea;
  overflow: hidden;
}

.mastery-segment {
  height: 100%;
  float: left;
}

.mastery-segment.weak {
  background: #ec6d5e;
}

.mastery-segment.medium {
  background: #f2b54b;
}

.mastery-segment.strong {
  background: #1ca57f;
}

.mastery-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4f7664;
  font-size: 0.82rem;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.legend-dot.weak {
  background: #ec6d5e;
}

.legend-dot.medium {
  background: #f2b54b;
}

.legend-dot.strong {
  background: #1ca57f;
}

.milestone-wrap {
  margin-top: 14px;
}

.milestone-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e5f1ea;
  overflow: hidden;
}

.milestone-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--dash-accent) 0%, #4db57e 100%);
  transition: width 0.5s ease;
}

.trend-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 0.92rem;
  color: #456b5a;
}

.hardest-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hardest-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #dcebe2;
  border-radius: 14px;
  padding: 10px 12px;
  background: #ffffff;
}

.hardest-rank {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #2f6d4d;
  background: #e8f7ef;
}

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

.hardest-word {
  font-weight: 700;
  color: #214d3a;
  line-height: 1.15;
  word-break: break-word;
}

.hardest-sub {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #5d7f6f;
}

.hardest-score {
  background: #f6ad55;
  color: #ffffff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 10px;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.trend-total {
  font-size: 0.76rem;
  color: #557a68;
  min-height: 14px;
}

.trend-bar-wrap {
  width: 100%;
  height: 132px;
  display: flex;
  align-items: flex-end;
}

.trend-bar {
  width: 100%;
  height: var(--bar-height, 10%);
  border-radius: 8px 8px 4px 4px;
  transform-origin: bottom center;
  transform: scaleY(0);
  background: linear-gradient(180deg, #7bd8a4 0%, #1f9d62 100%);
  animation: growTrend 0.6s ease forwards;
}

@keyframes growTrend {
  to {
    transform: scaleY(1);
  }
}

.trend-label {
  font-size: 0.66rem;
  color: #5d7f6f;
  text-align: center;
  line-height: 1.2;
}

.trend-label.muted {
  color: #b4cdbf;
}

.heatmap-legend-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.dashboard-heatmap-shell {
  --heat-cell-size: 16px;
  --heat-cell-gap: 4px;
  --heat-label-width: 28px;
  width: 100%;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
}

.dashboard-heatmap-surface {
  width: max-content;
  min-width: 100%;
}

.heatmap-panel-header {
  align-items: flex-end;
  flex-wrap: wrap;
}

.heatmap-title-wrap {
  min-width: 0;
}

.heatmap-year-form {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.heatmap-year-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #557a68;
  font-weight: 700;
}

.heatmap-year-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.heatmap-year-input {
  width: 92px;
  text-align: center;
}

.heatmap-months {
  margin-left: calc(var(--heat-label-width) + var(--heat-cell-gap));
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: repeat(var(--heatmap-weeks, 6), var(--heat-cell-size));
  gap: var(--heat-cell-gap);
}

.heatmap-month-label {
  font-size: 0.66rem;
  color: #5e7a6b;
  line-height: 1;
}

.heatmap-body {
  display: flex;
  gap: var(--heat-cell-gap);
  min-width: max-content;
}

.heatmap-weekday-labels {
  width: var(--heat-label-width);
  display: grid;
  grid-template-rows: repeat(7, var(--heat-cell-size));
  gap: var(--heat-cell-gap);
}

.heatmap-weekday-labels span {
  font-size: 0.62rem;
  color: #8aa197;
  line-height: 1;
}

.dashboard-heatmap-grid {
  display: flex;
  gap: var(--heat-cell-gap);
}

.dashboard-heatmap-grid .heatmap-row {
  display: grid;
  grid-template-columns: var(--heat-cell-size);
  grid-template-rows: repeat(7, var(--heat-cell-size));
  gap: var(--heat-cell-gap);
}

.heatmap-cell {
  width: var(--heat-cell-size, 12px);
  height: var(--heat-cell-size, 12px);
}

.dashboard-heatmap-grid .heatmap-cell {
  opacity: 0;
  transform: scale(0.85);
  animation: heatPulse 0.38s ease forwards;
  animation-delay: var(--heat-delay, 0s);
}

@keyframes heatPulse {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.heatmap-legend-wrap .heatmap-cell {
  opacity: 1;
  transform: none;
  animation: none;
}


.empty-state-copy,
.empty-inline {
  color: #557a68;
  font-size: 0.92rem;
  line-height: 1.5;
}



.quiz-launch-btn {
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
}

.quiz-page-wrapper {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 14px;
}

.exam-paper {
  background: #ffffff;
  border: 1px solid #dde7e1;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  position: relative;
}

.exam-paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #d6ceb8;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.exam-copy-section {
  margin-bottom: 24px;
}

.exam-copy {
  padding: 14px 16px 12px 24px;
  border: 1px solid #dce8e2;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff 0px,
    #ffffff 31px,
    #e8efeb 32px
  );
  border-radius: 8px;
}

.exam-copy p {
  margin: 0 0 1rem;
  line-height: 1.9;
  white-space: pre-line;
}

.exam-copy p:last-child {
  margin-bottom: 0;
}

.exam-part {
  padding: 16px 16px 16px 24px;
  border: 1px solid #dce8e2;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 18px;
}

.exam-section-title {
  font-size: 1.08rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exam-question-list {
  margin: 0;
  padding-left: 1.2rem;
}

.exam-question {
  margin-bottom: 14px;
}

.exam-question:last-child {
  margin-bottom: 0;
}

.exam-question-text {
  font-weight: 600;
  margin-bottom: 8px;
}

.exam-choice-grid {
  display: grid;
  gap: 6px;
}

.exam-choice {
  border: 1px solid #ddd4c0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-choice input[type="radio"] {
  transform: translateY(-1px);
}

.exam-answer-input {
  border-radius: 8px;
  border-color: #dce8e2;
  background: #ffffff;
}

.exam-feedback {
  border: 1px solid #dce8e2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 0.92rem;
}

.exam-feedback-correct {
  border-color: rgba(47, 170, 112, 0.45);
  background: rgba(47, 170, 112, 0.08);
}

.exam-feedback-wrong {
  border-color: rgba(220, 78, 64, 0.4);
  background: rgba(220, 78, 64, 0.08);
}
