/* ==========================================================================
   The signed-in home.

   It opens on the student's own work: where they left off, what has
   started to fade, what is weakest, and the subjects in their plan. Every
   panel is paper on the canvas and every row is a link into the work.
   ========================================================================== */

.study-home { display: grid; gap: 22px; color: var(--text); }
.study-home h2, .study-home h3, .study-home p { margin: 0; }
.study-home .home-label { font-size: .8125rem; color: var(--muted); font-weight: 500; }

.home-continue { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; background: var(--cta-soft); border: 1px solid var(--cta-line); border-radius: var(--radius-xl); }
.home-continue h3 { font-size: 1.25rem; letter-spacing: -.02em; }
.study-home .home-continue h3 { margin-top: 4px; }
.study-home .home-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: .8125rem; color: var(--muted); }
.home-continue .btn { flex-shrink: 0; }

/* Two columns, as in the template: what to open next and your subjects on
   the left, the review lists on the right. */
.home-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.home-col { display: grid; gap: 18px; align-content: start; min-width: 0; }
.study-home.is-intro .home-col > *, .study-home.is-intro .study-home-setup { animation: rh-rise var(--dur-enter) var(--ease-out) both; }
.study-home.is-intro .home-col--main > :nth-child(2) { animation-delay: var(--stagger); }
.study-home.is-intro .home-col--side > :nth-child(1) { animation-delay: calc(var(--stagger) * 2); }
.study-home.is-intro .home-col--side > :nth-child(2) { animation-delay: calc(var(--stagger) * 3); }
.work-panel { min-width: 0; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.work-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--hairline-soft); }
.work-panel > header h3 { font-family: var(--font); font-size: .8125rem; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.work-count { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.work-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: var(--text); font-size: .875rem; }
.work-row + .work-row { border-top: 1px solid var(--hairline-soft); }
.work-row:hover { background: var(--accent-tint); text-decoration: none; }
.work-row, .home-course, .study-home-course-option, .study-home-subject-choice { transition: background-color var(--dur-press) var(--ease-out), border-color var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out); }
.work-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-state { font-size: .75rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.work-state--fading { color: var(--warn); }
.study-home .work-empty { padding: 16px; font-size: .8125rem; color: var(--muted); line-height: 1.6; }

.home-plan { display: grid; gap: 14px; }
.home-plan-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.home-plan-heading h2 { font-size: 1.25rem; }
.home-plan-links { display: flex; gap: 18px; font-size: .8125rem; font-weight: 600; }

.home-subject { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 18px 20px; }
.home-subject-head { display: flex; align-items: center; gap: 14px; }
.home-subject-emblem { width: 56px; flex-shrink: 0; }
.home-subject-head > div { flex: 1; min-width: 0; }
.home-subject-head h3 { font-size: 1.1rem; }
.study-home .home-subject-head p { margin-top: 2px; font-size: .8125rem; color: var(--muted); }
.home-course-list { margin-top: 14px; border: 1px solid var(--hairline-soft); border-radius: var(--radius-md); }
.home-course { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--text); font-size: .875rem; }
.home-course + .home-course { border-top: 1px solid var(--hairline-soft); }
.home-course:hover { background: var(--accent-tint); text-decoration: none; }
.home-course-title { flex: 1; min-width: 0; font-weight: 500; color: var(--ink); }
.home-course-meta { font-size: .75rem; color: var(--muted); white-space: nowrap; }

.study-home-picker { margin-top: 14px; border: 1px solid var(--hairline-soft); border-radius: var(--radius-md); background: var(--surface); }
.study-home-picker > summary, .study-home-subject-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; font-size: .8125rem; font-weight: 600; padding: 10px 14px; color: var(--ink); }
.study-home-picker > summary::-webkit-details-marker, .study-home-subject-settings > summary::-webkit-details-marker { display: none; }
.study-home-picker > summary:hover { color: var(--accent); }
.study-home-chevron { display: inline-block; font-size: 1.1rem; line-height: 1; transition: transform .2s ease; }
.study-home-picker[open] .study-home-chevron { transform: rotate(180deg); }
.study-home-picker-content { border-top: 1px solid var(--hairline-soft); padding: 14px; }
.study-home .study-home-helper { color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.study-home fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.study-home-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.study-home-course-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; transition: border-color .15s; }
.study-home-course-option:hover { border-color: var(--ink); }
.study-home-course-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.study-home-course-option input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--ink); cursor: pointer; }
.study-home-course-copy { flex: 1; min-width: 0; }
.study-home-course-copy strong { display: block; font-size: .8125rem; line-height: 1.4; color: var(--ink); }
.study-home-course-copy small { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }

.study-home-ring { display: inline-flex; width: 28px; height: 28px; flex-shrink: 0; }
.study-home-ring svg { width: 100%; height: 100%; fill: none; stroke-width: 3; transform: rotate(-90deg); }
.study-home-ring-track { stroke: var(--hairline-soft); }
.study-home-ring-value { stroke: var(--done); transition: stroke-dasharray var(--dur-enter) var(--ease-out); }

.study-home .study-home-empty { color: var(--muted); font-size: .8125rem; line-height: 1.6; padding: 14px 0 2px; }

.study-home-setup { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 24px; }
.study-home .study-home-setup > h3 { font-size: 1.25rem; margin-bottom: 6px; }
.study-home-subject-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.study-home-subject-choice { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 14px; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s; }
.study-home-subject-choice:hover { border-color: var(--ink); }
.study-home-subject-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.study-home-subject-choice input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--ink); flex-shrink: 0; }
.study-home-choice-dot { display: none; }
.study-home-subject-choice strong { display: flex; align-items: center; gap: 7px; font-size: .875rem; color: var(--ink); }
.study-home-subject-choice small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.study-home-subject-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.study-home .btn[disabled] { opacity: .5; cursor: not-allowed; }
.study-home-form-message { font-size: .8125rem; color: var(--ok); }
.study-home-form-message.is-error { color: var(--danger); }
.study-home-subject-settings { border-top: 1px solid var(--hairline); padding-top: 4px; }
.study-home-subject-settings > summary { padding: 12px 2px; color: var(--muted); }
.study-home-subject-settings .study-home-subject-form { padding: 10px 0; }

.study-home-welcome { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 28px; }
.study-home .study-home-welcome h2 { margin-bottom: 8px; }
.study-home-welcome p { color: var(--muted); max-width: 52ch; }
.study-home .study-home-welcome p { margin-bottom: 18px; }
.study-home-loading { color: var(--muted); padding: 20px 0; }

@media (max-width: 1050px) { .study-home-subject-options { grid-template-columns: 1fr; } .home-columns { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .home-columns { grid-template-columns: 1fr; }
  .home-continue { flex-direction: column; align-items: flex-start; }
  .study-home-picker-grid { grid-template-columns: 1fr; }
  .home-plan-heading { flex-direction: column; align-items: flex-start; gap: 6px; }
  .home-subject { padding: 16px; }
  .study-home-subject-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .study-home *, .study-home *::before, .study-home *::after { transition: none !important; } }
