:root {
  --ink: #16201d;
  --muted: #66736f;
  --paper: #f8f7f0;
  --surface: #ffffff;
  --line: #d9ded7;
  --gold: #c9972b;
  --gold-dark: #8a6418;
  --green: #1f8a5a;
  --red: #b94b4b;
  --teal: #226b73;
  --teal-soft: #dcebea;
  --charcoal: #26312e;
  --shadow: 0 18px 50px rgba(22, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 148px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(220, 235, 234, 0.68) 0, rgba(248, 247, 240, 0) 420px),
    var(--paper);
  font-family: "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(22, 32, 29, 0.1);
  background: rgba(248, 247, 240, 0.88);
  backdrop-filter: blur(18px);
}

.nav-inner {
  width: min(1500px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(22, 32, 29, 0.1);
}

.brand-mark span {
  display: grid;
  gap: 2px;
}

.brand-mark small {
  color: var(--gold-dark);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.brand-mark strong {
  font-size: 1.08rem;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.main-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 11px 0 9px;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.main-nav a:hover {
  background: rgba(34, 107, 115, 0.1);
  color: var(--teal);
  transform: translateY(-1px);
}

.nav-icon,
.button-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
}

.nav-icon {
  background: rgba(34, 107, 115, 0.1);
  color: var(--teal);
}

.nav-icon svg,
.button-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-nav a:hover .nav-icon {
  background: var(--teal);
  color: white;
}

.app-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 32px;
  align-items: center;
  padding: 22px 0 34px;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 7vw, 5.35rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.hero-text {
  margin: 22px 0 28px;
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.member-panel {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin: 0 0 18px;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(22, 32, 29, 0.06);
}

.nav-member {
  width: 100%;
  min-width: min(760px, 100%);
  max-width: none;
  justify-self: stretch;
  margin: 0;
  grid-template-columns: auto minmax(150px, 1fr) minmax(300px, auto);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  box-shadow: none;
}

.member-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.member-panel strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: normal;
  word-break: keep-all;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #ecebe2;
  color: var(--charcoal);
  font-size: 0.76rem;
  font-weight: 900;
}

.role-badge.admin {
  background: rgba(201, 151, 43, 0.2);
  color: var(--gold-dark);
}

.login-buttons {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 8px;
  justify-content: stretch;
  width: 100%;
}

.login-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px 0 8px;
  min-width: 0;
  color: white;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(22, 32, 29, 0.08);
}

.login-button .button-icon {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.16);
  color: currentColor;
}

.login-button.line {
  background: #06c755;
  border-color: #06c755;
}

.login-button.facebook {
  background: #1877f2;
  border-color: #1877f2;
}

.login-button.apple,
.login-button.logout,
.login-button.admin {
  background: #111;
  border-color: #111;
}

.login-button.admin {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.login-button.needs-setup {
  opacity: 0.62;
}

.hero-actions,
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.filter-button,
.plan-form button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  font-weight: 700;
}

.primary-action .button-icon,
.secondary-action .button-icon {
  background: rgba(255, 255, 255, 0.18);
}

.secondary-action .button-icon {
  background: rgba(34, 107, 115, 0.1);
  color: var(--teal);
}

.primary-action,
.plan-form button {
  background: var(--ink);
  color: white;
}

.secondary-action,
.filter-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--charcoal);
  border-color: var(--line);
}

.market-panel {
  overflow: hidden;
  border: 1px solid rgba(22, 32, 29, 0.12);
  border-radius: 8px;
  background: #101816;
  box-shadow: var(--shadow);
}

.panel-top,
.panel-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: white;
  padding: 16px 18px;
}

.panel-top span,
.panel-stats span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

.panel-top strong,
.panel-stats strong {
  display: block;
  margin-top: 3px;
}

.featured-visual {
  position: relative;
  min-height: 230px;
  border-block: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(16, 24, 22, 0) 42%, rgba(16, 24, 22, 0.84) 100%),
    linear-gradient(135deg, rgba(201, 151, 43, 0.24), rgba(34, 107, 115, 0.18));
}

.featured-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 230px;
  max-height: 360px;
  object-fit: cover;
}

.featured-visual.is-empty img {
  display: none;
}

.featured-caption {
  position: absolute;
  inset: auto 18px 18px;
  color: white;
}

