/* study.css — Study dashboard: calendar, weekly goals, review queue, transcript
   search. Uses design tokens only (no hardcoded colours) so it re-themes with
   the rest of the app. */

.study-page { display: flex; flex-direction: column; gap: 14px; }
.study-page .page-title { margin: 0; }
.study-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.study-side { display: flex; flex-direction: column; gap: 14px; }
.study-h3 { margin: 0 0 10px; color: var(--tx2); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- calendar ---------- */
.study-cal-head { margin-bottom: 12px; }
.study-cal-title { font-size: 1.05rem; font-family: var(--f-display); min-width: 132px; text-align: center; }
.study-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.study-cal-weekdays { margin-bottom: 5px; }
.study-cal-wd { text-align: center; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 0; }
.study-cal-cell {
  position: relative; aspect-ratio: 1 / 1; min-height: 40px; border-radius: var(--r-sm);
  background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; overflow: hidden; padding: 3px;
}
.study-cal-cell.is-empty { background: transparent; border-color: transparent; }
.study-cal-cell:not(.is-empty) { cursor: default; }
.study-cal-day { font-size: .8rem; color: var(--tx2); z-index: 1; }
.study-cal-cell.is-today .study-cal-day { color: var(--tx); font-weight: 700; }
.study-cal-cell.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* activity dot: opacity + scale track how much was studied that day */
.study-cal-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); z-index: 1;
  transition: transform .12s ease;
}

/* ---------- weekly goal ---------- */
.study-goal-bar {
  position: relative; height: 22px; border-radius: 999px; background: var(--bg2);
  border: 1px solid var(--line); overflow: hidden; margin: 10px 0 8px;
}
.study-goal-prog {
  position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--ok));
  border-radius: 999px; transition: width .3s ease; min-width: 0;
}
.study-goal .study-pill-val { font-family: var(--f-mono); }

/* ---------- stat pills ---------- */
.study-pills { margin-top: 4px; }
.study-pill {
  flex: 1 1 90px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.study-pill-val { font-size: 1.15rem; font-weight: 700; color: var(--tx); font-family: var(--f-display); }
.study-pill-lbl { text-transform: uppercase; letter-spacing: .04em; }

/* ---------- review queue ---------- */
.study-review-item {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px;
}
.study-review-text { color: var(--tx); font-size: .9rem; line-height: 1.4; }
.study-review-item:last-child { margin-bottom: 0; }
.study-review .row.gap.wrap { gap: 6px; }

/* ---------- transcript search ---------- */
.study-tr-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; margin-top: 8px; }
.study-tr-hit {
  text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; width: 100%;
  transition: border-color .12s ease, background .12s ease;
}
.study-tr-hit:hover { border-color: var(--accent); background: var(--hover); }
.study-tr-time { font-family: var(--f-mono); font-size: .72rem; color: var(--accent); }
.study-tr-text { color: var(--tx2); font-size: .84rem; line-height: 1.35; }
.study-tr-text mark, .study-tr-text .hl { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--tx); border-radius: 3px; padding: 0 1px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .study-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .study-cal-cell { min-height: 34px; }
  .study-cal-day { font-size: .72rem; }
  .study-pill { flex: 1 1 70px; padding: 6px 8px; }
  .study-pill-val { font-size: 1rem; }
}
