/* 講講樂 — printable learning progress report */

.report-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-7);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.report-range {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--cream-deep);
  gap: 2px;
}

.report-range button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: var(--fs-small);
  cursor: pointer;
}

.report-range button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--teal-deep);
  box-shadow: var(--shadow-sm);
}

.report-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-sheet {
  background: var(--surface);
  border: 1px solid rgba(75, 58, 46, .08);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 4vw, 48px);
}

.report-head {
  padding-bottom: var(--s-4);
  border-bottom: 2px solid var(--teal-soft);
}

.report-brand {
  font-size: var(--fs-tiny);
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--teal-deep);
  margin-bottom: 6px;
}

.report-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 900;
  letter-spacing: .03em;
  line-height: 1.25;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 22px;
  margin-top: var(--s-3);
  font-size: var(--fs-small);
  color: var(--ink-soft);
}

.report-meta label {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.report-meta input {
  min-height: 38px;
  padding: 4px 10px;
  border: 1px solid rgba(75, 58, 46, .16);
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  min-width: min(260px, 100%);
}

.report-intro {
  margin-top: var(--s-3);
  max-width: 66ch;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-5);
}

.report-stat {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-tint);
  border: 1px solid rgba(75, 58, 46, .06);
}

.report-stat b {
  display: block;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--teal-deep);
}

.report-stat span {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--ink-soft);
  font-weight: 700;
}

.report-stat small {
  display: block;
  font-size: var(--fs-tiny);
  color: var(--ink-faint);
}

.report-section {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(75, 58, 46, .09);
}

.report-section h2 {
  font-size: var(--fs-h3);
  font-weight: 900;
  letter-spacing: .02em;
}

.report-lede {
  margin: 4px 0 var(--s-3);
  font-size: var(--fs-small);
  color: var(--ink-soft);
  max-width: 72ch;
}

.report-days {
  display: flex;
  align-items: stretch;
  gap: clamp(8px, 2vw, 22px);
  height: 160px;
  padding: 10px 6px 0;
  border-bottom: 1px solid rgba(75, 58, 46, .12);
}

.report-day {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.report-day b {
  font-size: var(--fs-tiny);
  color: var(--ink-faint);
  min-height: 1.2em;
}

.report-day i {
  width: 100%;
  max-width: 54px;
  display: block;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.report-day small {
  font-size: var(--fs-tiny);
  color: var(--ink-faint);
  white-space: nowrap;
}

.report-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.report-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(75, 58, 46, .16);
  color: var(--ink-faint);
  font-size: var(--fs-tiny);
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}

.report-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(75, 58, 46, .06);
  color: var(--ink-soft);
  vertical-align: middle;
}

.report-table tr:last-child td { border-bottom: 0; }

.report-table b { color: var(--ink); }

.report-total td {
  font-weight: 800;
  color: var(--ink);
  background: var(--surface-tint);
}

.report-level {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 900;
  font-size: .8rem;
}

.report-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--cream-deep);
  color: var(--ink-faint);
  font-size: var(--fs-tiny);
  font-weight: 700;
  white-space: nowrap;
}

.report-tag.on {
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.report-bar {
  display: inline-block;
  vertical-align: middle;
  width: min(110px, 30vw);
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--cream-deep);
  overflow: hidden;
}

.report-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.report-note {
  margin-top: 10px;
  font-size: var(--fs-small);
  color: var(--ink-faint);
}

.report-empty {
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface-tint);
  color: var(--ink-faint);
  font-size: var(--fs-small);
  text-align: center;
}

.report-notes-input {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid rgba(75, 58, 46, .16);
  border-radius: var(--r-md);
  background: var(--surface-tint);
  color: var(--ink);
  font: inherit;
  line-height: 1.7;
  resize: vertical;
}

.report-notes-print { display: none; white-space: pre-wrap; line-height: 1.7; }

.report-next {
  padding: 16px 18px;
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--teal-soft);
}

.report-next b { color: var(--teal-deep); font-size: 1.05rem; }
.report-next p { margin-top: 4px; font-size: var(--fs-small); color: var(--ink-soft); }

.report-foot {
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid rgba(75, 58, 46, .09);
  font-size: var(--fs-tiny);
  color: var(--ink-faint);
  line-height: 1.65;
}

.report-foot p + p { margin-top: 4px; }

@media (max-width: 720px) {
  .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-meta { grid-template-columns: 1fr; }
  .report-actions { align-items: flex-start; }
  .report-buttons { width: 100%; }
  .report-buttons .btn { flex: 1 1 auto; }
  .report-days { height: 130px; gap: 6px; }
  .report-day i { max-width: 34px; }
}

@media (max-width: 430px) {
  .report-page { padding: var(--s-4) var(--s-3) var(--s-6); }
  .report-sheet { padding: 18px 14px; border-radius: var(--r-md); }
  .report-stat { padding: 11px 12px; }
  .report-stat b { font-size: 1.3rem; }
  .report-table { font-size: .78rem; }
  .report-table th, .report-table td { padding: 7px 6px; }
  .report-bar { width: 54px; }
}

@media print {
  @page { size: A4; margin: 12mm; }

  body { background: #fff !important; padding: 0 6mm !important; }

  .topbar,
  .aac-fab,
  .report-actions,
  .skip-link,
  #live { display: none !important; }

  #app::after { display: none !important; }

  #main { padding: 0 !important; max-width: none !important; }

  .report-page { max-width: none; padding: 0; }

  .report-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-summary { grid-template-columns: repeat(3, 1fr); }
  .report-section { break-inside: avoid; margin-top: 14px; padding-top: 12px; }
  .report-table { font-size: 9pt; }
  .report-table tr { break-inside: avoid; }
  .report-scroll { overflow: visible; }
  .report-notes-input { display: none !important; }
  .report-notes-print { display: block !important; }
  .report-meta input { border: 0; padding: 0; background: transparent; min-height: 0; }
  .report-range, .report-buttons { display: none !important; }
  a { color: inherit; text-decoration: none; }
}