.featured-caption span {
  display: inline-flex;
  margin-bottom: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 800;
}

.featured-caption strong {
  display: block;
  max-width: 94%;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.35;
}

#goldChart {
  display: block;
  width: 100%;
  height: 210px;
  background: #101816;
  object-fit: cover;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric,
.lesson-card,
.study-plan,
.quiz-panel,
.donate-panel,
.controls,
.risk-disclaimer,
.resume-panel,
.launchpad,
.section-progress-panel,
.learning-module,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.risk-disclaimer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: -6px 0 18px;
  padding: 16px 18px;
  background:
    linear-gradient(90deg, rgba(185, 75, 75, 0.1), rgba(201, 151, 43, 0.08)),
    rgba(255, 255, 255, 0.92);
}

.risk-disclaimer strong {
  color: var(--red);
  font-size: 1rem;
}

.risk-disclaimer p {
  margin: 0;
  color: var(--charcoal);
  line-height: 1.7;
}

.metric {
  padding: 18px;
  box-shadow: 0 10px 24px rgba(22, 32, 29, 0.05);
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.65rem;
  line-height: 1.15;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e4da;
}

.progress-fill {
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.launchpad,
.section-progress-panel,
.learning-module,
.tool-panel {
  padding: 22px;
  box-shadow: 0 14px 34px rgba(22, 32, 29, 0.06);
}

.resume-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(34, 107, 115, 0.12), rgba(201, 151, 43, 0.1)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(22, 32, 29, 0.06);
}

.resume-panel h2 {
  font-size: clamp(1.25rem, 2.6vw, 2rem);
}

.resume-panel p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.launchpad,
.section-progress-panel,
.learning-module,
.tools-grid {
  margin: 18px 0;
}

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

.launchpad-grid a {
  min-height: 92px;
  display: grid;
  gap: 6px;
  align-content: center;
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  color: var(--charcoal);
  padding: 14px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.launchpad-grid a:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 107, 115, 0.32);
  box-shadow: 0 12px 26px rgba(22, 32, 29, 0.08);
}

.launchpad-grid strong {
  color: var(--teal);
  font-size: 1rem;
}

.launchpad-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.module-heading {
  position: relative;
  margin-bottom: 16px;
}

.section-toggle {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--charcoal);
  padding: 0 11px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.learning-module.is-collapsed > :not(.module-heading),
.section-progress-panel.is-collapsed > :not(.module-heading),
.quiz-panel.is-collapsed > :not(.quiz-head),
.study-plan.is-collapsed > :not(.plan-copy),
.donate-panel.is-collapsed > :not(.donate-copy) {
  display: none;
}

.quiz-head,
.plan-copy,
.donate-copy {
  position: relative;
}

.module-heading h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.module-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.section-progress-grid,
.dashboard-grid,
.analytics-grid,
.glossary-grid,
.setup-grid,
.setup-library-grid,
.tools-grid {
  display: grid;
  gap: 12px;
}

.section-progress-grid,
.dashboard-grid,
.glossary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.section-progress-card,
.dashboard-grid article,
.analytics-grid article,
.glossary-grid article,
.setup-grid article,
.setup-library-card,
.journal-entry {
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 14px;
}

.section-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-progress-top span,
.dashboard-grid span,
.analytics-grid span,
.journal-entry span,
.journal-entry small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.section-progress-top strong {
  color: var(--teal);
}

.dashboard-grid strong,
.analytics-grid strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.1;
}

.dashboard-grid small,
.analytics-grid small {
  color: var(--muted);
  line-height: 1.45;
}

.discipline-alert {
  margin-top: 14px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: rgba(34, 107, 115, 0.09);
  padding: 13px 15px;
  color: var(--charcoal);
  font-weight: 800;
  line-height: 1.65;
}

.discipline-alert.warning {
  border-left-color: var(--gold);
  background: rgba(201, 151, 43, 0.12);
}

.discipline-alert.danger {
  border-left-color: var(--red);
  background: rgba(185, 75, 75, 0.09);
}

.discipline-alert.success {
  border-left-color: var(--green);
  background: rgba(31, 138, 90, 0.08);
}

.section-progress-card h3 {
  min-height: 44px;
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.35;
}

.section-progress-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.glossary-grid article {
  display: grid;
  gap: 7px;
}

