/* Melola Stat: Discovery's main.css plus a teal accent, so users can tell the products apart (ADR 0032). */
.stat {
  --stat-accent: #0f766e;
  --stat-accent-soft: #ccfbf1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar--stat { border-bottom: 3px solid var(--stat-accent); }

.products { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: rgb(255 255 255 / 0.08); }
.products__link { color: #dbe6f3; font-size: 0.85rem; font-weight: 500; text-decoration: none; padding: 0.25rem 0.7rem; border-radius: 7px; }
.products__link:hover { color: #fff; background: rgb(255 255 255 / 0.1); }
.products__link[aria-current='page'] { color: #fff; background: var(--stat-accent); }

.stat-home { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 48px 16px 64px; }

.stat-hero { max-width: 720px; }
.stat-badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--stat-accent-soft);
  color: var(--stat-accent);
  font-size: 0.85rem;
  font-weight: 600;
}
.stat-hero__title { margin: 0 0 16px; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; }
.stat-hero__lead { margin: 0 0 20px; font-size: 1.1rem; color: var(--ink-muted); }
.stat-notice {
  margin: 0;
  padding: 12px 16px;
  border-left: 4px solid var(--stat-accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 40px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.stat-card__title { margin: 0 0 8px; font-size: 1.1rem; color: var(--stat-accent); }
.stat-card p { margin: 0; color: var(--ink-muted); }

.stat-account { margin-top: 32px; color: var(--ink-muted); }
.stat-account a { color: var(--link); }

.stat-footer { padding: 20px 16px; text-align: center; font-size: 0.85rem; color: var(--ink-muted); }
.stat-footer a { color: var(--link); }

/* Data pages (unggah, pemeriksaan). */
.stat-page { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
.stat-page__title { margin: 0 0 8px; font-size: 1.8rem; }
.stat-page__lead { margin: 0 0 20px; color: var(--ink-muted); }
.stat-page .stat-notice { margin-bottom: 20px; }
.stat-page a:not(.btn) { color: var(--link); }

.stat-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stat-panel { padding: 20px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.stat-panel__title { margin: 0 0 8px; font-size: 1.1rem; color: var(--stat-accent); }
.stat-panel p { margin: 0 0 12px; }
.stat-hint { font-size: 0.9rem; color: var(--ink-muted); }
.stat-panel .stat-hint { margin: 12px 0 0; }
.stat-facts { margin: 16px 0 0; padding-left: 1.2rem; font-size: 0.9rem; color: var(--ink-muted); }
.stat-facts li + li { margin-top: 4px; }

.stat-upload { display: grid; gap: 10px; justify-items: start; }
.stat-upload input[type='file'] { max-width: 100%; }
.stat-error { margin: 0; color: #b91c1c; font-weight: 500; }

.stat-ok { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--green); border-radius: 8px; background: #f0fdf4; }
.stat-issues { margin-bottom: 16px; padding: 16px 20px; border-left: 4px solid; border-radius: 8px; }
.stat-issues h2 { margin: 0 0 6px; font-size: 1.05rem; }
.stat-issues p { margin: 0 0 8px; }
.stat-issues ul { margin: 0; padding-left: 1.2rem; }
.stat-issues li + li { margin-top: 3px; }
.stat-issues--error { border-color: #b91c1c; background: #fef2f2; }
.stat-issues--warning { border-color: #b45309; background: #fffbeb; }

.stat-fields { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.stat-fields label { display: grid; gap: 4px; font-size: 0.9rem; font-weight: 500; }
.stat-fields input, .stat-fields select, .stat-table select {
  padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.9rem; background: #fff;
}
.stat-fields input { width: 6rem; }

.stat-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.stat-table th, .stat-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.stat-table thead th { font-weight: 600; color: var(--ink-muted); white-space: nowrap; }
.stat-table tbody th { font-weight: 600; }
.stat-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-table__label { display: block; font-weight: 400; font-size: 0.8rem; color: var(--ink-muted); }

.stat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.stat-actions form { margin: 0; }
.stat-mapping > .btn { margin-bottom: 8px; }
.stat-card p.stat-card__more { margin-top: 12px; }
.stat-card__more a { color: var(--link); font-weight: 500; }

/* Learning pages (belajar, modul, unit, kuis). */
.stat-crumbs { margin: 0 0 8px; font-size: 0.9rem; color: var(--ink-muted); }
.stat-badge--draft { margin: 0; background: #fef3c7; color: #92400e; }
.stat-module-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stat-panel__title a { color: inherit; }

.stat-progress { margin: 0 0 12px; }
.stat-progress__bar { height: 8px; border-radius: 999px; background: var(--stat-accent-soft); overflow: hidden; }
.stat-progress__bar span { display: block; height: 100%; background: var(--stat-accent); }
.stat-progress__label { margin: 6px 0 0; font-size: 0.9rem; color: var(--ink-muted); }
.stat-panel .stat-progress__label { margin-bottom: 0; }
.stat-unit-page > .stat-progress { margin-bottom: 20px; }

.stat-outcomes { margin: 0; padding-left: 1.3rem; }
.stat-outcomes li + li { margin-top: 4px; }

.stat-units { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stat-unit { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stat-unit__number { flex: 0 0 2rem; height: 2rem; display: grid; place-items: center; border-radius: 999px; background: var(--page); font-weight: 600; }
.stat-unit--selesai .stat-unit__number { background: var(--stat-accent); color: #fff; }
.stat-unit--sedang .stat-unit__number { background: var(--stat-accent-soft); color: var(--stat-accent); }
.stat-unit--soon { color: var(--ink-muted); }
.stat-unit__body a { font-weight: 600; }
.stat-unit__meta { display: block; font-size: 0.85rem; color: var(--ink-muted); }

.stat-section { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); scroll-margin-top: 16px; }
.stat-section h2 { margin: 0 0 12px; font-size: 1.25rem; }
.stat-section--read { border-left: 4px solid var(--stat-accent); }
.stat-prose { line-height: 1.65; }
.stat-prose > :first-child { margin-top: 0; }
.stat-prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.stat-prose th, .stat-prose td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.stat-prose thead th { color: var(--ink-muted); }
.stat-prose blockquote { margin: 12px 0; padding: 8px 16px; border-left: 4px solid var(--stat-accent); background: var(--page); border-radius: 6px; font-variant-numeric: tabular-nums; }
.stat-prose blockquote p { margin: 0; }
.stat-section__read { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.stat-section__done { color: var(--stat-accent); font-weight: 600; font-size: 0.9rem; }
.stat-link-button { padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; }

.stat-sim { margin: 16px 0; padding: 16px; border: 1px solid var(--stat-accent-soft); border-radius: 12px; background: #f0fdfa; }
.stat-sim__controls { display: grid; gap: 12px; }
.stat-sim__controls label { display: grid; gap: 4px; font-weight: 500; }
.stat-sim__controls input { width: 100%; accent-color: var(--stat-accent); }
.stat-sim__result { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 16px 0 8px; }
.stat-sim__result div { padding: 8px 10px; border-radius: 8px; background: #fff; }
.stat-sim__result dt { font-size: 0.8rem; color: var(--ink-muted); }
.stat-sim__result dd { margin: 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-sim__verdict { margin: 0 0 8px; font-weight: 500; }
.stat-sim__verdict[data-significant='true'] { color: var(--stat-accent); }
.stat-sim figcaption { font-size: 0.82rem; color: var(--ink-muted); }

.stat-question { margin: 0 0 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.stat-question legend { padding: 0; font-weight: 500; line-height: 1.5; float: left; width: 100%; margin-bottom: 12px; }
.stat-question__number { font-weight: 700; color: var(--stat-accent); }
.stat-option { clear: both; display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.stat-option:hover { background: var(--page); }
.stat-option input { margin-top: 0.3rem; accent-color: var(--stat-accent); }
.stat-answer { clear: both; display: grid; gap: 4px; font-weight: 500; }
.stat-answer input { width: 10rem; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.stat-actions .stat-link-button { align-self: center; }

.stat-results { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.stat-result { padding: 16px 20px; border: 1px solid var(--line); border-left: 4px solid; border-radius: 12px; background: var(--surface); }
.stat-result p { margin: 0 0 6px; }
.stat-result--right { border-left-color: var(--green); }
.stat-result--wrong { border-left-color: #b45309; }
.stat-result__question { font-weight: 500; }
.stat-result__right { color: var(--ink-muted); }

/* Phones: the account links wrap instead of touching the screen edge. */
@media (max-width: 600px) {
  .topbar--stat .user-nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .topbar--stat .user-nav__name { max-width: 12ch; }
}

/* Analysis (model, interpretation, APA tables, residual charts). */
.stat-ok p { margin: 0 0 10px; }
.stat-practice { margin-top: 12px; }
.stat-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 16px 0; padding: 0; border: 0; }
.stat-choices legend { margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; }
.stat-choices label { display: flex; gap: 8px; align-items: baseline; font-size: 0.92rem; }
.stat-choices .stat-hint { font-size: 0.8rem; }
.stat-model-form .stat-error { margin-bottom: 12px; }
.stat-results-block { margin-top: 32px; }
.stat-results-block > h2 { margin: 0 0 12px; font-size: 1.35rem; }
.stat-results-block h3 { margin: 20px 0 8px; font-size: 1.05rem; }
.stat-note { color: var(--ink-muted); }
.stat-issues--note { border-color: var(--line); background: var(--surface); }
.stat-assumptions { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.stat-assumption { padding: 10px 14px; border-left: 4px solid var(--green); border-radius: 8px; background: var(--surface); line-height: 1.55; }
.stat-assumption--peringatan { border-color: #b45309; background: #fffbeb; }
.stat-assumption--catatan { border-color: var(--line); }

.stat-apa { margin: 0 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow-x: auto; }
.stat-apa figcaption { margin-bottom: 8px; line-height: 1.5; }
.stat-apa table { border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.stat-apa th, .stat-apa td { padding: 4px 10px; text-align: left; white-space: nowrap; }
.stat-apa thead tr:first-child th { border-top: 1px solid var(--ink); }
.stat-apa thead tr:last-child th, .stat-apa thead th[rowspan] { border-bottom: 1px solid var(--ink); }
.stat-apa tbody tr:last-child td { border-bottom: 1px solid var(--ink); }
.stat-apa thead th { font-weight: 500; }
.stat-apa__note { margin: 8px 0; font-size: 0.85rem; }

.stat-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stat-chart { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stat-chart svg { display: block; width: 100%; height: auto; }
.stat-chart figcaption { margin-top: 6px; font-size: 0.85rem; color: var(--ink-muted); }
.stat-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.stat-downloads .btn { text-decoration: none; }
.stat-notice--review { margin: 0 0 16px; border-left-color: #b45309; background: #fffbeb; }
