
:root {
  --bg: #f7f0e8;
  --panel: rgba(255, 252, 246, 0.95);
  --panel-strong: rgba(255, 253, 249, 0.98);
  --ink: #332820;
  --ink-soft: #4b3c32;
  --muted: #8b7668;
  --accent: #df7350;
  --accent-dark: #a84d2f;
  --accent-soft: #f2d1b4;
  --line: #ead7c4;
  --line-strong: #e1cab1;
  --good: #2f9b5f;
  --good-soft: #dff2e7;
  --bad: #d64c43;
  --shadow: 0 18px 48px rgba(80, 48, 22, 0.12);
  --shadow-soft: 0 10px 24px rgba(80, 48, 22, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 9%, rgba(255,255,255,.74), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(240, 176, 122, .18), transparent 28%),
    linear-gradient(135deg, #fbf5ed 0%, #f3e7da 55%, #f8efe5 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  border-radius: 0 0 100% 0;
  background: linear-gradient(135deg, rgba(245, 216, 190, .18), rgba(245, 216, 190, 0));
}

body::after {
  right: 0;
  bottom: 0;
  width: 280px;
  height: 280px;
  border-radius: 100% 0 0 0;
  background: radial-gradient(circle at bottom right, rgba(242, 204, 165, .18), rgba(242, 204, 165, 0) 70%);
}

.hidden { display: none !important; }

.dashboard-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.dashboard-header,
.access-summary,
.product-card,
.login-card {
  position: relative;
  overflow: hidden;
}

.dashboard-header,
.access-summary {
  backdrop-filter: blur(6px);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  background: linear-gradient(145deg, rgba(255,253,248,.97), rgba(255,249,241,.93));
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.dashboard-header > *,
.access-summary > *,
.product-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-header::before,
.access-summary::before,
.product-card::before,
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 26%);
}

.dashboard-header::after,
.access-summary::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.36);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .78rem;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 5vw, 3.85rem);
  line-height: .98;
  letter-spacing: -.02em;
  color: #342820;
}

.member-info {
  margin-bottom: 0;
  color: #8a7769;
  font-weight: 750;
  font-size: 1.03rem;
}

.member-package-panel {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  max-width: min(620px, 100%);
  margin-top: 14px;
  padding: 11px 13px 12px;
  border: 1px solid rgba(196, 128, 86, .34);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 251, 244, .86), rgba(255, 246, 235, .72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 10px 24px rgba(105, 70, 38, .045);
}

.member-package-panel .summary-label {
  margin-bottom: 0;
}

.member-package-panel #packageName,
.member-package-panel .active-package-list {
  font-size: .98rem;
}

.member-package-panel #dashboardStatus {
  display: block;
  margin-top: 0;
  text-align: left;
  max-width: none;
  font-size: .82rem;
  color: var(--ink-soft);
}

.member-package-panel #dashboardStatus[hidden] {
  display: none !important;
}

.active-package-list {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.active-package-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(196, 128, 86, .28);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  white-space: nowrap;
}

.active-package-track {
  color: var(--accent-dark);
  font-weight: 950;
}

.active-package-values {
  color: #3b3028;
  font-weight: 850;
}

.header-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 132px;
}

.logout-btn,
.home-btn,
.google-login-button,
.product-card button {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.logout-btn,
.home-btn {
  min-height: 42px;
  padding: 10px 18px;
  background: rgba(255, 248, 240, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--accent-dark);
  box-shadow: 0 7px 16px rgba(80, 48, 22, 0.06), inset 0 1px 0 rgba(255,255,255,.8);
}

.home-btn,
.logout-btn {
  font-size: .98rem;
}

.logout-btn:hover,
.home-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #e77753 0%, #ef9162 100%);
  border-color: rgba(192, 97, 58, .56);
  color: #fff;
  box-shadow: 0 12px 24px rgba(168, 77, 47, 0.16);
}

.access-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 18px 0 22px;
  padding: 18px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,252,246,.9), rgba(255,249,242,.84));
  box-shadow: var(--shadow-soft);
}

.summary-label {
  display: block;
  color: #a18e81;
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .01em;
  margin-bottom: 4px;
}

#packageName {
  display: block;
  color: var(--accent-dark);
  line-height: 1.15;
}

#dashboardStatus {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 760;
  max-width: 460px;
  text-align: right;
}

.product-section {
  margin-top: 22px;
}

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

.product-section-head h2,
.product-section h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  color: #2e241d;
}

.product-section-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.45;
  max-width: 520px;
}