.glossary-grid strong {
  color: var(--teal);
  font-size: 1.02rem;
}

.glossary-grid em {
  color: var(--gold-dark);
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 900;
}

.glossary-search {
  margin-bottom: 14px;
}

.glossary-grid span,
.setup-grid p {
  color: var(--muted);
  line-height: 1.65;
}

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

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

.setup-grid h3 {
  margin: 10px 0 8px;
  font-size: 1.08rem;
}

.setup-library-card {
  display: grid;
  gap: 9px;
  align-content: start;
}

.setup-library-card span {
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.setup-library-card h3 {
  margin: 0;
  font-size: 1.04rem;
}

.setup-library-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.setup-library-card small {
  color: var(--charcoal);
  font-weight: 800;
}

.setup-library-card.grade-a span {
  background: rgba(31, 138, 90, 0.12);
  color: var(--green);
}

.setup-library-card.grade-b span {
  background: rgba(34, 107, 115, 0.12);
  color: var(--teal);
}

.setup-library-card.grade-c span {
  background: rgba(201, 151, 43, 0.14);
  color: var(--gold-dark);
}

.setup-library-card.grade-skip span {
  background: rgba(185, 75, 75, 0.1);
  color: var(--red);
}

.setup-label {
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.setup-label.good {
  background: rgba(31, 138, 90, 0.12);
  color: var(--green);
}

.setup-label.avoid {
  background: rgba(185, 75, 75, 0.1);
  color: var(--red);
}

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

.practice-grid article {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(34, 107, 115, 0.08), rgba(255, 255, 255, 0)),
    #fbfbf7;
  padding: 15px;
}

.practice-grid label {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.practice-grid input {
  accent-color: var(--teal);
}

.practice-grid span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 900;
}

.practice-grid strong {
  font-size: 1.02rem;
}

.practice-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.checklist,
.assessment-form,
.calculator-form,
.journal-form {
  display: grid;
  gap: 11px;
}

.checklist label {
  display: flex;
  align-items: start;
  gap: 10px;
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 11px;
  color: var(--charcoal);
  line-height: 1.55;
  cursor: pointer;
}

.checklist input {
  margin-top: 5px;
  accent-color: var(--teal);
}

.assessment-form,
.calculator-form,
.journal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assessment-form label,
.calculator-form label,
.journal-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.assessment-form select,
.calculator-form input,
.journal-form input,
.journal-form select,
.journal-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}

.journal-form textarea {
  resize: vertical;
}

.assessment-form select:focus,
.calculator-form input:focus,
.journal-form input:focus,
.journal-form select:focus,
.journal-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(34, 107, 115, 0.14);
}

.assessment-form button,
.calculator-form button,
.journal-form button {
  min-height: 44px;
  grid-column: 1 / -1;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.tool-result {
  margin-top: 14px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(201, 151, 43, 0.12);
  padding: 12px 14px;
  color: var(--charcoal);
  line-height: 1.65;
}

.tool-result.is-ready {
  border-left-color: var(--green);
  background: rgba(31, 138, 90, 0.08);
}

.tool-result small {
  display: block;
  color: var(--muted);
}

.journal-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.journal-entry div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.journal-entry p {
  margin: 10px 0 6px;
  color: var(--charcoal);
  line-height: 1.65;
}

.journal-entry small {
  display: block;
  line-height: 1.6;
}

.empty-state.compact {
  padding: 14px;
}

.wide-analytics {
  grid-column: span 4;
}

.wide-analytics strong {
  font-size: 1.08rem;
  line-height: 1.45;
}

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

.trade-plan-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.trade-plan-form input,
.trade-plan-form select,
.trade-plan-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}

.trade-plan-form input:focus,
.trade-plan-form select:focus,
.trade-plan-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(34, 107, 115, 0.14);
}

.trade-plan-form button {
  min-height: 44px;
  grid-column: 1 / -1;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.generated-plan {
  margin-top: 14px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(201, 151, 43, 0.12);
  padding: 14px;
  color: var(--charcoal);
  line-height: 1.65;
}

.generated-plan.is-ready {
  border-left-color: var(--green);
  background: rgba(31, 138, 90, 0.08);
}

.generated-plan p {
  margin: 8px 0 0;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.export-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--charcoal);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.export-actions button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.weekly-review-box {
  white-space: pre-line;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: rgba(34, 107, 115, 0.08);
  padding: 16px;
  color: var(--charcoal);
  font-weight: 700;
  line-height: 1.8;
}

.value-donate-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid rgba(201, 151, 43, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(201, 151, 43, 0.15), rgba(34, 107, 115, 0.08)),
    rgba(255, 255, 255, 0.94);
  padding: 18px;
  box-shadow: 0 14px 34px rgba(22, 32, 29, 0.06);
}

