:root {
  --green-950: #241a08;
  --green-900: #2b210e;
  --green-800: #4a3510;
  --beige: #fff7dc;
  --paper: #fffdf5;
  --gold: #e1ad20;
  --gold-deep: #8a6000;
  --ink: #291f0d;
  --muted: #6e624a;
  --line: rgba(92, 67, 13, .18);
  --danger: #a83a35;
  --shadow: 0 24px 70px rgba(76, 52, 5, .14);
}

* { box-sizing: border-box; }
html { background: var(--beige); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 12px; font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gold { color: var(--gold-deep); }
.muted { color: var(--muted); }

.auth-shell { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 100vh; }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(46px, 8vw, 120px); overflow: hidden; color: var(--ink); background: radial-gradient(circle at 82% 25%, rgba(255,255,255,.42), transparent 31%), radial-gradient(circle at 4% 86%, rgba(255,248,220,.34), transparent 28%), linear-gradient(135deg, #f6d45f 0%, #e1ad20 58%, #c78e09 100%); }
.auth-brand::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 440px; height: 440px; border: 1px solid rgba(75,53,16,.24); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,248,220,.12), 0 0 0 140px rgba(255,248,220,.08); }
.brand-logo { display: block; width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; }
.brand-logo.hero-logo { width: 72px; height: 72px; margin-bottom: 52px; box-shadow: 0 12px 28px rgba(76,52,5,.18); }
.auth-brand h1 { max-width: 720px; margin: 0 0 24px; font-family: Georgia, serif; font-size: clamp(2.65rem, 6vw, 5.4rem); font-weight: 500; line-height: .98; letter-spacing: -.04em; }
.auth-brand h1 span { color: #fff7dc; text-shadow: 0 2px 18px rgba(76,52,5,.22); }
.auth-brand > p:not(.eyebrow) { max-width: 610px; font-size: 1.12rem; line-height: 1.7; color: rgba(41,31,13,.78); }
.trust-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 30px; color: rgba(41,31,13,.84); font-size: .86rem; }
.trust-row span::before { content: "✓"; margin-right: 8px; color: var(--green-800); font-weight: 900; }
.auth-panel { display: grid; place-items: center; padding: 32px; background: var(--beige); }
.auth-card { width: min(440px, 100%); padding: 46px; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 2.2rem; font-weight: 500; }
form { display: grid; gap: 16px; margin-top: 26px; }
label { display: grid; gap: 7px; font-size: .84rem; font-weight: 750; }
input, textarea { width: 100%; border: 1px solid #d6ccba; border-radius: 11px; background: #fff; color: var(--ink); outline: none; transition: .2s; }
input { min-height: 48px; padding: 0 14px; }
textarea { min-height: 150px; padding: 14px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(198,164,88,.16); }
.button { min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; font-weight: 800; }
.button.primary { color: #fff; background: var(--green-900); }
.button.gold-button { color: var(--green-950); background: var(--gold); }
.button.outline { border: 1px solid var(--green-800); color: var(--green-900); background: transparent; }
.text-button { padding: 8px 0; border: 0; color: var(--green-800); background: none; font-weight: 800; }
.text-button.light { color: #e5ddcd; }
.auth-card > .text-button { width: 100%; margin-top: 7px; }
.help, .privacy { color: var(--muted); font-size: .73rem; line-height: 1.5; }
.privacy { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.error { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: .82rem; }

.app-shell { min-height: 100vh; background: var(--beige); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; width: 260px; flex-direction: column; padding: 30px 20px 24px; color: #fff; background: var(--green-950); }
.logo-row { display: flex; align-items: center; gap: 13px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.logo-row div:last-child { display: grid; gap: 2px; }
.logo-row small { max-width: 155px; color: #d1c6af; font-size: .62rem; line-height: 1.35; letter-spacing: .06em; text-transform: uppercase; }
nav { display: grid; gap: 7px; margin-top: 28px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 15px; border: 0; border-radius: 10px; color: #bed0c8; background: transparent; text-align: left; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active { box-shadow: inset 3px 0 var(--gold); }
.sidebar-foot { margin-top: auto; padding: 18px 9px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-foot p { margin: 0; font-weight: 800; }
main { min-height: 100vh; margin-left: 260px; }
.mobile-header { display: none; }
.view { padding: 56px clamp(28px, 5vw, 80px) 80px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-head h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 500; letter-spacing: -.035em; }
.page-head p { max-width: 650px; margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.sync-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.sync-status::before, #sync-dot { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #54a678; box-shadow: 0 0 0 4px rgba(84,166,120,.13); }
.hero-card { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 30px; padding: clamp(30px, 5vw, 62px); overflow: hidden; border-radius: 28px; color: var(--ink); background: radial-gradient(circle at 86% 18%, rgba(255,255,255,.42), transparent 28%), linear-gradient(135deg, #f6d45f 0%, #e1ad20 58%, #c78e09 100%); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; right: -80px; bottom: -180px; width: 380px; height: 380px; border: 1px solid rgba(75,53,16,.24); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,248,220,.1); }
.hero-card h2 { max-width: 670px; margin: 0 0 14px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 500; line-height: 1.06; }
.hero-card p { max-width: 650px; margin: 0 0 25px; color: rgba(41,31,13,.76); line-height: 1.65; }
.progress-ring { position: relative; z-index: 1; display: grid; place-items: center; align-self: center; justify-self: center; width: 170px; height: 170px; border-radius: 50%; background: conic-gradient(var(--green-900) var(--progress), rgba(255,253,245,.38) 0); box-shadow: 0 24px 50px rgba(76,52,5,.16); }
.progress-ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: rgba(255,253,245,.92); }
.progress-ring div { position: relative; display: grid; text-align: center; }
.progress-ring strong { font-family: Georgia, serif; font-size: 2.6rem; font-weight: 500; }
.progress-ring small { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 24px 0 40px; }
.stat-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.stat-card span { color: var(--muted); font-size: .78rem; }
.stat-card strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 17px; }
.section-title h2 { margin: 0; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lesson-card { position: relative; display: grid; min-height: 235px; padding: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 12px 36px rgba(76,52,5,.08); transition: .2s; }
.lesson-card::after { content: ""; position: absolute; width: 130px; height: 130px; right: -65px; top: -65px; border: 1px solid rgba(205,164,94,.25); border-radius: 50%; }
.lesson-card:hover { transform: translateY(-3px); border-color: #c8b78f; box-shadow: 0 14px 30px rgba(17,56,46,.08); }
.lesson-top { display: flex; align-items: center; justify-content: space-between; }
.lesson-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--gold-deep); background: #f3ead5; font-family: Georgia, serif; font-weight: 800; }
.badge { padding: 5px 9px; border-radius: 99px; color: var(--muted); background: #eee9df; font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.badge.done { color: #246244; background: #dceee3; }
.lesson-card h3 { margin: 20px 0 8px; font-size: 1.05rem; line-height: 1.35; }
.lesson-card p { margin: 0 0 18px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.lesson-card button { align-self: end; justify-self: start; }
.day-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 22px; color: var(--green-800); font-weight: 900; }
.day-heading::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.practice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.practice-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.practice-card .icon { font-size: 1.5rem; color: var(--gold-deep); }
.practice-card h3 { margin: 16px 0 9px; }
.practice-card p { color: var(--muted); line-height: 1.6; }
.prompt-box { margin-top: 20px; padding: 18px; border-left: 3px solid var(--gold); background: #f6f0e4; line-height: 1.6; }

.lesson-page { max-width: 940px; margin: 0 auto; }
.back-button { margin-bottom: 22px; border: 0; color: var(--green-800); background: none; font-weight: 800; }
.lesson-hero { position: relative; padding: 38px; overflow: hidden; border-radius: 28px; color: var(--ink); background: radial-gradient(circle at 88% 16%, rgba(255,255,255,.45), transparent 30%), linear-gradient(135deg, #f6d45f, #e1ad20 60%, #c78e09); box-shadow: var(--shadow); }
.lesson-hero h1 { margin: 12px 0; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; }
.lesson-hero p { max-width: 700px; color: rgba(41,31,13,.76); line-height: 1.6; }
.lesson-content { display: grid; gap: 20px; margin-top: 22px; }
.content-card { padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 12px 36px rgba(76,52,5,.06); }
.content-card h2 { margin: 0 0 16px; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; }
.content-card p, .content-card li { line-height: 1.7; }
.content-card li + li { margin-top: 10px; }
.callout { padding: 19px; border-left: 4px solid var(--gold); background: #f5eddc; line-height: 1.65; }
.quiz-options { display: grid; gap: 9px; margin: 16px 0; }
.quiz-option { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; }
.quiz-option:hover { border-color: var(--gold-deep); }
.quiz-option.correct { border-color: #47805d; color: #24533a; background: #e3f0e7; }
.quiz-option.incorrect { border-color: #b25b55; color: #7f2d29; background: #f7e5e3; }
.quiz-feedback { min-height: 24px; font-weight: 750; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.knowledge-anchor-row { position: sticky; top: 18px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; width: fit-content; margin: -8px 0 42px; padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,245,.9); box-shadow: 0 12px 35px rgba(76,52,5,.1); backdrop-filter: blur(12px); }
.knowledge-anchor-row a { padding: 8px 13px; border-radius: 999px; color: var(--green-800); text-decoration: none; font-size: .76rem; font-weight: 850; }
.knowledge-anchor-row a:hover { color: var(--ink); background: #f3e6b8; }
.knowledge-section { margin: 0 0 76px; scroll-margin-top: 90px; }
.knowledge-intro { max-width: 780px; margin-bottom: 24px; }
.knowledge-intro h2, .source-panel h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 500; letter-spacing: -.025em; }
.knowledge-intro > p:last-child, .source-panel > p { color: var(--muted); line-height: 1.7; }
.knowledge-list { display: grid; gap: 11px; }
.knowledge-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 10px 28px rgba(76,52,5,.055); }
.knowledge-card summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 24px; list-style: none; cursor: pointer; }
.knowledge-card summary::-webkit-details-marker { display: none; }
.knowledge-card summary span:first-child { display: grid; gap: 3px; }
.knowledge-card summary small, .knowledge-tag { color: var(--gold-deep); font-size: .65rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.knowledge-card summary strong { font-family: Georgia, serif; font-size: 1.28rem; font-weight: 600; }
.expand-mark { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 50%; color: var(--paper); background: var(--green-900); font-size: 1.25rem; transition: transform .2s; }
.knowledge-card[open] .expand-mark { transform: rotate(45deg); background: var(--gold); color: var(--ink); }
.knowledge-body { padding: 0 24px 24px; border-top: 1px solid var(--line); }
.knowledge-body > p { margin: 19px 0; line-height: 1.7; }
.knowledge-body dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 0; }
.knowledge-body dl > div { padding: 16px; border-radius: 12px; background: #faf3df; }
.knowledge-body .compare-note { background: #f2df9d; }
.knowledge-body dt, .annuity-card dt { margin-bottom: 6px; color: var(--gold-deep); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.knowledge-body dd, .annuity-card dd { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 12px 34px rgba(76,52,5,.06); }
table { width: 100%; min-width: 960px; border-collapse: collapse; font-size: .8rem; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
thead th { color: var(--paper); background: var(--green-900); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
tbody th { width: 175px; color: var(--green-900); font-weight: 850; background: #fcf7e9; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.annuity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.annuity-card { padding: 25px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 12px 34px rgba(76,52,5,.06); }
.annuity-card h3 { margin: 12px 0 10px; font-family: Georgia, serif; font-size: 1.35rem; }
.annuity-card > p { color: var(--muted); line-height: 1.65; }
.annuity-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 0; }
.annuity-card dl > div { padding: 13px; border-radius: 11px; background: #faf3df; }
.knowledge-callout { margin-top: 18px; }
.knowledge-callout b { color: var(--green-800); }
.workflow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: workflow; }
.workflow li { position: relative; min-height: 176px; padding: 54px 21px 21px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); counter-increment: workflow; }
.workflow li::before { content: counter(workflow); position: absolute; top: 17px; left: 20px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--paper); background: var(--gold-deep); font-size: .72rem; font-weight: 900; }
.workflow strong { display: block; margin-bottom: 7px; color: var(--green-900); }
.workflow span { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.source-panel { padding: 32px; border: 1px solid rgba(75,53,16,.22); border-radius: 24px; background: linear-gradient(135deg, #f6d45f, #e1ad20 62%, #c78e09); box-shadow: var(--shadow); }
.source-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.source-links a { padding: 10px 13px; border: 1px solid rgba(41,31,13,.28); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .74rem; font-weight: 850; background: rgba(255,253,245,.34); }
.source-links a:hover { background: rgba(255,253,245,.65); }
.knowledge-disclaimer { margin: 22px 0 0 !important; padding-top: 18px; border-top: 1px solid rgba(41,31,13,.2); color: rgba(41,31,13,.72) !important; font-size: .72rem; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 340px; padding: 13px 18px; border-radius: 10px; color: #fff; background: var(--green-950); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: min(70vh, 680px); padding: 72px clamp(32px, 10vw, 110px); }
  .auth-panel { padding: 52px 24px; }
  .lesson-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .progress-ring { justify-self: start; }
  .knowledge-body dl, .workflow { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 44vh; padding: 44px 28px; }
  .auth-brand .hero-logo { width: 58px; height: 58px; margin-bottom: 30px; }
  .auth-brand h1 { font-size: 2.65rem; }
  .trust-row { display: none; }
  .auth-panel { padding: 22px 16px 42px; }
  .auth-card { padding: 30px 24px; }
  .sidebar { transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  main { margin-left: 0; }
  .mobile-header { position: sticky; top: 0; z-index: 7; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 18px; color: #fff; background: var(--green-950); }
  .mobile-header button { border: 0; color: #fff; background: transparent; font-size: 1.35rem; }
  .view { padding: 30px 18px 60px; }
  .page-head { align-items: start; flex-direction: column; }
  .hero-card { padding: 30px 24px; }
  .stats, .lesson-grid, .practice-grid { grid-template-columns: 1fr; }
  .knowledge-anchor-row { position: static; border-radius: 18px; }
  .knowledge-body dl, .annuity-grid, .workflow { grid-template-columns: 1fr; }
  .annuity-card dl { grid-template-columns: 1fr; }
  .knowledge-card summary { padding: 18px; }
  .knowledge-body { padding: 0 18px 18px; }
  .source-panel { padding: 25px 20px; }
  .lesson-card { min-height: 210px; }
  .content-card { padding: 23px 20px; }
  .lesson-hero { padding: 28px 22px; }
}