.product-section-head .section-kicker {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: .74rem;
  font-weight: 950;
  letter-spacing: .11em;
  text-transform: uppercase;
}

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

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

.product-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,253,248,.98), rgba(255,250,244,.94));
  box-shadow: 0 14px 30px rgba(80, 48, 22, 0.07);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, opacity .16s ease;
}

.product-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.44);
  pointer-events: none;
}

.product-card.unlocked {
  border: 1px solid rgba(93, 191, 128, .56);
  box-shadow: 0 0 0 4px rgba(47, 155, 95, .07), 0 16px 38px rgba(47, 155, 95, .11);
}

.product-card.locked {
  opacity: .62;
  filter: grayscale(.28);
}

.product-card.unreleased {
  opacity: .72;
  border-style: dashed;
}

.product-card.unlocked:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 4px rgba(47, 155, 95, .08), 0 20px 42px rgba(47, 155, 95, .14);
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.product-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  border-radius: 10px;
  background: rgba(242, 218, 193, .4);
}

.product-badge {
  font-size: .75rem;
  font-weight: 900;
  color: #9a887b;
  background: #fff8ef;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.product-card.unlocked .product-badge {
  color: var(--good);
  border-color: rgba(47,155,95,.3);
  background: #effaf3;
}

.product-card h3 {
  margin-bottom: 8px;
  font-size: 1.28rem;
  line-height: 1.08;
  color: #2f251e;
}

.product-card p {
  color: #7e6d61;
  line-height: 1.45;
  flex: 1;
  font-weight: 670;
  margin-bottom: 16px;
}

.product-card button {
  min-height: 48px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #df7350 0%, #e98b61 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(168, 77, 47, .16);
}

.product-card button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #cc5f3e 0%, #df7350 100%);
}

.product-card button:disabled {
  background: #cfc3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(65, 55, 44, .42);
  backdrop-filter: blur(8px);
}

body.login-locked .dashboard-shell {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.login-card {
  width: min(390px, 94vw);
  text-align: center;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 252, 246, .97);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.login-subtitle,
.login-note {
  color: var(--muted);
  line-height: 1.5;
}

.google-login-button {
  width: 100%;
  height: 52px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #ffffff;
  color: #1f1f1f;
  font-size: 1.02rem;
  font-weight: 850;
  box-shadow: 0 2px 6px rgba(60, 64, 67, .12);
}

.google-login-button:hover {
  background: #f8f9fa;
  border-color: #c6c6c6;
  box-shadow: 0 4px 12px rgba(60, 64, 67, .18);
}

.google-login-button:active {
  background: #f1f3f4;
  transform: translateY(1px);
}

.google-login-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, .22), 0 4px 12px rgba(60, 64, 67, .18);
}

.google-login-button:disabled { opacity: .65; cursor: wait; }

.google-g {
  display: inline-flex;
  place-items: center;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.google-g svg { display: block; }

.login-error {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--bad);
  font-weight: 900;
}

.login-note { margin: 10px 0 0; font-size: .86rem; }

.login-legal {
  margin: 11px 0 0;
  font-size: .84rem;
}

.login-legal a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(225, 202, 177, .92);
  background: rgba(255, 245, 235, .84);
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 900;
}

.login-legal a:hover,
.login-legal a:focus-visible {
  background: #fff1df;
  outline: none;
}

.member-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: .88rem;
}

.member-footer span {
  font-weight: 900;
  color: #7b5945;
}

.member-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(225, 202, 177, .9);
  border-radius: 999px;
  background: rgba(255, 253, 249, .68);
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(80, 48, 22, .045);
}

.member-footer a:hover,
.member-footer a:focus-visible {
  background: #fff5e9;
  outline: none;
}

@media (max-width: 900px) {
  .product-grid,
  .product-grid.bundle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .access-summary,
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    flex-direction: row;
    min-width: 0;
  }
  #dashboardStatus {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .dashboard-shell { width: min(100% - 20px, 1120px); padding-top: 16px; }
  .product-grid,
  .product-grid.bundle-grid { grid-template-columns: 1fr; }
  .header-actions { flex-direction: column; }
}