.value-donate-panel strong {
  font-size: 1.08rem;
}

.value-donate-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.privacy-grid article {
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 14px;
}

.privacy-grid strong,
.privacy-grid span {
  display: block;
}

.privacy-grid strong {
  color: var(--teal);
}

.privacy-grid span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.quick-jump {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: grid;
  gap: 8px;
}

.quick-jump a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--teal);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(22, 32, 29, 0.12);
}

.certificate-badge {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(38, 49, 46, 0.94), rgba(34, 107, 115, 0.9)),
    var(--charcoal);
  color: white;
  padding: 22px;
}

.certificate-badge span {
  width: max-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.certificate-badge strong {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.certificate-badge small {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.certificate-badge.is-unlocked {
  background:
    linear-gradient(135deg, rgba(31, 138, 90, 0.95), rgba(201, 151, 43, 0.88)),
    var(--green);
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin: 18px 0;
  position: sticky;
  top: 84px;
  z-index: 5;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(22, 32, 29, 0.07);
}

.controls-head {
  min-width: 190px;
}

.controls-head span {
  display: block;
  color: var(--gold-dark);
  font-size: 0.72rem;
  font-weight: 900;
}

.controls-head strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.search-box input,
.plan-form input,
.plan-form select,
.plan-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}

.search-box input:focus,
.plan-form input:focus,
.plan-form select:focus,
.plan-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(34, 107, 115, 0.14);
}

.filter-button.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

.curriculum {
  display: grid;
  gap: 18px;
}

.section-block {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px 0;
}

.section-heading h2 {
  font-size: 1.28rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

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

.lesson-card {
  min-height: 138px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 16px;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.lesson-card.has-image {
  grid-template-columns: 128px auto minmax(0, 1fr);
  align-items: start;
  min-height: 166px;
  padding: 12px;
}

.lesson-media-stack {
  display: grid;
  gap: 10px;
}

.lesson-media {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(22, 32, 29, 0.09);
  background: #ecebe2;
  aspect-ratio: 4 / 5;
  cursor: zoom-in;
  padding: 0;
}

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

.lesson-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 107, 115, 0.34);
  box-shadow: 0 16px 34px rgba(22, 32, 29, 0.1);
}

.lesson-card:focus-visible {
  outline: 3px solid rgba(34, 107, 115, 0.28);
  outline-offset: 2px;
}

.lesson-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ecebe2;
  color: var(--charcoal);
  font-weight: 800;
}

.lesson-card.done .lesson-number {
  background: rgba(31, 138, 90, 0.14);
  color: var(--green);
}

.lesson-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.lesson-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lesson-body small {
  display: block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
}

.lesson-reading {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.lesson-reading summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(34, 107, 115, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(34, 107, 115, 0.1), rgba(201, 151, 43, 0.08)),
    #fbfbf7;
  color: var(--teal);
  cursor: pointer;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 900;
  list-style: none;
}

.lesson-reading summary strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.lesson-reading summary::-webkit-details-marker {
  display: none;
}

.lesson-reading summary::after {
  content: "+";
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-left: 0;
  border-radius: 8px;
  background: white;
  color: var(--teal);
  font-weight: 900;
}

.lesson-reading[open] summary::after {
  content: "-";
}

.reading-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 12px;
}

.reading-point {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.reading-point span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(34, 107, 115, 0.1);
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 900;
}

.reading-point p {
  margin: 0;
  color: var(--charcoal);
  line-height: 1.7;
  font-size: 0.94rem;
}

.status-pill {
  align-self: start;
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 9px 4px 5px;
  text-align: center;
  color: var(--gold-dark);
  background: rgba(201, 151, 43, 0.14);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.lesson-card.done .status-pill {
  color: var(--green);
  background: rgba(31, 138, 90, 0.12);
}

.status-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 900;
}

