/* ThatcherEdu 2.0 — app styles on top of the shared kit (kit/kit.css).
   Per DESIGN_SYSTEM.md the app sets its tint and nothing else global; the rest are small
   layout helpers for screens the kit doesn't cover, using only kit tokens. */
:root { --tk-tint-light: #5856D6; --tk-tint-dark: #5E5CE6; }

/* Sign-in (Apple Account sign-in sheet) */
.te-signin-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 32px 28px; }
.te-signin-head img { border-radius: 18px; margin-bottom: 10px; }
.te-signin-head h1, .te-signin-head p { margin: 0; }
.te-signin-error { color: var(--tk-red); min-height: 1.2rem; }

.te-offline {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  top: calc(var(--tk-safe-t) + 6px); padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  font-size: 0.765rem; font-weight: 600; color: var(--tk-label-2);
}
.te-offline[hidden] { display: none; }

/* Fitness-style summary card: ring on the left, figures on the right */
.te-ring-card { flex-direction: row; align-items: center; gap: 20px; padding: 16px 20px; margin: 0 var(--tk-margin); }
.te-ring-card .te-ring-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.te-ring-card .te-big { font-size: 1.882rem; line-height: 1.1; font-weight: 700; font-family: var(--tk-font-round); color: var(--tk-tint); }
.te-ring-card .te-big small { font-size: 1rem; color: var(--tk-label-2); font-weight: 600; }
.te-card-actions { margin: 12px var(--tk-margin) 0; }

/* Thin capsule progress bar (Health / Fitness goal bars) */
.te-bar { --c: var(--tk-tint); height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; min-width: 48px; }
.te-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--c); width: calc(var(--v, 0) * 100%); transition: width 0.6s var(--tk-ease); }
.tk-row .te-bar { flex: none; width: 30%; max-width: 160px; }
.te-row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.te-row-stack .te-bar { width: 100%; max-width: none; }

/* Done / not-done marks at the end of a row */
.te-mark { width: 1.35rem; height: 1.35rem; flex: none; }
.te-mark.is-done { color: var(--tk-green); }
.te-mark.is-miss { color: var(--tk-orange); }

/* Reading passage (Books-style page) */
.te-passage { margin: 0 var(--tk-margin); padding: 18px 20px; background: var(--tk-bg-cell); border-radius: var(--tk-r-card); line-height: 1.55; }
.te-passage p { margin: 0 0 12px; }
.te-passage p:last-child { margin-bottom: 0; }
.te-activity-title { margin: 8px calc(var(--tk-margin) + 4px) 8px; }
.te-lede { margin: 0 calc(var(--tk-margin) + 4px) 24px; color: var(--tk-label-2); }
.te-catchup-note { display: flex; gap: 6px; align-items: flex-start; margin: -4px calc(var(--tk-margin) + 4px) 16px; }
.te-catchup-note .tk-icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--tk-orange); }
.te-subject { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.te-subject .tk-icon { width: 1rem; height: 1rem; }

/* Multiple-choice options: Settings-style choice rows with a checkmark */
.te-choice input { position: absolute; opacity: 0; pointer-events: none; }
.te-choice .te-choice-mark { width: 1.1rem; height: 1.1rem; color: var(--tk-tint); flex: none; visibility: hidden; }
.te-choice:has(input:checked) .te-choice-mark { visibility: visible; }
.te-choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--tk-tint) 50%, transparent); outline-offset: -3px; }
.te-prompt { font-weight: 600; }

/* Results (Fitness workout summary) and the session award */
.te-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px var(--tk-margin) 28px; }
.te-result h2 { margin: 6px 0 0; }
.te-result p { margin: 0; color: var(--tk-label-2); max-width: 30rem; }
.te-xp { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 600;
  color: var(--tk-tint); background: color-mix(in srgb, var(--tk-tint) 14%, transparent); }
.te-xp .tk-icon { width: 1rem; height: 1rem; }
.te-award { position: relative; display: grid; place-items: center; }
.te-award .te-award-glyph { position: absolute; width: 38%; height: 38%; color: var(--tk-tint); }
.te-award.is-animated .tk-activity-rings circle:nth-child(2) { animation: te-close 1.1s var(--tk-ease) both; }
.te-award.is-animated .te-award-glyph { animation: te-pop 0.5s 0.9s var(--tk-ease) both; }
@keyframes te-close { from { stroke-dashoffset: var(--len); } }
@keyframes te-pop { from { transform: scale(0.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .te-award.is-animated .tk-activity-rings circle:nth-child(2), .te-award.is-animated .te-award-glyph { animation: none; }
  .te-bar > span { transition: none; }
}

/* Fitness Awards grid */
.te-awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 10px; margin: 0 var(--tk-margin); padding: 18px 12px; background: var(--tk-bg-cell); border-radius: var(--tk-r-card); }
.te-badge { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.te-badge-disc { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); }
.te-badge-disc .tk-icon { width: 30px; height: 30px; }
.te-badge.is-locked .te-badge-disc { background: var(--tk-fill-2); color: var(--tk-label-3); }
.te-badge-label { font-size: 0.882rem; font-weight: 600; line-height: 1.2; }
.te-badge-sub { font-size: 0.765rem; color: var(--tk-label-2); }
.te-hero { margin: 0 var(--tk-margin); padding: 18px 20px; }
.te-hero-value { font-size: 3.2rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-family: var(--tk-font-round); color: var(--tk-label); }

/* Profile header (Apple Account) */
.te-profile-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 0 var(--tk-margin) 24px; }
.te-profile-head .tk-avatar { --size: 96px; margin-bottom: 8px; }
.te-profile-head h2, .te-profile-head p { margin: 0; }
.te-avatar-button { padding: 0; border: 0; background: none; border-radius: 50%; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.te-avatar-button .tk-avatar { --size: 36px; }

.te-segmented { margin: 0 var(--tk-margin) 24px; }
.te-answer { color: var(--tk-label-2); font-size: 0.882rem; }
.te-answer.is-right { color: var(--tk-green); }
.te-answer.is-wrong { color: var(--tk-orange); }
.te-footer-version { text-align: center; }