/* Dashboard learning statistics visual refresh / premium contrast state */
.learning-insights {
  --stat-amber: #c98b32;
  --stat-coral: #c86143;
  --stat-blue: #405bb5;
  --stat-green: #1f8a66;
  --stat-purple: #6b57b7;
  --stat-bronze: #936231;
  --stat-espresso: #2d231e;
  --stat-navy: #263450;
  --stat-cream: rgba(255, 252, 246, .98);
  position: relative;
  z-index: 1;
  margin: 18px 0 28px;
  padding: 24px;
  border-radius: 30px;
  border: 1px solid rgba(166, 108, 63, .52);
  background:
    radial-gradient(circle at 7% 2%, rgba(201, 139, 50, .22), transparent 28%),
    radial-gradient(circle at 96% 6%, rgba(64, 91, 181, .14), transparent 30%),
    linear-gradient(145deg, rgba(255,252,246,.99), rgba(255,244,232,.97) 56%, rgba(241,246,255,.94));
  box-shadow: 0 22px 58px rgba(80, 48, 22, 0.16), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  transition: padding .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.learning-insights::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(45, 35, 30, .13), rgba(201, 139, 50, 0) 24%, rgba(64, 91, 181, .1) 100%),
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0) 32%);
}
.learning-insights > * {
  position: relative;
  z-index: 1;
}
.learning-insights.is-collapsed {
  padding: 18px 20px;
  border-radius: 24px;
  border-color: rgba(145, 85, 51, .58);
  background:
    linear-gradient(90deg, #33251f 0 10px, rgba(255,250,242,.98) 10px),
    linear-gradient(135deg, rgba(255,249,241,.98), rgba(248,230,211,.94));
  box-shadow: 0 12px 30px rgba(80, 48, 22, 0.12), inset 0 1px 0 rgba(255,255,255,.86);
}
.learning-insights.is-open {
  border-color: rgba(64, 91, 181, .34);
  box-shadow: 0 24px 64px rgba(80, 48, 22, 0.17), 0 0 0 4px rgba(64, 91, 181, .06), inset 0 1px 0 rgba(255,255,255,.9);
}
.insights-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.learning-insights.is-collapsed .insights-head { margin-bottom: 0; }
.insights-title { min-width: 0; flex: 1 1 auto; }
.insights-head h2 {
  margin: 0;
  color: #2f251f;
  font-size: clamp(1.32rem, 2.1vw, 1.74rem);
  line-height: 1.08;
  letter-spacing: -.01em;
}
.insights-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}
.insights-actions .home-btn {
  min-height: 38px;
  padding: 9px 14px;
  white-space: nowrap;
}
#refreshStatsBtn {
  background: rgba(255,255,255,.88);
  border-color: rgba(151, 104, 65, .25);
  color: #5f4637;
}
#toggleStatsBtn {
  background: linear-gradient(135deg, #2f251f 0%, #b25d3d 100%);
  color: #fff;
  border-color: rgba(80, 48, 22, .28);
  box-shadow: 0 12px 24px rgba(80, 48, 22, .18);
}
.learning-insights.is-open #toggleStatsBtn {
  background: rgba(255, 255, 255, .9);
  color: #5f4637;
  border-color: rgba(143, 97, 51, .25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 7px 16px rgba(80, 48, 22, 0.06);
}
.stats-status {
  margin: 8px 0 0;
  color: #58463b;
  line-height: 1.45;
  font-weight: 760;
}
.stats-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}
.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(184, 143, 105, .35);
  color: #4e3d33;
  font-size: .8rem;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 6px 14px rgba(80,48,22,.05);
}
.preview-chip b {
  color: #261d19;
  font-size: 1rem;
  line-height: 1;
}
.preview-chip small {
  color: inherit;
  font-size: .76rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .035em;
  white-space: nowrap;
}
.preview-chip.primary { border-color: rgba(201, 139, 50, .45); background: rgba(255, 246, 226, .96); }
.preview-chip.coral { border-color: rgba(200, 97, 67, .38); background: rgba(255, 235, 226, .96); }
.preview-chip.blue { border-color: rgba(64, 91, 181, .32); background: rgba(237, 242, 255, .96); }
.preview-chip.green { border-color: rgba(31, 138, 102, .32); background: rgba(230, 247, 239, .96); }
.preview-chip.muted { color: #7c685a; background: rgba(255,255,255,.78); }
.stats-details { display: block; }
.learning-insights.is-collapsed .stats-details { display: none; }
.stats-visual-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr);
  gap: 15px;
  margin-bottom: 14px;
}
.stats-hero-card {
  min-height: 156px;
  padding: 17px;
  border-radius: 24px;
  border: 1px solid rgba(184, 143, 105, .36);
  background: rgba(255, 253, 249, .96);
  box-shadow: 0 14px 30px rgba(80, 48, 22, .09), inset 0 1px 0 rgba(255,255,255,.9);
  overflow: hidden;
}
.accuracy-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 176px;
  background:
    radial-gradient(circle at 16% 0%, rgba(244, 197, 110, .25), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(118, 144, 214, .24), transparent 36%),
    linear-gradient(135deg, #2b211d 0%, #263450 55%, #473229 100%);
  border-color: rgba(234, 186, 99, .38);
  color: #fff;
  box-shadow: 0 18px 38px rgba(38, 52, 80, .22), inset 0 1px 0 rgba(255,255,255,.14);
}
.accuracy-copy {
  min-width: 0;
  max-width: 620px;
}
.accuracy-hero .box-label { color: #f4c56e !important; }
.accuracy-hero h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(1.28rem, 2.2vw, 1.72rem);
}
.accuracy-hero p {
  margin: 0;
  color: rgba(255,255,255,.84);
  line-height: 1.45;
  font-weight: 720;
}
.accuracy-hero p strong {
  color: #fff;
  font-size: 1.1em;
}
.accuracy-ring {
  flex: 0 0 134px;
  width: 134px;
  height: 134px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 56%),
    conic-gradient(#f4c56e var(--ring), rgba(255,255,255,.18) 0);
  box-shadow: inset 0 0 0 1px rgba(244,197,110,.26), 0 18px 34px rgba(0,0,0,.22);
}
.accuracy-ring strong {
  display: block;
  margin: 0;
  color: #263450;
  font-size: 1.72rem;
  line-height: 1;
  letter-spacing: -.03em;
}
.accuracy-ring small {
  display: block;
  margin: 0;
  color: #667089;
  font-size: .72rem;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}