.quiz-panel {
  margin-top: 30px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(22, 32, 29, 0.08);
}

.quiz-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.quiz-head p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.quiz-set-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.quiz-set-tab {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf7;
  color: var(--charcoal);
  cursor: pointer;
  padding: 9px 12px;
  text-align: left;
}

.quiz-set-tab span,
.quiz-set-tab small {
  display: block;
}

.quiz-set-tab span {
  font-weight: 900;
}

.quiz-set-tab small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.quiz-set-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  box-shadow: 0 12px 24px rgba(34, 107, 115, 0.16);
}

.quiz-set-tab.active small {
  color: rgba(255, 255, 255, 0.76);
}

.quiz-score-card {
  min-width: 150px;
  border-radius: 8px;
  background: var(--teal-soft);
  padding: 14px;
  text-align: right;
}

.quiz-score-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.quiz-score-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.25rem;
}

.quiz-form {
  display: grid;
  gap: 12px;
}

.quiz-question {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 16px;
}

.quiz-question legend {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
}

.quiz-question legend span {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ecebe2;
  color: var(--charcoal);
}

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

.quiz-options label {
  display: flex;
  align-items: start;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  color: var(--charcoal);
  cursor: pointer;
}

.quiz-options input {
  margin-top: 4px;
  accent-color: var(--teal);
}

.quiz-explain {
  min-height: 0;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.quiz-question.is-correct {
  border-color: rgba(31, 138, 90, 0.36);
  background: rgba(31, 138, 90, 0.06);
}

.quiz-question.is-wrong {
  border-color: rgba(185, 75, 75, 0.36);
  background: rgba(185, 75, 75, 0.05);
}

.quiz-question.is-correct .quiz-explain {
  color: var(--green);
  font-weight: 700;
}

.quiz-question.is-wrong .quiz-explain {
  color: var(--red);
  font-weight: 700;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quiz-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

#submitQuiz {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

#resetQuiz {
  background: white;
  color: var(--charcoal);
}

.quiz-result {
  margin-top: 14px;
  border-radius: 8px;
  padding: 0;
  line-height: 1.7;
}

.quiz-result.is-pass,
.quiz-result.is-review {
  padding: 14px;
}

.quiz-result.is-pass {
  border-left: 4px solid var(--green);
  background: rgba(31, 138, 90, 0.08);
}

.quiz-result.is-review {
  border-left: 4px solid var(--gold);
  background: rgba(201, 151, 43, 0.12);
}

.study-plan {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.2fr);
  gap: 24px;
  margin-top: 34px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.plan-copy p:last-child {
  color: var(--muted);
  line-height: 1.7;
}

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

.plan-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.wide-field,
.plan-form button,
.plan-result {
  grid-column: 1 / -1;
}

.plan-form textarea {
  resize: vertical;
}

.plan-result {
  display: none;
  align-self: end;
  border-left: 4px solid var(--green);
  background: rgba(31, 138, 90, 0.08);
  padding: 12px 14px;
  line-height: 1.6;
}

.donate-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 28px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(201, 151, 43, 0.12), rgba(34, 107, 115, 0.08)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(22, 32, 29, 0.08);
}

.donate-copy p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.qr-card {
  width: min(100%, 280px);
  border: 1px solid rgba(22, 32, 29, 0.1);
  border-radius: 8px;
  background: white;
  padding: 14px;
  text-align: center;
}

.qr-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
}

.qr-card strong {
  display: block;
  margin-top: 12px;
}

.qr-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 84px 28px 32px;
  background: rgba(10, 16, 14, 0.82);
  overflow: auto;
  text-align: center;
}

.image-lightbox.is-open {
  display: block;
}

