/* Parent progress dashboard + author task-stats additions */
.parent-progress-open {
  margin-top: 0.5rem;
}

/* ---------- Device comparison + sync status ---------- */
.parent-progress-devices { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-transform: none; }
.parent-progress-devices th, .parent-progress-devices td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #ece8f8; text-align: left; }
.parent-progress-devices .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.parent-progress-devices thead th { color: #6b6491; font-size: 0.78rem; }
.parent-progress-recommendation { margin: 0.6rem 0 0; padding: 0.6rem 0.8rem; border-radius: 12px; background: #fff7e0; color: #5a4300; font-size: 0.9rem; text-transform: none; }
.parent-progress-sync { margin: 0.8rem 0 0; font-size: 0.85rem; color: #4b4470; text-transform: none; }

/* ---------- Family sync (parent menu section + dialog) ---------- */
.family-sync-panel { margin: 0.9rem 0; padding: 0.8rem; border: 2px solid #e2dcf7; border-radius: 16px; background: #faf8ff; }
.family-sync-panel h3 { margin: 0 0 0.3rem; }
.family-sync-panel-copy { margin: 0 0 0.6rem; font-size: 0.85rem; text-transform: none; }
.family-sync-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.5rem; }
.family-sync-actions button { padding: 0.6rem 0.75rem; border: 2px solid #d9d2f2; border-radius: 12px; background: #fff; color: #39305e; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.family-sync-actions button:hover { background: #f1edff; }

.family-sync-overlay { position: fixed; inset: 0; z-index: 100200; display: grid; place-items: center; padding: 16px; box-sizing: border-box; background: rgba(35, 28, 65, 0.7); text-transform: none; }
.family-sync-card { position: relative; width: min(460px, 100%); max-height: 92vh; overflow-y: auto; box-sizing: border-box; padding: 1.4rem 1.2rem 1.2rem; border-radius: 22px; background: #fff; color: #2d2a4a; text-align: center; box-shadow: 0 18px 40px rgba(20, 10, 50, 0.35); }
.family-sync-card h2 { margin: 0 2rem 0.6rem; font-size: 1.2rem; }
.family-sync-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #ff5d73; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.family-sync-text { margin: 0 0 0.8rem; font-size: 0.95rem; }
.family-sync-text.is-error { color: #c0263f; }
.family-sync-note { margin: 0.6rem 0 0; font-size: 0.8rem; color: #6b6491; }
.family-sync-qr { width: min(320px, 100%); height: auto; image-rendering: pixelated; border-radius: 8px; }
.family-sync-video { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; object-fit: cover; }
.family-sync-code { margin: 0.4rem 0; font: 800 2.6rem/1 'Baloo 2', sans-serif; letter-spacing: 0.12em; color: #5b3fd6; }
.family-sync-primary { margin-top: 0.6rem; padding: 0.65rem 1.4rem; border: 0; border-radius: 999px; background: #6c4cf0; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.family-sync-redeem input { width: 100%; box-sizing: border-box; padding: 0.6rem; border: 2px solid #d9d2f2; border-radius: 12px; font: 800 1.8rem/1 'Baloo 2', sans-serif; text-align: center; letter-spacing: 0.15em; }
.family-sync-names { display: grid; gap: 0.6rem; text-align: left; }
.family-sync-names label { display: grid; gap: 0.25rem; font-weight: 700; }
.family-sync-names input { padding: 0.55rem; border: 2px solid #d9d2f2; border-radius: 10px; font: inherit; }

.parent-progress-view {
  width: 100%;
  box-sizing: border-box;
  padding: 0.25rem 0;
  color: #2d2a4a;
  font-family: inherit;
}

.parent-progress-back {
  position: sticky;
  top: 0;
  z-index: 100104;
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 0.65rem 0;
  flex: 0 0 auto;
  padding: 0.55rem 0.8rem;
  border: 2px solid #d9d2f2;
  border-radius: 999px;
  color: #39305e;
  background: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.parent-progress-back:hover { background: #f1edff; }
.parent-progress-back:focus-visible { outline: 3px solid #7048e8; outline-offset: 2px; }

.parent-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.parent-progress-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.parent-progress-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}

.parent-progress-totals div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.7rem 0.4rem;
  border-radius: 14px;
  background: #f1f6ff;
  text-align: center;
}

.parent-progress-totals strong {
  font-size: 1.5rem;
  color: #3b5bdb;
}

.parent-progress-totals span {
  font-size: 0.78rem;
  opacity: 0.8;
}

.parent-progress-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.parent-progress-tabs button {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid #d9d2f2;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.parent-progress-tabs button[aria-selected="true"] {
  border-color: #7048e8;
  background: #7048e8;
  color: #fff;
}

.parent-progress-chart-title {
  margin: 0.9rem 0 0.3rem;
  font-size: 0.95rem;
}

.parent-progress-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding: 0.4rem 0.3rem 0;
  border-radius: 12px;
  background: #f8f6ff;
}

.progress-bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.progress-bar-col em {
  font-style: normal;
  font-size: 0.7rem;
  min-height: 1em;
}

.progress-bar {
  width: 80%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #74c0fc, #4263eb);
}

.parent-progress-chart.is-solved .progress-bar {
  background: linear-gradient(180deg, #8ce99a, #2f9e44);
}

.progress-bar-col small {
  font-size: 0.62rem;
  opacity: 0.75;
  white-space: nowrap;
  padding: 2px 0;
}

.parent-progress-tasks {
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #eee8fa;
  border-radius: 12px;
  background: #fff;
  scrollbar-width: thin;
}

.parent-progress-tasks li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid #eee8fa;
  font-size: 0.9rem;
}

.parent-progress-empty,
.parent-progress-note {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.8;
}

@media (max-width: 520px) {
  .parent-progress-totals { grid-template-columns: repeat(2, 1fr); }
}

/* Author admin: task results */
.author-task-stats-title { margin: 1rem 0 0.4rem; }
.author-task-stats-results h5 { margin: 0.8rem 0 0.3rem; }
.author-stats-scroll { overflow-x: auto; }
.task-stats-days {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 110px;
  overflow-x: auto;
}
.task-stats-day {
  flex: 1 0 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.task-stats-day span {
  width: 80%;
  border-radius: 4px 4px 0 0;
  background: #4263eb;
}
.task-stats-day small { font-size: 0.6rem; }