.stats-hero-card h3 {
  margin: 0 0 8px;
  color: #2f251f;
  font-size: 1.16rem;
  line-height: 1.18;
}
.stats-hero-card p {
  margin: 0;
  color: #5e4a3e;
  line-height: 1.45;
  font-weight: 720;
}
.stats-hero-card small {
  display: block;
  margin-top: 9px;
  color: #705c4e;
  font-weight: 780;
  line-height: 1.35;
}
.focus-hero {
  background:
    linear-gradient(90deg, rgba(200,97,67,.92) 0 7px, transparent 7px),
    radial-gradient(circle at 100% 0%, rgba(200, 97, 67, .15), transparent 42%),
    linear-gradient(145deg, rgba(255,252,247,.99), rgba(255,244,237,.95));
  border-color: rgba(200, 97, 67, .28);
}
.activity-hero {
  background:
    linear-gradient(90deg, rgba(31,138,102,.88) 0 7px, transparent 7px),
    radial-gradient(circle at 100% 0%, rgba(31, 138, 102, .13), transparent 38%),
    linear-gradient(145deg, rgba(252,255,253,.99), rgba(238,248,242,.95));
  border-color: rgba(31, 138, 102, .24);
}
.mode-hero {
  grid-column: 1 / -1;
  background:
    linear-gradient(90deg, rgba(201,139,50,.92) 0 7px, transparent 7px),
    radial-gradient(circle at 0% 0%, rgba(201, 139, 50, .16), transparent 38%),
    linear-gradient(145deg, rgba(255,253,249,.99), rgba(255,248,235,.95));
  border-color: rgba(201, 139, 50, .28);
}
.activity-line,
.mode-bar-row {
  display: grid;
  grid-template-columns: minmax(108px, .9fr) minmax(90px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #5b473b;
  font-weight: 850;
  font-size: .9rem;
}
.activity-line span,
.mode-bar-row span {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}
.activity-line i,
.mode-bar-row i {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(89, 72, 58, .13);
}
.activity-line i::before,
.mode-bar-row i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #1f8a66, #89cf9b);
}
.mode-bar-row i::before { background: linear-gradient(90deg, #c98b32, #c86143); }
.activity-line b,
.mode-bar-row b {
  color: #2f251f;
  font-size: .96rem;
  white-space: nowrap;
}
.mode-row-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 2px;
}
.visual-empty { font-size: .9rem; }
.stats-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.learning-stat-card {
  position: relative;
  min-height: 108px;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.99), rgba(255,250,244,.94));
  border: 1px solid rgba(184, 143, 105, .38);
  box-shadow: 0 11px 24px rgba(80,48,22,.075), inset 0 1px 0 rgba(255,255,255,.9);
  overflow: hidden;
}
.learning-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--card-accent, var(--accent));
}
.learning-stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--card-accent, var(--accent));
  opacity: .16;
}
.learning-stat-card span {
  position: relative;
  z-index: 1;
  display: block;
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6f5749;
  font-weight: 950;
}
.learning-stat-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 5px 0 2px;
  font-size: clamp(1.54rem, 2.4vw, 1.94rem);
  color: #251c18;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.learning-stat-card small {
  position: relative;
  z-index: 1;
  color: #604d42;
  font-weight: 750;
}
.learning-stat-card.stat-amber { --card-accent: var(--stat-amber); }
.learning-stat-card.stat-coral { --card-accent: var(--stat-coral); }
.learning-stat-card.stat-blue { --card-accent: var(--stat-blue); }
.learning-stat-card.stat-green { --card-accent: var(--stat-green); }
.learning-stat-card.stat-purple { --card-accent: var(--stat-purple); }
.learning-stat-card.stat-bronze { --card-accent: var(--stat-bronze); }