.image-lightbox img {
  display: block;
  width: min(100%, 1100px);
  max-width: none;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  background: white;
  object-fit: contain;
  transition: width 160ms ease;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.image-lightbox p {
  max-width: min(100%, 1100px);
  margin: 12px 0 0;
  color: white;
  font-weight: 800;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-tools {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 51;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 16, 14, 0.72);
  color: white;
}

.lightbox-tools button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.lightbox-tools span {
  min-width: 52px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 920px) {
  html {
    scroll-padding-top: 132px;
  }

  body {
    padding-bottom: 88px;
  }

  .nav-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
  }

  .main-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 44;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    justify-content: stretch;
    border: 1px solid rgba(22, 32, 29, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    padding: 8px;
    box-shadow: 0 18px 46px rgba(22, 32, 29, 0.18);
    backdrop-filter: blur(18px);
  }

  .main-nav a {
    min-height: 48px;
    width: 100%;
    justify-content: center;
    padding: 0;
    border-radius: 9px;
    font-size: 0;
  }

  .main-nav a > span:last-child {
    display: none;
  }

  .main-nav .nav-icon {
    width: 36px;
    height: 36px;
  }

  .main-nav .nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .nav-member {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px;
  }

  .nav-member > div:first-child {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .nav-member > div:first-child span,
  .nav-member > div:first-child strong {
    margin: 0;
  }

  .nav-member .login-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: initial;
    gap: 8px;
    justify-content: stretch;
  }

  .nav-member .login-button {
    width: 100%;
    min-width: 0;
  }

  .hero,
  .study-plan,
  .donate-panel,
  .resume-panel,
  .tools-grid {
    grid-template-columns: 1fr;
  }

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

  .hero {
    min-height: auto;
  }

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

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

  .controls {
    grid-template-columns: 1fr;
    top: 118px;
  }

  .lesson-card.has-image {
    grid-template-columns: 104px auto minmax(0, 1fr);
  }

.lesson-card.has-image .status-pill {
    grid-column: auto;
    justify-self: center;
  }

  .quiz-head {
    display: grid;
  }

  .reading-content {
    grid-template-columns: 1fr;
  }

  .quiz-score-card {
    text-align: left;
  }

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

  .section-progress-grid,
  .dashboard-grid,
  .analytics-grid,
  .glossary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-grid,
  .setup-library-grid,
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .wide-analytics {
    grid-column: span 2;
  }

  .value-donate-panel {
    grid-template-columns: 1fr;
  }

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

  .quick-jump {
    bottom: 86px;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 122px;
  }

  body {
    padding-bottom: 86px;
  }

  .app-shell {
    width: min(100% - 20px, 1500px);
    padding-top: 14px;
  }

  .nav-inner {
    width: min(100% - 20px, 1500px);
    min-height: 0;
  }

  .brand-mark strong {
    font-size: 0.98rem;
  }

  .brand-mark img {
    width: 38px;
    height: 38px;
  }

  .main-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 6px;
    border-radius: 12px;
    padding: 7px;
  }

  .main-nav a {
    min-height: 46px;
  }

  .main-nav .nav-icon {
    width: 34px;
    height: 34px;
  }

  .nav-member {
    grid-template-columns: 1fr;
    padding: 7px 8px;
  }

  .nav-member > div:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
    justify-content: start;
  }

  .nav-member span {
    font-size: 0.72rem;
  }

  .nav-member strong {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
  }

  .login-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: initial;
    gap: 7px;
  }

  .login-button {
    min-height: 32px;
    width: 100%;
    min-width: 0;
    gap: 5px;
    padding: 0 7px;
    font-size: 0.78rem;
  }

  .login-button .button-icon {
    width: 22px;
    height: 22px;
  }

  .overview,
  .lesson-grid,
  .quiz-options,
  .quiz-set-tabs,
  .plan-form,
  .assessment-form,
  .trade-plan-form,
  .section-progress-grid,
  .dashboard-grid,
  .analytics-grid,
  .glossary-grid,
  .setup-library-grid,
  .practice-grid,
  .calculator-form,
  .journal-form {
    grid-template-columns: 1fr;
  }

  .resume-panel .primary-action {
    width: 100%;
  }

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

  .wide-analytics {
    grid-column: 1;
  }

  .section-toggle {
    position: static;
    width: max-content;
    margin-top: 12px;
  }

  .quick-jump {
    right: 10px;
    bottom: 76px;
  }

  .quick-jump a {
    width: 38px;
    height: 38px;
  }

  .risk-disclaimer {
    grid-template-columns: 1fr;
  }

  .section-progress-panel,
  .launchpad,
  .learning-module,
  .tool-panel {
    padding: 16px;
  }

  .journal-entry div {
    display: grid;
  }

  .controls,
  .section-heading {
    align-items: stretch;
  }

  .controls {
    position: static;
    top: auto;
    z-index: auto;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

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

.lesson-card.has-image {
    grid-template-columns: 1fr;
  }

  .lesson-media {
    aspect-ratio: 16 / 9;
  }

  .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* =====================================================
   PREMIUM RETENTION & DONATION UPGRADES
   ===================================================== */
.streak-widget-header {
  border-right: 1px solid rgba(22, 32, 29, 0.1);
  padding-right: 12px;
  display: grid;
  gap: 2px;
  cursor: pointer;
  transition: transform 150ms ease;
}
.streak-widget-header:hover {
  transform: scale(1.05);
}
.streak-widget-header span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.streak-widget-header strong.streak-display {
  display: block;
  margin-top: 3px;
  color: #ff6a00;
  font-weight: 900;
  font-size: 1.05rem;
  text-shadow: 0 0 8px rgba(255, 106, 0, 0.2);
}

.capital-preserved-card {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(201, 151, 43, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(201, 151, 43, 0.08), rgba(248, 247, 240, 0.8));
  padding: 14px;
  box-shadow: 0 8px 20px rgba(201, 151, 43, 0.06);
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.capital-preserved-card .card-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
}
.capital-preserved-card .card-content {
  display: grid;
  gap: 4px;
}
.capital-preserved-card .card-content strong {
  color: var(--gold-dark);
  font-size: 0.98rem;
  font-weight: 800;
}
.capital-preserved-card .card-content p {
  margin: 0;
  color: var(--charcoal);
  font-size: 0.88rem;
  line-height: 1.5;
}
.nudge-donate-link {
  display: inline-flex;
  align-self: start;
  margin-top: 4px;
  color: var(--teal);
  font-weight: 800;
  font-size: 0.86rem;
  text-decoration: underline;
  transition: color 150ms ease;
}
.nudge-donate-link:hover {
  color: var(--gold-dark);
}

.donate-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 22px;
}
.donation-extras {
  display: grid;
  gap: 16px;
}

