/* Shared app shell remains unchanged; this only adds the demo notice and guards. */
html.ck-demo-route #login-overlay { display: none !important; }
html.ck-demo-route #main-app { display: flex !important; }
html.ck-demo-route:not(.ck-demo-ready) #main-app { visibility: hidden; }
html.ck-demo-route:not(.ck-demo-ready) body::before {
  content: 'กำลังเตรียมห้องเรียนตัวอย่าง…';
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  color: var(--primary-deep);
  background: var(--primary-light);
  font-size: 0.9rem;
  font-weight: 800;
}
.ck-demo-mode-banner {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 13000;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--primary-light-border);
  color: var(--primary-deep);
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem;
}
.ck-demo-mode-banner > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.ck-demo-mode-banner > span:first-child i { color: var(--primary); font-size: 1rem; }
.ck-demo-mode-actions { display: inline-flex; align-items: center; gap: 8px; }
.ck-demo-mode-actions button, .ck-demo-mode-actions a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--primary-light-border);
  border-radius: var(--radius-btn);
  color: var(--primary-deep);
  background: var(--bg-card);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
}
.ck-demo-mode-actions a { color: #fff; border-color: var(--primary); background: var(--primary); }
.ck-demo-mode-actions button:hover { border-color: var(--primary); background: var(--primary-light); }
.ck-demo-mode-actions a:hover { background: var(--primary-hover); }
body.ck-demo-mode #main-app { padding-top: 46px; }
body.ck-demo-mode .ck-demo-mode-banner { display: flex; }
body.ck-demo-mode #btn-students-join-activity,
body.ck-demo-mode #btn-students-import-excel,
body.ck-demo-mode .ck-checkin-activity-btn,
body.ck-demo-mode .swipe-mini-btn.qr,
body.ck-demo-mode .qr-score-header-btn { display: none !important; }
body.ck-demo-mode .student-card-avatar,
body.ck-demo-mode .student-summary-avatar {
  overflow: visible;
  border-radius: 0;
  background: transparent;
}
body.ck-demo-mode .student-card-avatar { width: 68px; height: 76px; }
body.ck-demo-mode .student-card-avatar img,
body.ck-demo-mode .student-summary-avatar img { object-fit: contain; object-position: center bottom; }
body.ck-demo-mode .student-card-avatar img { width: 100%; height: 100%; }
body.ck-demo-mode .student-summary-avatar { width: 108px; height: 120px; }
body.ck-demo-mode .score-report-bar-section[hidden],
body.ck-demo-mode .score-report-pie-section[hidden],
body.ck-demo-mode .score-report-student-section[hidden],
body.ck-demo-mode .score-report-submission-section[hidden],
body.ck-demo-mode .score-report-grade-section[hidden] { display: none !important; }
body.ck-demo-mode .score-report-grade-section {
  margin: 20px 0;
  padding: 22px 24px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-card);
}
body.ck-demo-mode .score-report-grade-counts { display: flex; flex-wrap: wrap; gap: 8px; }
body.ck-demo-mode .score-report-grade-counts > span {
  min-width: 90px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-light);
  color: var(--text-muted);
  font-size: .75rem;
}
body.ck-demo-mode .score-report-grade-counts strong { display: block; margin-top: 3px; color: var(--text-main); font-size: 1rem; }
body.ck-demo-mode .score-report-grade-scroll { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 10px; }
body.ck-demo-mode .score-report-grade-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
body.ck-demo-mode .score-report-grade-table th,
body.ck-demo-mode .score-report-grade-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: left; white-space: nowrap; }
body.ck-demo-mode .score-report-grade-table thead th { color: var(--text-muted); background: var(--bg-light); }
body.ck-demo-mode .score-report-grade-table tbody tr:last-child > * { border-bottom: 0; }
body.ck-demo-mode .score-report-grade-table td:nth-child(3),
body.ck-demo-mode .score-report-grade-table td:nth-child(4) { font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  .ck-demo-mode-banner { align-items: flex-start; padding: 7px 12px; font-size: 0.7rem; }
  .ck-demo-mode-banner > span:first-child { line-height: 1.35; }
  .ck-demo-mode-actions { flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 3px; }
  .ck-demo-mode-actions button, .ck-demo-mode-actions a { justify-content: center; min-height: 24px; padding: 3px 7px; font-size: 0.64rem; white-space: nowrap; }
  body.ck-demo-mode #main-app { padding-top: 57px; }
  body.ck-demo-mode .score-report-tabs { overflow-x: auto; }
  body.ck-demo-mode .score-report-tab { flex: 0 0 auto; white-space: nowrap; }
  body.ck-demo-mode .score-report-grade-section { padding: 16px 12px; }
  body.ck-demo-mode .student-card-avatar { width: 60px; height: 70px; }
  body.ck-demo-mode .student-summary-avatar { width: 82px; height: 94px; }
}