.next-focus-box,
.progress-breakdown-box,
.save-history-box { margin-top: 14px; }
.next-focus-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 247, 230, .88), rgba(255, 239, 229, .8));
  border: 1px solid rgba(216, 150, 56, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}
.next-focus-box h3,
.progress-breakdown-box h3,
.save-history-box h3 {
  margin: 0 0 8px;
  color: #342820;
}
.next-focus-box p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}
.box-label {
  margin: 0 0 6px !important;
  font-size: .73rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-dark) !important;
  font-weight: 950;
}
.weak-words-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 246, 228, .78), rgba(255, 252, 246, .82));
  border: 1px solid rgba(224, 152, 61, .24);
}
.weak-words-box h3 {
  margin: 0 0 10px;
  color: #3d2d18;
}
.weak-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.weak-word-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(224, 152, 61, .24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.weak-word-list small { color: #755b39; }
.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.breakdown-grid section,
.save-history-box {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(225, 202, 177, .78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.breakdown-grid table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.breakdown-grid td {
  padding: 9px 5px;
  border-bottom: 1px solid rgba(225, 202, 177, .68);
  color: var(--ink-soft);
  vertical-align: top;
}
.breakdown-grid td:first-child {
  width: 34%;
  min-width: 170px;
  font-weight: 950;
  color: #342820;
}
.breakdown-grid td:nth-child(2) {
  width: 92px;
  white-space: nowrap;
  color: #6b5548;
  font-weight: 780;
}
.breakdown-grid td:nth-child(3) { line-height: 1.35; }
.save-history-list {
  display: grid;
  gap: 10px;
}
.save-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 252, 246, .75);
  border: 1px solid rgba(225, 202, 177, .62);
}
.save-history-item strong,
.save-history-item small { display: block; }
.save-history-item small {
  margin-top: 3px;
  color: #7d6b5f;
}
.dashboard-continue-actions,
.save-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.home-btn.ghost {
  background: rgba(255, 255, 255, .72);
  color: #6c4a31;
  border: 1px solid rgba(143, 97, 51, .22);
}
.continue-detail {
  display: block;
  margin-top: 8px;
  color: #7a634d;
  font-weight: 760;
}
@media (max-width: 1040px) {
  .stats-visual-box { grid-template-columns: 1fr; }
  .accuracy-hero,
  .mode-hero { grid-column: auto; }
}
@media (max-width: 760px) {
  .insights-head,
  .next-focus-box,
  .save-history-item { align-items: stretch; flex-direction: column; }
  .insights-actions { justify-content: stretch; }
  .insights-actions::before { justify-content: center; flex: 1 1 100%; }
  .insights-actions .home-btn { flex: 1 1 130px; }
  .stats-card-grid { grid-template-columns: 1fr; }
  .stats-visual-box { grid-template-columns: 1fr; }
  .accuracy-hero { flex-direction: column; align-items: flex-start; }
  .mode-row-list { grid-template-columns: 1fr; }
  .breakdown-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dashboard-continue-actions,
  .save-history-actions {
    width: 100%;
    justify-content: stretch;
  }
  .dashboard-continue-actions .home-btn,
  .save-history-actions .home-btn { flex: 1 1 120px; }
}


/* HF UI stats harmony fix: premium warm + deep-teal palette, readable dark-card text */
.learning-insights {
  --stat-amber: #c58a31;
  --stat-coral: #d36b4e;
  --stat-blue: #0f5f58;
  --stat-green: #14745f;
  --stat-purple: #795b3d;
  --stat-bronze: #a96b35;
  --stat-espresso: #2f241d;
  --stat-navy: #0f4a45;
  --stat-cream: rgba(255, 252, 246, .98);
  border-color: rgba(174, 117, 72, .34);
  background:
    radial-gradient(circle at 9% 0%, rgba(224, 115, 80, .13), transparent 26%),
    radial-gradient(circle at 93% 3%, rgba(20, 116, 95, .14), transparent 30%),
    linear-gradient(145deg, rgba(255,253,248,.99) 0%, rgba(255,247,238,.98) 55%, rgba(239,248,242,.94) 100%);
  box-shadow: 0 20px 52px rgba(80, 48, 22, .13), inset 0 1px 0 rgba(255,255,255,.92);
}
.learning-insights::before {
  background:
    linear-gradient(90deg, rgba(15, 74, 69, .09), rgba(211, 107, 78, 0) 32%, rgba(20,116,95,.11) 100%),
    linear-gradient(180deg, rgba(255,255,255,.46), rgba(255,255,255,0) 32%);
}
.learning-insights.is-collapsed {
  border-color: rgba(15, 74, 69, .22);
  background:
    linear-gradient(90deg, #0f4a45 0 10px, rgba(255,253,248,.985) 10px),
    linear-gradient(135deg, rgba(255,250,244,.99), rgba(238,248,242,.96));
  box-shadow: 0 12px 30px rgba(80, 48, 22, .10), 0 0 0 1px rgba(20,116,95,.05), inset 0 1px 0 rgba(255,255,255,.88);
}
.learning-insights.is-open {
  border-color: rgba(15, 74, 69, .26);
  box-shadow: 0 24px 62px rgba(80, 48, 22, .14), 0 0 0 4px rgba(20,116,95,.055), inset 0 1px 0 rgba(255,255,255,.92);
}
.insights-actions::before {
  background: linear-gradient(135deg, #0f4a45, #14745f);
  border-color: rgba(246, 218, 178, .22);
  box-shadow: 0 10px 22px rgba(15, 74, 69, .18);
}
.learning-insights.is-collapsed .insights-actions::before {
  background: linear-gradient(135deg, #5b3a2a, #d36b4e);
  box-shadow: 0 10px 20px rgba(124, 74, 44, .14);
}
#toggleStatsBtn {
  background: linear-gradient(135deg, #0f4a45 0%, #14745f 100%);
  color: #fffaf2;
  border-color: rgba(15, 74, 69, .28);
  box-shadow: 0 12px 24px rgba(15, 74, 69, .18);
}
.learning-insights.is-open #toggleStatsBtn,
#refreshStatsBtn {
  background: rgba(255,255,255,.9);
  color: #5f4637;
  border-color: rgba(174, 117, 72, .24);
}
.preview-chip {
  background: rgba(255,255,255,.92);
  border-color: rgba(184, 143, 105, .30);
  color: #4e3d33;
}
.preview-chip.blue {
  border-color: rgba(15, 74, 69, .28);
  background: rgba(232, 246, 241, .97);
}
.preview-chip.green {
  border-color: rgba(20, 116, 95, .30);
  background: rgba(230, 247, 239, .97);
}
.preview-chip.coral {
  border-color: rgba(211, 107, 78, .32);
  background: rgba(255, 239, 231, .97);
}
.stats-hero-card {
  background: rgba(255, 253, 249, .98);
  border-color: rgba(184, 143, 105, .28);
}
.accuracy-hero {
  background:
    radial-gradient(circle at 6% 0%, rgba(244, 203, 147, .18), transparent 30%),
    radial-gradient(circle at 94% 12%, rgba(211, 107, 78, .24), transparent 34%),
    linear-gradient(135deg, #17352f 0%, #0f4a45 54%, #25483b 100%);
  border-color: rgba(246, 218, 178, .28);
  color: #fffaf2 !important;
  box-shadow: 0 18px 38px rgba(15, 74, 69, .22), inset 0 1px 0 rgba(255,255,255,.14);
}
.accuracy-hero .accuracy-copy,
.accuracy-hero .accuracy-copy *,
.accuracy-hero h3,
.accuracy-hero p,
.accuracy-hero p strong {
  color: #fffaf2 !important;
  text-shadow: 0 1px 1px rgba(0,0,0,.16);
}
.accuracy-hero .box-label {
  color: #f3c892 !important;
  text-shadow: none;
}
.accuracy-hero p {
  color: rgba(255,250,242,.84) !important;
  max-width: 560px;
}
.accuracy-ring {
  background:
    radial-gradient(circle at center, #fffaf2 0 55%, transparent 56%),
    conic-gradient(#d36b4e var(--ring), rgba(255,250,242,.20) 0);
  box-shadow: inset 0 0 0 1px rgba(246,218,178,.28), 0 16px 32px rgba(0,0,0,.20);
}
.accuracy-ring strong {
  color: #0f4a45 !important;
  text-shadow: none !important;
}
.accuracy-ring small {
  color: #725849 !important;
  text-shadow: none !important;
}
.focus-hero {
  background:
    linear-gradient(90deg, rgba(211,107,78,.92) 0 7px, transparent 7px),
    radial-gradient(circle at 100% 0%, rgba(211,107,78,.12), transparent 42%),
    linear-gradient(145deg, rgba(255,253,249,.99), rgba(255,244,237,.95));
  border-color: rgba(211,107,78,.24);
}
.activity-hero {
  background:
    linear-gradient(90deg, rgba(15,74,69,.92) 0 7px, transparent 7px),
    radial-gradient(circle at 100% 0%, rgba(20,116,95,.13), transparent 38%),
    linear-gradient(145deg, rgba(253,255,253,.99), rgba(238,248,242,.96));
  border-color: rgba(20,116,95,.22);
}
.mode-hero {
  background:
    linear-gradient(90deg, rgba(197,138,49,.92) 0 7px, transparent 7px),
    radial-gradient(circle at 0% 0%, rgba(197,138,49,.14), transparent 38%),
    linear-gradient(145deg, rgba(255,253,249,.99), rgba(255,248,235,.96));
  border-color: rgba(197,138,49,.24);
}
.activity-line i,
.mode-bar-row i {
  background: rgba(49, 69, 61, .13);
}
.activity-line i::before {
  background: linear-gradient(90deg, #0f4a45, #44a67d);
}
.mode-bar-row i::before {
  background: linear-gradient(90deg, #c58a31, #d36b4e);
}
.learning-stat-card {
  background: linear-gradient(145deg, rgba(255,255,255,.99), rgba(255,250,244,.95));
  border-color: rgba(184, 143, 105, .30);
}
.learning-stat-card.stat-blue { --card-accent: #0f5f58; }
.learning-stat-card.stat-green { --card-accent: #14745f; }
.learning-stat-card.stat-purple { --card-accent: #795b3d; }
.next-focus-box {
  background: linear-gradient(135deg, rgba(255,248,235,.91), rgba(238,248,242,.82));
  border-color: rgba(20,116,95,.18);
}
.weak-words-box {
  background: linear-gradient(135deg, rgba(255,248,235,.82), rgba(255,253,249,.90));
  border-color: rgba(197,138,49,.20);
}
@media (max-width: 760px) {
  .accuracy-hero {
    gap: 16px;
  }
  .accuracy-ring {
    flex-basis: 118px;
    width: 118px;
    height: 118px;
  }
}

/* HF-UI header compact layout: package moved to top-right, actions pinned to edge */
.dashboard-header {
  display: block;
  overflow: visible;
  min-height: 154px;
  padding: 24px 30px 24px;
}

.dashboard-header .header-copy {
  max-width: calc(100% - 360px);
  padding-right: 0;
}

.dashboard-header .member-info {
  margin-bottom: 0;
}

.dashboard-header .member-package-panel {
  position: absolute;
  top: 24px;
  right: 30px;
  width: min(318px, 34vw);
  max-width: 318px;
  margin-top: 0;
  padding: 10px 12px 11px;
  gap: 8px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 253, 248, .94), rgba(255, 245, 235, .84));
  border-color: rgba(196, 128, 86, .36);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 12px 26px rgba(105, 70, 38, .055);
}

.dashboard-header .member-package-panel .summary-label {
  font-size: .76rem;
  color: #8b7668;
}

.dashboard-header .active-package-list {
  gap: 7px;
}

.dashboard-header .active-package-row {
  padding: 6px 10px;
  background: rgba(255, 255, 255, .9);
  border-color: rgba(196, 128, 86, .3);
}

.dashboard-header .active-package-track,
.dashboard-header .active-package-values {
  font-size: .94rem;
}

.dashboard-header .header-actions {
  position: absolute;
  right: 30px;
  bottom: 24px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 9px;
  z-index: 4;
}

.dashboard-header .logout-btn,
.dashboard-header .home-btn {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (min-width: 1320px) {
  .dashboard-header .header-actions {
    top: 50%;
    right: -12px;
    bottom: auto;
    transform: translate(100%, -50%);
    flex-direction: column;
    align-items: stretch;
    width: 118px;
  }

  .dashboard-header .logout-btn,
  .dashboard-header .home-btn {
    width: 100%;
  }
}

@media (max-width: 1040px) {
  .dashboard-header {
    min-height: 168px;
  }

  .dashboard-header .header-copy {
    max-width: calc(100% - 300px);
  }

  .dashboard-header .member-package-panel {
    width: 280px;
    max-width: 280px;
  }
}

@media (max-width: 820px) {
  .dashboard-header {
    min-height: 0;
    padding: 20px;
  }

  .dashboard-header .header-copy {
    max-width: none;
    padding-right: 0;
  }

  .dashboard-header .member-package-panel {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    max-width: 100%;
    margin-top: 14px;
  }

  .dashboard-header .header-actions {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 14px;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .dashboard-header {
    padding: 18px;
  }

  .dashboard-header .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dashboard-header .logout-btn,
  .dashboard-header .home-btn {
    flex: 1 1 128px;
  }
}


/* HF-UI final tidy: no state pill, header actions restored above active package */
.insights-actions {
  gap: 10px;
}

.dashboard-header {
  min-height: 154px;
  padding: 22px 28px 22px;
}

.dashboard-header .header-copy {
  max-width: calc(100% - 372px);
}

.dashboard-header .header-actions {
  position: absolute;
  top: 24px;
  right: 28px;
  bottom: auto;
  transform: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  min-width: 0;
  gap: 10px;
  z-index: 5;
}

.dashboard-header .logout-btn,
.dashboard-header .home-btn {
  width: auto;
  min-width: 112px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .93rem;
  line-height: 1;
}

.dashboard-header .member-package-panel {
  top: 72px;
  right: 28px;
  width: min(318px, 34vw);
  max-width: 318px;
  padding: 10px 12px 11px;
  margin-top: 0;
}

.dashboard-header .member-package-panel .summary-label {
  font-size: .74rem;
  line-height: 1;
}

.dashboard-header .active-package-list {
  gap: 7px;
}

.dashboard-header .active-package-row {
  padding: 6px 10px;
}

.learning-insights {
  margin-top: 18px;
}

.product-section {
  margin-top: 0;
}

@media (min-width: 1320px) {
  .dashboard-header .header-actions {
    position: absolute;
    top: 24px;
    right: 28px;
    bottom: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .dashboard-header .logout-btn,
  .dashboard-header .home-btn {
    width: auto;
  }
}

@media (max-width: 1040px) {
  .dashboard-header {
    min-height: 158px;
  }

  .dashboard-header .header-copy {
    max-width: calc(100% - 326px);
  }

  .dashboard-header .member-package-panel {
    width: 296px;
    max-width: 296px;
  }
}

@media (max-width: 860px) {
  .dashboard-header {
    min-height: 0;
    padding: 20px;
  }

  .dashboard-header .header-copy {
    max-width: none;
  }

  .dashboard-header .header-actions {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    transform: none;
    margin-top: 14px;
    justify-content: flex-start;
  }

  .dashboard-header .member-package-panel {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    max-width: 100%;
    margin-top: 12px;
  }
}

@media (max-width: 560px) {
  .dashboard-header .header-actions {
    flex-wrap: wrap;
  }

  .dashboard-header .logout-btn,
  .dashboard-header .home-btn {
    flex: 1 1 128px;
    min-width: 0;
  }
}

/* Codex patch: keep the active package summary inside the dashboard header. */
.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  grid-template-areas:
    "copy actions"
    "copy package";
  align-items: start;
  gap: 14px 24px;
  min-height: 0;
}

.dashboard-header .header-copy {
  grid-area: copy;
  max-width: none;
}

.dashboard-header .header-actions {
  grid-area: actions;
  position: static;
  justify-self: end;
  transform: none;
}

.dashboard-header .member-package-panel {
  grid-area: package;
  position: static;
  justify-self: end;
  width: 100%;
  max-width: 360px;
  margin-top: 0;
}

.dashboard-header .active-package-list {
  width: 100%;
  min-width: 0;
}

.dashboard-header .active-package-row {
  max-width: 100%;
  white-space: normal;
  flex-wrap: wrap;
}

.dashboard-header .active-package-track,
.dashboard-header .active-package-values {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .dashboard-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "actions"
      "package";
  }

  .dashboard-header .header-actions,
  .dashboard-header .member-package-panel {
    justify-self: stretch;
  }
}