.funding-goal-widget {
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 16px;
}
.funding-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.funding-info span {
  font-weight: 800;
  color: var(--charcoal);
  font-size: 0.9rem;
}
.funding-info strong {
  color: var(--gold-dark);
  font-size: 1.05rem;
  font-weight: 900;
}
.funding-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e4da;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
.funding-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  box-shadow: 0 0 10px rgba(201, 151, 43, 0.4);
  position: relative;
  overflow: hidden;
}
.funding-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shineProgress 2.5s infinite linear;
}
.funding-meta {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.donor-wall-widget {
  border: 1px solid rgba(22, 32, 29, 0.08);
  border-radius: 8px;
  background: #fbfbf7;
  padding: 16px;
  overflow: hidden;
}
.donor-wall-widget h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}
.donor-list-carousel {
  position: relative;
  min-height: 48px;
  display: grid;
}
.donor-item {
  display: none;
  font-size: 0.86rem;
  color: var(--charcoal);
  line-height: 1.5;
  padding: 8px;
  border-radius: 6px;
  background: rgba(34, 107, 115, 0.04);
  border-left: 3px solid var(--teal);
  animation: fadeIn 0.4s ease;
}
.donor-item.active {
  display: block;
}

@keyframes shineProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes slideInUp {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@media (max-width: 768px) {
  .nav-member {
    min-width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    text-align: center;
    gap: 8px;
  }
  .streak-widget-header {
    border-right: none;
    border-bottom: 1px solid rgba(22, 32, 29, 0.1);
    padding-right: 0;
    padding-bottom: 8px;
  }
  .donate-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* =====================================================
   PHASE 2 UPGRADE STYLES (PREP DESK & JOY MODAL)
   ===================================================== */
.daily-prep-panel {
  margin-top: 18px !important;
  background: linear-gradient(180deg, #101816 0%, #172421 100%) !important;
  color: white;
  border-color: rgba(34, 107, 115, 0.28) !important;
}
.daily-prep-panel .module-heading h2 {
  color: #fff;
}
.daily-prep-panel .module-heading p {
  color: rgba(255, 255, 255, 0.65) !important;
}
.prep-desk-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  margin-top: 18px;
}
.prep-bias-card, .prep-news-card {
  background: rgba(22, 33, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}
.prep-bias-card h4, .prep-news-card h4 {
  margin: 0 0 12px;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--gold);
}
.prep-bias-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.prep-bias-stats div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.prep-bias-stats span {
  display: block;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 800;
}
.prep-bias-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  font-weight: 900;
}
#htfH4Bias.BUY, #htfH1Bias.BUY { color: var(--green); }
#htfH4Bias.SELL, #htfH1Bias.SELL { color: var(--red); }
#htfH4Bias.WAIT, #htfH1Bias.WAIT { color: #f3d184; }
.prep-meta {
  margin: 12px 0 0;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.4;
}

.prep-news-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}
.prep-news-list::-webkit-scrollbar {
  width: 4px;
}
.prep-news-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}
.news-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}
.news-item.high {
  border-left: 3px solid var(--red);
  background: rgba(185, 75, 75, 0.04);
}
.news-item.medium {
  border-left: 3px solid var(--gold);
  background: rgba(201, 151, 43, 0.04);
}
.news-info {
  display: grid;
  gap: 3px;
}
.news-info strong {
  font-size: 0.88rem;
  color: #fff;
  font-weight: 700;
}
.news-info span {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.5);
}
.news-time-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f3d184;
  white-space: nowrap;
}
.compact-loading {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.84rem;
  text-align: center;
  padding: 20px;
}

