/* Shared practice, journal and question-library surfaces. */
.study-page-main { padding-block: 40px 64px; }
.study-page-heading { margin-bottom: 28px; }
.study-page-heading h1 { margin: 6px 0 12px; color: #182B2B; font: 500 clamp(2.25rem, 4.4vw, 3.5rem)/1.1 Georgia, serif; letter-spacing: -.035em; }
.study-page-heading > p:last-child { margin: 0; max-width: 65ch; color: #66756D; }
.discipline-tabs { display: flex; gap: 8px; margin: 0 0 24px; border-bottom: 1px solid #DCE2DC; }
.discipline-tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 20px; border-bottom: 3px solid transparent; border-radius: 7px 7px 0 0; color: #52685B; text-decoration: none; font-weight: 600; }
.discipline-tabs a:hover { background: #EEF3ED; }
.discipline-tabs a[aria-current="page"] { color: #176B55; background: #E8F0E9; border-bottom-color: #176B55; }
.study-link-button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 18px; border: 1px solid #176B55; border-radius: 7px; background: #fff; color: #176B55; text-decoration: none; font-weight: 600; gap: 16px; }
.study-link-button:hover { background: #F1F6F0; }
.study-section-heading { margin: 32px 0 18px; font: 500 1.75rem/1.2 Georgia, serif; }
.study-gateway { max-width: 700px; margin: 0 auto; padding-block: 20px; text-align: center; }
.study-gateway > p { color: #66756D; }
.study-login-card { max-width: 440px; margin: 24px auto; padding: 28px; background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; text-align: left; }
.study-login-card label, .today-login-card label { display: block; margin: 0 0 6px; color: #182B2B; font-size: .875rem; font-weight: 600; }
.study-login-card input, .today-login-card input { margin-bottom: 16px; }
.study-login-card .password-field input, .today-login-card .password-field input { margin-bottom: 0; }
.study-login-card .password-field, .today-login-card .password-field { margin-bottom: 16px; }
.study-login-card .btn-submit, .today-login-card .btn-submit { width: 100%; margin-top: 10px; }
.study-login-card .btn-white, .today-login-card .btn-white { display: block; margin-left: auto; padding: 8px 0; border-color: transparent; background: transparent; font-weight: 500; font-size: .875rem; }
#mains-questions { display: grid; gap: 16px; scroll-margin-top: 110px; }
.todays-question-tile { padding: 24px 28px; margin: 0; background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; cursor: default; }
.todays-question-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.q-tag { padding: 5px 12px; background: #E8F0E9; border-radius: 5px; color: #176B55; font-size: .8125rem; font-weight: 650; }
.question-marks { color: #66756D; font-size: .875rem; }
.todays-question-tile p { color: #182B2B; font-size: 1.0625rem; line-height: 1.75; margin: 0; }
.study-empty-message { padding: 24px; color: #66756D; background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; line-height: 1.65; }
.subject-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.subject-box { min-height: 72px; padding: 20px; justify-content: flex-start; background: #fff; border: 1px solid #DCE2DC; border-radius: 10px; color: #182B2B; text-align: left; line-height: 1.5; cursor: pointer; }
.subject-box:hover { border-color: #176B55; background: #EEF3ED; }
.prelims-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.prelims-grid .card { display: flex; align-items: center; justify-content: space-between; min-height: 108px; padding: 24px; background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; color: #182B2B; font-size: 1.0625rem; font-weight: 600; text-decoration: none; }
.prelims-grid .card::after { content: "→"; color: #176B55; font-weight: 400; }
.prelims-grid .card:hover { border-color: #176B55; background: #EEF3ED; }
.habit-tracker-card, .habit-setup-card, .habit-ai-summary, .week-grid-wrapper { padding: 28px; background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; }
.habit-tracker-card h2, .habit-setup-card h2, .habit-ai-summary h2 { margin: 0 0 12px; font: 500 1.75rem/1.2 Georgia, serif; }
.habit-tracker-note { color: #66756D; margin: 0 0 16px; }
.habit-tracker-card { margin-bottom: 24px; }
.habit-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid #E5E9E4; }
.habit-name { min-width: 0; overflow-wrap: anywhere; color: #182B2B; line-height: 1.6; }
.habit-actions { display: flex; gap: 8px; flex-shrink: 0; }
.habit-btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-width: 96px; min-height: 44px; padding: 10px 14px; border: 1px solid #DCE2DC; border-radius: 7px; background: #fff; color: #52685B; cursor: pointer; }
.tick-btn::after { content: "Done"; }
.cross-btn::after { content: "Missed"; }
.habit-btn:hover { border-color: #176B55; }
.habit-btn.selected-tick { background: #176B55; border-color: #176B55; color: #fff; }
.habit-btn.selected-cross { background: #F7E8E5; border-color: #B3766A; color: #913A2F; }
.habit-btn.disabled-btn { color: #7B877D; background: #F7F6F2; }
.habit-score { margin-top: 20px; color: #176B55; font-size: 1.0625rem; font-weight: 650; }
.habit-ai-summary { margin-bottom: 24px; }
.habit-ai-summary > p { color: #66756D; margin: 0 0 20px; }
.habit-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.habit-summary-panel { padding: 22px; background: #F7F6F2; border-radius: 8px; border: 1px solid #E5E9E4; }
.habit-summary-panel h3 { margin: 0 0 12px; font-size: 1rem; }
.habit-summary-content { color: #52685B; line-height: 1.7; font-size: .9375rem; }
.habit-summary-content ul { padding-left: 20px; margin: 0; }
.habit-summary-content li + li { margin-top: 8px; }
.habit-summary-countdown, .habit-summary-unavailable { margin: 0; }
.week-performance-heading, .weekly-score-chart-heading { margin-bottom: 20px; }
.week-title, .weekly-score-chart-heading h3 { margin: 0 0 8px; font-size: 1.125rem; }
.week-performance-heading p, .weekly-score-chart-heading p { color: #66756D; margin: 0; font-size: .9375rem; }
.week-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
.week-box { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 15px 8px; background: #F7F6F2; border: 1px solid #DCE2DC; border-radius: 8px; color: #66756D; font-size: .8125rem; }
.week-box span { color: #182B2B; font-size: 1.25rem; font-weight: 600; }
.week-positive { background: #E8F0E9; }
.week-negative { background: #F7E8E5; }
.week-current { border: 2px solid #176B55; padding: 14px 7px; }
.week-future { opacity: .55; }
.weekly-score-chart { border-top: 1px solid #DCE2DC; margin-top: 24px; padding-top: 24px; }
.weekly-score-chart-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.habit-setup-card { max-width: 860px; margin-inline: auto; }
.habit-first-time-guide { margin: 22px 0; padding: 22px; background: #E8F0E9; color: #52685B; border-radius: 8px; line-height: 1.7; }
.habit-first-time-guide strong { color: #182B2B; }
.habit-first-time-guide ul { padding-left: 20px; margin: 8px 0 0; }
.habit-first-time-guide li + li { margin-top: 4px; }
.habit-setup-note { color: #66756D; margin: 0 0 24px; }
.habit-setup-grid { display: grid; gap: 14px; }
.habit-setup-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px 44px; align-items: center; gap: 10px; }
.habit-setup-row input { margin: 0; min-width: 0; }
.habit-setup-number { color: #66756D; font-variant-numeric: tabular-nums; }
.habit-add-btn, .habit-delete-btn { display: grid; place-items: center; padding: 0; width: 44px; height: 44px; border: 1px solid #DCE2DC; border-radius: 7px; cursor: pointer; }
.habit-add-btn { background: #E8F0E9; color: #176B55; font-size: 1.5rem; }
.habit-delete-btn { background: #fff; color: #913A2F; }
.habit-add-btn:hover { border-color: #176B55; }
.habit-delete-btn:hover { border-color: #B3766A; background: #F7E8E5; }
.trash-icon { position: relative; display: block; width: 12px; height: 15px; border: 1.5px solid currentColor; border-radius: 0 0 2px 2px; border-top: 0; }
.trash-icon::before { content: ""; position: absolute; width: 16px; left: -3.5px; top: -3px; border-top: 1.5px solid currentColor; }
.trash-icon::after { content: ""; position: absolute; width: 6px; height: 3px; left: 1.5px; top: -6px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
#saveHabitsBtn { margin-top: 26px; }
/* Keep the existing quiz page, selection, submission and review model. */
.quiz-page > header { position: sticky; top: 0; z-index: 20; }
#timer { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; color: #182B2B; white-space: nowrap; }
#timer:not(:empty)::before { content: "Time left "; margin-right: 8px; color: #66756D; font-size: .875rem; font-weight: 400; }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; width: min(1200px, calc(100% - 48px)); gap: 24px; align-items: start; margin: 32px auto 64px; }
.quiz-left { min-width: 0; }
.quiz-left:only-child { grid-column: 1 / -1; width: min(100%, 960px); margin-inline: auto; }
.quiz-intro { margin-bottom: 24px; }
.quiz-intro h1 { margin: 5px 0 10px; font: 500 2rem/1.15 Georgia, serif; }
.quiz-intro p { color: #66756D; margin: 0; line-height: 1.6; }
.quiz-source-notice { padding: 16px 20px; margin-bottom: 20px; border: 1px solid #DDCBA6; border-radius: 8px; background: #FBF5E8; color: #735728; line-height: 1.6; }
.quiz-loading, .quiz-load-error { padding: 28px; border: 1px solid #DCE2DC; border-radius: 12px; background: #fff; color: #66756D; line-height: 1.65; }
.quiz-load-error { color: #913A2F; background: #FCF3F1; border-color: #E3C3BB; }
.quiz-loading p { margin: 0 0 12px; }
.question-card, .review-question { background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; padding: 28px; margin-bottom: 20px; }
.question-card h3, .review-question h4 { margin: 0 0 24px; color: #182B2B; font: 600 1.125rem/1.75 system-ui, sans-serif; }
.question-copy { white-space: pre-line; overflow-wrap: anywhere; }
.options, .review-options { display: grid; gap: 12px; }
.option-btn { display: flex; align-items: flex-start; gap: 14px; min-height: 52px; padding: 16px 18px; background: #fff; border: 1px solid #DCE2DC; border-radius: 8px; color: #182B2B; font-size: 1rem; line-height: 1.6; cursor: pointer; }
.option-btn input[type="radio"] { appearance: auto; display: block; flex: 0 0 20px; width: 20px; height: 20px; margin: 3px 0 0; padding: 0; accent-color: #176B55; opacity: 1; position: static; }
.option-btn:hover { border-color: #7BA28B; }
.option-btn.selected { border-color: #176B55; background: #E8F0E9; }
.option-btn:focus-within { outline: 3px solid #8CB5A0; outline-offset: 2px; }
.option-btn.option-disabled { opacity: .65; cursor: default; }
.quiz-right { position: sticky; top: 112px; padding: 22px; border: 1px solid #DCE2DC; border-radius: 12px; background: #fff; max-height: calc(100dvh - 132px); overflow-y: auto; }
.palette-title { margin: 0 0 18px; font-size: 1.125rem; }
#question-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.palette-btn { display: grid; place-items: center; min-width: 0; min-height: 44px; padding: 6px; border: 1px solid #DCE2DC; border-radius: 6px; background: #F0F1ED; color: #52685B; font-size: .875rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.palette-btn:hover { border-color: #176B55; }
.palette-attempted { background: #E8F0E9; border-color: #9DBEAA; color: #176B55; font-weight: 650; }
.palette-dropped { border-style: dashed; text-decoration: line-through; opacity: .6; }
.palette-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; color: #66756D; font-size: .8125rem; }
.palette-legend span { display: flex; align-items: center; gap: 7px; }
.palette-legend i { display: inline-block; width: 14px; height: 14px; background: #F0F1ED; border: 1px solid #DCE2DC; border-radius: 3px; }
.palette-legend .legend-answered { background: #E8F0E9; border-color: #9DBEAA; }
.palette-note { padding-top: 18px; margin: 18px 0 0; border-top: 1px solid #DCE2DC; color: #66756D; font-size: .875rem; line-height: 1.6; }
#quiz-navigation { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.quiz-page .nav-btn, .quiz-page .submit-btn { min-height: 44px; padding: 12px 20px; border: 1px solid #176B55; border-radius: 7px; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.quiz-page .nav-btn { background: #fff; color: #176B55; }
.quiz-page .submit-btn { background: #176B55; color: #fff; }
.question-status-badge, .question-review-badge { display: block; width: fit-content; margin-top: 10px; padding: 5px 10px; border-radius: 5px; background: #F0F1ED; color: #66756D; font-size: .75rem; line-height: 1.5; }
.question-review-badge { background: #FBF5E8; color: #735728; }
.result-card { background: #fff; border: 1px solid #DCE2DC; border-radius: 12px; padding: 28px; margin-bottom: 24px; }
.result-card h2 { margin: 0 0 24px; font: 500 2rem/1.2 Georgia, serif; }
.result-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.result-grid > div { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #F7F6F2; border-radius: 8px; }
.result-grid > div:first-child { background: #E8F0E9; }
.result-grid span:first-child { color: #66756D; font-size: .875rem; }
.result-grid span:last-child { color: #182B2B; font-size: 1.75rem; font-weight: 600; }
.leaderboard-box { border-top: 1px solid #DCE2DC; padding-top: 22px; margin-top: 22px; }
.leaderboard-box h3 { margin: 0 0 14px; }
.leaderboard-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid #E5E9E4; }
.leaderboard-row span:nth-child(2) { overflow-wrap: anywhere; }
.review-option { padding: 14px 18px; border: 1px solid #DCE2DC; border-radius: 8px; line-height: 1.7; }
.review-correct, .review-correct-selected { background: #E8F0E9; border-color: #7BA28B; color: #176B55; }
.review-wrong-selected { background: #F7E8E5; border-color: #B3766A; color: #913A2F; }
.review-correct::after { content: " · Correct answer"; font-size: .875rem; font-weight: 600; }
.review-correct-selected::after { content: " · Your answer · Correct"; font-size: .875rem; font-weight: 600; }
.review-wrong-selected::after { content: " · Your answer · Incorrect"; font-size: .875rem; font-weight: 600; }
.review-explanation { padding: 18px; margin-top: 20px; background: #F7F6F2; border-radius: 8px; }
.review-explanation h5 { margin: 0 0 8px; font-size: .9375rem; }
.review-explanation-text { white-space: pre-line; color: #52685B; line-height: 1.75; margin: 0; }
.review-dropped-note, .review-pending-note { margin: -8px 0 18px; font-size: .875rem; color: #735728; }
#performanceGraph svg text { fill: #52685B; }
#performanceGraph svg line { stroke: #AAB6AD; }
#performanceGraph svg rect:nth-of-type(1) { fill: #176B55; }
#performanceGraph svg rect:nth-of-type(2) { fill: #B86657; }
#performanceGraph svg rect:nth-of-type(3) { fill: #B88739; }
@media (max-width: 1000px) { .prelims-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .quiz-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; } .quiz-right { padding: 18px; } #question-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .study-page-main { padding-block: 28px 40px; }
  .discipline-tabs a { padding: 12px 16px; font-size: .9375rem; }
  .subject-grid, .prelims-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .prelims-grid .card { padding: 20px 16px; min-height: 88px; font-size: 1rem; }
  .todays-question-tile { padding: 22px; }
  .habit-tracker-card, .habit-setup-card, .habit-ai-summary, .week-grid-wrapper { padding: 20px; }
  .habit-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .habit-actions { width: 100%; }
  .habit-btn { flex: 1; }
  .habit-summary-grid { grid-template-columns: 1fr; }
  .habit-summary-content { font-size: 1rem; }
  .week-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .habit-setup-row { grid-template-columns: 18px minmax(0, 1fr) 44px 44px; gap: 6px; }
  .habit-first-time-guide { padding: 18px; }
  #saveHabitsBtn { width: 100%; }
  .quiz-page > header { gap: 16px; }
  #timer { font-size: .9375rem; }
  #timer:not(:empty)::before { display: block; margin: 0; font-size: .75rem; text-align: right; }
  .quiz-layout { grid-template-columns: minmax(0, 1fr); width: calc(100% - 32px); margin-top: 24px; gap: 20px; }
  .quiz-right { position: static; max-height: none; }
  #question-palette { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .question-card, .review-question, .result-card { padding: 20px; }
  .question-card h3, .review-question h4 { font-size: 1.0625rem; line-height: 1.75; }
  .option-btn { padding: 14px; gap: 12px; }
  #quiz-navigation > button { flex: 1; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid > div:first-child { grid-column: 1 / -1; }
  .palette-note, .quiz-page .nav-btn, .quiz-page .submit-btn { font-size: 1rem; }
}
@media (max-width: 380px) { .habit-setup-row { grid-template-columns: 18px minmax(0, 1fr) 44px; } .habit-delete-btn { grid-column: 3; } .subject-grid { grid-template-columns: 1fr; } }
