/* Color follows the subject; green/amber feedback still means the same thing everywhere. */
:root {
  --subject-accent: #087c60;
  --subject-deep: #075844;
  --subject-soft: #e1f7ec;
  --subject-border: #a8dfc9;
  --steady-ink: #213b38;
  --steady-muted: #526661;
}
.olive, [data-subject="math"] { --subject-accent: #087c60; --subject-deep: #075844; --subject-soft: #e1f7ec; --subject-border: #a8dfc9; }
.clay, [data-subject="rla"] { --subject-accent: #7350c6; --subject-deep: #513190; --subject-soft: #f1eaff; --subject-border: #d1bff1; }
.blue, [data-subject="science"] { --subject-accent: #176ab4; --subject-deep: #164c82; --subject-soft: #e5f3ff; --subject-border: #b5d6f3; }
.rose, [data-subject="social"] { --subject-accent: #b94b30; --subject-deep: #853420; --subject-soft: #fff0e6; --subject-border: #efc2ae; }
body { background: #f7f8f4; color: var(--steady-ink); }
.main-wrap { background: radial-gradient(ellipse at 94% 0, #e5f0ff70, transparent 540px), radial-gradient(ellipse at 3% 1%, #fff0cd60, transparent 430px); }
.sidebar { background: #fffefa; border-color: #dde7e0; }
.sidebar nav > a { border-radius: 13px; }
.sidebar nav > a > span:first-child { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: #087c60; background: #e1f7ec; }
.sidebar nav > a:nth-child(2) > span:first-child { color: #7350c6; background: #f1eaff; }
.sidebar nav > a:nth-child(3) > span:first-child { color: #176ab4; background: #e5f3ff; }
.sidebar nav > a:nth-child(4) > span:first-child { color: #a5482e; background: #fff0e6; }
.sidebar nav > a:nth-child(5) > span:first-child { color: #826016; background: #fff1bf; }
.sidebar nav > a[aria-current="page"] { background: #204b40; color: #fff; box-shadow: 0 4px 12px #204b4015; }
.sidebar nav > a[aria-current="page"] > span:first-child { color: #204b40; background: #c5efd5; }
.sidebar nav > a:hover:not([aria-current="page"]) { background: #edf4ed; }
.guest-avatar { background: #e9e0fa; color: #513190; border-color: #d7c9ec; }
.page-heading h1 { letter-spacing: -.045em; color: #233b38; }
.button.primary { background: var(--subject-accent); box-shadow: 0 3px 0 var(--subject-deep); }
.button.primary:hover { background: var(--subject-deep); box-shadow: 0 4px 0 var(--subject-deep); }
.button.secondary:hover { background: var(--subject-soft); border-color: var(--subject-border); color: var(--subject-deep); }
.subject-tag[class] { color: var(--subject-deep); background: var(--subject-soft); border: 1px solid var(--subject-border); border-radius: 8px; }

/* A small, attainable goal. All counts come from saved answers. */
.learning-moments { margin: 0 0 28px; }
.daily-moment { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 28px; padding: 34px 42px; border: 1px solid #246c58; border-radius: 24px; color: #fff; background: radial-gradient(ellipse at 90% 100%, #2b704f, transparent 65%), linear-gradient(110deg, #183f36, #17614f); box-shadow: 0 10px 24px #174c3810; overflow: hidden; }
.daily-moment::after { content: ''; position: absolute; z-index: -1; right: -60px; top: -155px; width: 380px; height: 380px; border: 1px solid #ffffff18; border-radius: 50%; box-shadow: 0 0 0 50px #ffffff05, 0 0 0 100px #ffffff04; }
.daily-moment-copy { position: relative; z-index: 1; }
.daily-moment .eyebrow { margin: 0 0 12px; color: #c3efd4; font-size: 10px; letter-spacing: .13em; }
.daily-moment h2 { color: #fffdf0; font-size: clamp(27px, 2.7vw, 37px); max-width: 20ch; line-height: 1.15; letter-spacing: -.04em; margin: 0 0 13px; }
.daily-moment-copy > p:not(.eyebrow) { color: #def2e7; font-size: 14px; line-height: 1.65; max-width: 46ch; margin: 0 0 21px; }
.daily-moment .button.primary { color: #183f36; background: #f9da7c; box-shadow: 0 3px 0 #bf9742; min-height: 46px; }
.daily-moment .button.primary:hover { background: #ffe797; box-shadow: 0 4px 0 #bf9742; }
.daily-moment .button:focus-visible { outline-color: #fff5d1; }
.daily-moment-progress { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.daily-medallion { display: grid; place-items: center; width: 115px; height: 115px; border: 1px solid #d9f7b370; border-radius: 36px; color: #f9e4a2; background: linear-gradient(145deg, #c7f5c125, #a1e6b00b); box-shadow: inset 0 1px 0 #ffffff26; transform: rotate(-7deg); }
.daily-medallion > * { transform: rotate(7deg); }
.daily-medallion strong { font-size: 51px; line-height: 1; letter-spacing: -.06em; font-weight: 650; }
.daily-medallion small { font-size: 24px; color: #dbf0df; font-weight: 400; letter-spacing: 0; }
.daily-moment svg, .milestone svg, .session-moment svg, #learning-celebration svg { display: block; width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.daily-medallion svg { width: 60px; height: 60px; }
.daily-five { display: flex; gap: 9px; }
.daily-five > span { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #aacdb7; border-radius: 9px; color: #d5e9db; font-size: 18px; background: #ffffff08; }
.daily-five > .is-filled { background: #f9da7c; border-color: #f9da7c; color: #214a3b; font-size: 16px; font-weight: 700; }
.daily-moment-progress > p { margin: 0; font-size: 12px; color: #def2e7; text-align: center; }
.moment-spark { position: absolute; color: #f9da7c; pointer-events: none; font-size: 27px; }
.spark-one { right: 245px; top: 37px; transform: rotate(12deg); }
.spark-two { right: 30px; bottom: 37px; font-size: 22px; }
.daily-moment.is-complete .daily-medallion { color: #183f36; background: #f9da7c; border-color: #ffe9aa; }
.milestone-strip { display: grid; grid-template-columns: minmax(175px, 1fr) minmax(0, 2fr); align-items: center; gap: 24px; margin-top: 15px; padding: 23px 30px; border: 1px solid #e0e7de; border-radius: 20px; background: #fffefa; }
.milestone-intro .eyebrow { font-size: 9px; color: #6d6051; letter-spacing: .11em; }
.milestone-intro h3 { font-size: 22px; letter-spacing: -.035em; margin: 7px 0; }
.milestone-intro p { margin: 0; max-width: 24ch; font-size: 12px; line-height: 1.65; }
.milestone-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.milestone { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 8px 4px; border: 1px solid transparent; border-radius: 13px; text-align: center; color: #51665d; transition: background .16s, transform .16s; }
.milestone-medallion { position: relative; display: grid; place-items: center; width: 57px; height: 57px; margin-bottom: 3px; border: 1px dashed #bac9bf; border-radius: 19px; background: #f3f6f0; color: #6b8273; }
.milestone-medallion svg { width: 31px; height: 31px; }
.milestone strong { font-size: 12px; line-height: 1.4; font-weight: 650; }
.milestone > span:last-child { font-size: 11px; }
.milestone.is-earned { color: #285745; }
.milestone.is-earned .milestone-medallion { border: 1px solid #aad6ba; color: #126143; background: linear-gradient(140deg, #e3ffce, #bdeedb); box-shadow: 0 3px 0 #d3e8d8; }
.milestone.is-earned:nth-child(2) .milestone-medallion { background: linear-gradient(140deg, #fff3b9, #ffdb81); color: #825816; border-color: #e7c57e; box-shadow: 0 3px 0 #f3e5be; }
.milestone.is-earned:nth-child(3) .milestone-medallion { background: linear-gradient(140deg, #f5eaff, #d6c4ff); color: #6740a2; border-color: #cbb3eb; box-shadow: 0 3px 0 #e8ddf6; }
.milestone.is-earned:nth-child(4) .milestone-medallion { background: linear-gradient(140deg, #ffedda, #ffc2a3); color: #8f422b; border-color: #eab593; box-shadow: 0 3px 0 #f5e2d4; }
.milestone-medallion i { position: absolute; bottom: -4px; right: -4px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid #fffefa; border-radius: 50%; font-size: 10px; font-style: normal; background: #167355; color: #fff; }

/* Color makes the data easier to scan without changing its meaning. */
.dashboard-summary { gap: 12px; padding: 0; background: transparent; border: 0; }
.dashboard-stat { padding: 21px; border: 1px solid #c6e6d7; border-radius: 17px; background: #e8f6ed; }
.dashboard-stat + .dashboard-stat { border-left: 1px solid #ded2f2; }
.dashboard-stat:nth-child(2) { background: #f1ebfb; border-color: #ded2f2; }
.dashboard-stat:nth-child(3) { background: #eaf3fd; border-color: #cddff4; }
.dashboard-stat:nth-child(4) { background: #fff2df; border-color: #ecd8b9; }
.dashboard-stat:last-child { border: 1px solid #ecd8b9; }
.dashboard-stat:nth-child(2) { border: 1px solid #ded2f2; }
.dashboard-stat:first-child { border: 1px solid #c6e6d7; }
.dashboard-stat > strong { color: #21483b; }
.dashboard-stat:nth-child(2) > strong { color: #57398d; }
.dashboard-stat:nth-child(3) > strong { color: #215b92; }
.dashboard-stat:nth-child(4) > strong { color: #87501e; }
.subject-progress-card { background: linear-gradient(180deg, var(--subject-soft), #fffefa 160px); border-color: var(--subject-border); box-shadow: inset 0 4px 0 var(--subject-accent); }
.subject-progress-card[class]::before { background: var(--subject-accent); }
.subject-progress-heading h3 { color: var(--subject-deep); }
.subject-progress-card .subject-symbol, .checkpoint-row .subject-symbol { background: #fffefa; color: var(--subject-accent); border: 1px solid var(--subject-border); border-radius: 10px; }
.subject-ring .ring-track { stroke: #e0e9e3; }
.subject-progress-card .subject-card-actions .button { background: var(--subject-soft); color: var(--subject-deep); border-color: var(--subject-border); }
.subject-progress-card .subject-card-actions .button:hover { background: var(--subject-accent); color: #fff; }
.activity-bar { background: #8ed3af; }
.activity-day.is-today .activity-bar:not(.is-empty) { background: #087c60; }
.hero-card { background: linear-gradient(125deg, #e2f3e3, #f4f8e6); border-color: #c6dfc6; }
.art-sun { background: #f9cb62; }
.art-step.one { background: #a0d9be; }.art-step.two { background: #55af8e; }.art-step.three { background: #26755b; }
.plan-card { background: #fffaf0; border-color: #e8dec8; }
.study-plan > li > span { color: #785d28; background: #f7e8bb; }
.resume-banner { background: #ebf2ff; border-color: #c6daf3; }
.mode-card { border-radius: 18px; border-color: #cddfd4; background: linear-gradient(145deg, #edf9f0, #fffefa 70%); }
.mode-card:nth-child(2) { border-color: #d7c9e9; background: linear-gradient(145deg, #f2ebff, #fffefa 70%); }
.mode-card:nth-child(3) { border-color: #e7d1ab; background: linear-gradient(145deg, #fff1d1, #fffefa 70%); }
.mode-card .mode-icon { color: #087c60; background: #d7f1e4; border-radius: 12px; }
.mode-card:nth-child(2) .mode-icon { color: #7350c6; background: #e7dbfc; }
.mode-card:nth-child(3) .mode-icon { color: #8b5c17; background: #fae1a0; }

/* Subject color continues into teaching; answer feedback keeps semantic colors. */
.course-intro[class] { background: linear-gradient(110deg, var(--subject-soft), #fffefa); border-color: var(--subject-border); border-radius: 18px; }
.subject-tabs a.active { background: var(--subject-soft); color: var(--subject-deep); border-color: var(--subject-accent); }
.lesson-row:hover { background: var(--subject-soft); }
.lesson-outline nav .lesson-path-step.is-current { background: var(--subject-soft); color: var(--subject-deep); box-shadow: inset 3px 0 var(--subject-accent); }
.lesson-outline nav .is-current .lesson-step-node { border-color: var(--subject-accent); box-shadow: 0 0 0 3px #ffffffb0; }
.lesson-outline nav .is-visited .lesson-step-node, .lesson-outline nav .is-explored .lesson-step-node { background: var(--subject-soft); border-color: var(--subject-border); color: var(--subject-deep); }
.lesson-outline nav .is-correct .lesson-step-node { background: #087c60; border-color: #087c60; color: #fff; }
.lesson-progress-track .past { background: var(--subject-border); }.lesson-progress-track .current { background: var(--subject-accent); }
.lesson-paper { border-color: #dbe5dd; box-shadow: 0 8px 28px #213b3808; }
.lesson-paper .teaching-visual { border-color: var(--subject-border); background: linear-gradient(130deg, var(--subject-soft), #fffefa); }
.objective-list li, .takeaway-card { background: var(--subject-soft); border-color: var(--subject-border); }
.objective-list li::before, .takeaway-mark, .takeaway-label, .takeaway-card .takeaway { color: var(--subject-deep); }
.guided-symbol { background: var(--subject-soft); color: var(--subject-accent); }
.example-answer { background: var(--subject-soft); border-color: var(--subject-border); }
.example-answer .answer-spark { background: var(--subject-accent); }
.practice-progress { background: var(--subject-soft); border-color: var(--subject-border); }
.practice-progress progress::-webkit-progress-value { background: var(--subject-accent); }.practice-progress progress::-moz-progress-bar { background: var(--subject-accent); }
.choice.selected, .lesson-paper .choice.selected { background: var(--subject-soft); border-color: var(--subject-accent); }
.choice.selected .option-letter { background: var(--subject-accent); color: #fff; }
.choice:hover, .lesson-paper .choice:hover { background: var(--subject-soft); border-color: var(--subject-border); }
.choice.selected:hover, .lesson-paper .choice.selected:hover { border-color: var(--subject-accent); }
.lesson-paper .feedback { background: #e4f8ea; border-color: #9ad5af; box-shadow: inset 4px 0 #16835a; }
.feedback-heading > span { background: #087c60; }
.lesson-paper .feedback.repair { background: #fff4dc; border-color: #e9cb86; box-shadow: inset 4px 0 #c38b32; }
.feedback.repair .feedback-heading > span { background: #94641f; }
.button.flag-button { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: #71806d; box-shadow: none; }
.button.flag-button:hover { background: #edf2e7; border-color: transparent; color: #405c3e; }
.button.flag-button[aria-pressed="true"] { background: #fff2cf; color: #a76412; border-color: transparent; }
.button.flag-button:focus-visible { outline: 3px solid #2d6650; outline-offset: 3px; }
.flag-button svg { display: block; flex-shrink: 0; }

/* A completed session has a moment of its own, with the actual counts. */
.session-moment { display: flex; align-items: flex-start; gap: 26px; margin: 0 0 24px; padding: 29px 32px; border: 1px solid var(--subject-border); border-radius: 22px; background: radial-gradient(ellipse at 100% 100%, #ffe9aa70, transparent 65%), linear-gradient(120deg, var(--subject-soft), #fffefa); }
.session-moment-icon { display: grid; place-items: center; flex: 0 0 72px; height: 72px; border: 1px solid #e6c469; border-radius: 25px; background: #ffe498; color: #79561c; transform: rotate(-5deg); box-shadow: 0 4px 0 #f0dba4; }
.session-moment-icon svg { width: 45px; height: 45px; transform: rotate(5deg); }
.session-moment .eyebrow { font-size: 10px; color: var(--subject-deep); margin: 0 0 9px; }
.session-moment h2 { font-size: clamp(24px, 2.5vw, 31px); letter-spacing: -.035em; line-height: 1.25; margin: 0 0 9px; }
.session-moment p:not(.eyebrow) { font-size: 14px; line-height: 1.7; margin: 0; }
.session-win-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.session-win-counts > span { padding: 7px 12px; border: 1px solid #d3dfd5; border-radius: 9px; background: #fffefa; font-size: 12px; color: #3c5d4c; }
.session-win-counts b { font-size: 16px; padding-right: 3px; }

/* Brief, non-blocking celebrations. No sound or continuous animation. */
#learning-celebration[hidden] { display: none; }
#learning-celebration { position: fixed; z-index: 100; right: 26px; bottom: 28px; display: flex; align-items: center; gap: 15px; width: min(420px, calc(100vw - 40px)); padding: 20px 22px; border: 1px solid #b9ddca; border-radius: 18px; background: #fffef6; color: #244539; box-shadow: 0 12px 50px #123e3426, 0 3px 0 #d8e9d9; pointer-events: none; }
#learning-celebration.is-visible { animation: win-arrive .35s cubic-bezier(.2,.8,.25,1) both; }
.celebration-emblem { display: grid; place-items: center; flex: 0 0 49px; height: 49px; border-radius: 16px; background: #ffe59b; color: #835d19; transform: rotate(-7deg); }
#learning-celebration .celebration-emblem svg { width: 33px; height: 33px; }
#learning-celebration strong { display: block; margin-bottom: 4px; font-size: 17px; letter-spacing: -.02em; line-height: 1.35; }
#learning-celebration > div > span { display: block; font-size: 12px; line-height: 1.6; color: #51675a; }
.celebration-particles { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.celebration-particles i { position: absolute; left: calc(8% + var(--piece) * 12%); top: 0; width: 5px; height: 9px; border-radius: 2px; background: #d69d29; animation: win-sprinkle 1s calc(var(--piece) * 45ms) ease-out both; }
.celebration-particles i:nth-child(3n) { background: #7350c6; }.celebration-particles i:nth-child(3n + 1) { background: #168b64; }
@keyframes win-arrive { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes win-sprinkle { from { opacity: 0; transform: translateY(-8px) rotate(0); } 25% { opacity: .8; } to { opacity: 0; transform: translateY(80px) rotate(140deg); } }
@media (hover: hover) and (pointer: fine) {
  .milestone:hover { background: #f0f5eb; transform: translateY(-3px); }
  .subject-progress-card { transition: box-shadow .18s, transform .18s; }
  .subject-progress-card:hover { transform: translateY(-3px); box-shadow: inset 0 4px 0 var(--subject-accent), 0 9px 20px #233b380b; }
  .mode-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px #233b3810; }
}
@media (max-width: 1100px) {
  .daily-moment { padding: 28px; grid-template-columns: minmax(0, 1fr) 185px; }
  .milestone-strip { padding: 22px; gap: 16px; grid-template-columns: 160px minmax(0, 1fr); }
  .spark-one { right: 205px; top: 21px; font-size: 20px; }
}
@media (max-width: 800px) {
  .sidebar nav > a { border-radius: 10px; }
  .sidebar nav > a > span:first-child { width: 25px; height: 25px; border-radius: 8px; }
  .sidebar nav > a[aria-current="page"] { box-shadow: none; }
  #learning-celebration { bottom: 92px; right: 18px; }
}
@media (max-width: 600px) {
  .daily-moment { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 26px 24px; border-radius: 20px; }
  .daily-moment h2 { max-width: 19ch; font-size: 30px; }
  .daily-moment-copy > p:not(.eyebrow) { font-size: 13px; }
  .daily-moment .button.primary { width: 100%; font-size: 13px; padding-inline: 12px; }
  .daily-moment-progress { display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 17px; row-gap: 7px; justify-items: start; border-top: 1px solid #ffffff27; padding-top: 20px; }
  .daily-medallion { grid-row: span 2; width: 58px; height: 58px; border-radius: 18px; }
  .daily-medallion strong { font-size: 29px; }.daily-medallion small { font-size: 16px; }.daily-medallion svg { width: 35px; height: 35px; }
  .daily-five { gap: 7px; }.daily-five > span { width: 25px; height: 25px; }
  .daily-moment-progress > p { font-size: 11px; text-align: left; }
  .spark-one { right: 21px; top: 22px; font-size: 19px; }.spark-two { display: none; }
  .milestone-strip { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .milestone-intro p { max-width: none; }.milestone-intro h3 { font-size: 21px; }
  .milestone-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .milestone-medallion { width: 47px; height: 47px; border-radius: 16px; }.milestone-medallion svg { width: 27px; height: 27px; }
  .milestone strong { font-size: 10px; }.milestone > span:last-child { font-size: 10px; }
  .dashboard-summary { gap: 9px; }.dashboard-stat { padding: 17px 14px; }
  .session-moment { gap: 16px; padding: 23px 20px; flex-direction: column; }
  .session-moment-icon { flex-basis: auto; width: 54px; height: 54px; border-radius: 18px; }.session-moment-icon svg { width: 34px; height: 34px; }
  #learning-celebration { right: 16px; width: calc(100vw - 32px); padding: 16px; gap: 12px; }
}
@media (max-width: 360px) {
  .milestone-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .daily-moment { padding: 23px 19px; }.daily-moment-progress { column-gap: 12px; }.daily-five { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  #learning-celebration.is-visible, .celebration-particles i { animation: none; }
  .celebration-particles { display: none; }
  .milestone, .subject-progress-card, .mode-card, .button { transition: none; }
  .milestone:hover, .subject-progress-card:hover, .mode-card:hover, .button:hover, .button:active { transform: none; }
}
@media (forced-colors: active) {
  .daily-moment, .daily-medallion, .milestone-medallion, .session-moment-icon, #learning-celebration { border: 1px solid CanvasText; }
  .daily-five > .is-filled, .milestone.is-earned .milestone-medallion { border: 2px solid Highlight; }
  .milestone-medallion i { color: CanvasText; }.celebration-particles, .moment-spark { display: none; }
}