/* Moment of Joy Modal */
.moment-joy-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.moment-joy-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(22, 32, 29, 0.72);
  backdrop-filter: blur(8px);
}
.joy-modal-content {
  position: relative;
  z-index: 10;
  max-width: 480px;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(201, 151, 43, 0.32);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38), 0 0 40px rgba(201, 151, 43, 0.15);
  transform: scale(0.95);
  animation: modalPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.sparkle-gold {
  font-size: 3.2rem;
  margin-bottom: 12px;
  animation: floatSparkle 1.8s infinite ease-in-out;
}
.joy-title {
  margin: 0 0 6px;
  font-size: 1.48rem;
  font-weight: 800;
  color: var(--gold-dark);
}
.joy-subtitle {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}
.joy-score-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  border-radius: 999px;
  padding: 8px 24px;
  box-shadow: 0 8px 24px rgba(201, 151, 43, 0.3);
  margin-bottom: 18px;
}
.joy-score-badge span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.joy-score-badge strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 2px;
}
.joy-message {
  margin: 0 0 22px;
  font-size: 0.86rem;
  color: var(--charcoal);
  line-height: 1.65;
}
.joy-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.gold-metallic {
  background: linear-gradient(135deg, #c9972b, #8a6418) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(138, 100, 24, 0.28);
}
.gold-metallic:hover {
  background: linear-gradient(135deg, #8a6418, #6d4e11) !important;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
}

@keyframes modalPop {
  to { transform: scale(1); }
}
@keyframes floatSparkle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.08); }
}

@media (max-width: 768px) {
  .prep-desk-layout {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   PHASE 3 UPGRADE STYLES (CAPITAL SAVED & CHIMES)
   ===================================================== */
.confirm-skip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 8px;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--green), #1b6d47);
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 138, 90, 0.22);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.confirm-skip-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 138, 90, 0.32);
}
.confirm-skip-btn:active {
  transform: translateY(0);
}
.confirm-skip-btn.disabled {
  background: var(--line) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  pointer-events: none;
}

.dashboard-grid article.gold-highlight-card {
  border-color: rgba(201, 151, 43, 0.32) !important;
  background: linear-gradient(135deg, rgba(201, 151, 43, 0.05), rgba(255, 255, 255, 0.95)) !important;
  box-shadow: 0 8px 22px rgba(201, 151, 43, 0.05) !important;
  position: relative;
  overflow: hidden;
}
.dashboard-grid article.gold-highlight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
}
.dashboard-grid article.gold-highlight-card strong {
  color: var(--gold-dark);
}

/* Level Up Notification Widget */
.level-up-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(22, 32, 29, 0.95);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 12px 32px rgba(201, 151, 43, 0.25);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9999;
  backdrop-filter: blur(8px);
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.5s ease 4.5s forwards;
}
.level-up-badge {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #121815;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(201, 151, 43, 0.3);
}
.level-up-details {
  display: grid;
  gap: 2px;
}
.level-up-details strong {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  display: inline-block;
}
.level-up-details span {
  color: #a4b4ad;
  font-size: 0.84rem;
}
.level-up-details span strong {
  color: var(--gold);
  font-weight: 700;
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
  }
}
