/* หน้ากรอกคะแนน (owner 2026-10-08, มือถือ รอบ 3)
   1) ชื่อค้างไว้ตอนเลื่อนตาราง: แม่แบบของหน้าตั้ง .score-entry-table { overflow: hidden } เพื่อมุมโค้ง ทำให้ตารางเป็น
      กล่องเลื่อนเอง ช่อง ที่/ชื่อ (sticky) จึงไม่เคยค้างจริง  overflow: clip ตัดมุมเหมือนเดิมแต่ไม่สร้างกล่องเลื่อน
   2) "กรอกทีละครั้ง" (js/score-focus.js) แสดงเฉพาะจอ <= 768px */
.score-entry-table { overflow: clip !important; }
.score-entry-table thead tr:first-child th:nth-child(1),
.score-entry-table thead tr.score-entry-fullscore-row th:nth-child(1) { position: sticky; left: 0; z-index: 3; }
.score-entry-table thead tr:first-child th:nth-child(3),
.score-entry-table thead tr.score-entry-fullscore-row th:nth-child(3) { position: sticky; left: 40px; z-index: 3; }
.score-entry-table td.score-entry-student-name { box-shadow: 6px 0 8px -6px rgba(15, 23, 42, .3); }

.pp5-sf-bar { display: none; }
.pp5-sf-off { display: none !important; }

@media (max-width: 768px) {
  .pp5-sf-bar {
    display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 8px 10px;
    border-radius: 14px; background: color-mix(in srgb, var(--primary-light) 9%, #fff); border: 1px solid color-mix(in srgb, var(--primary-light) 30%, #fff);
  }
  .pp5-sf-label { flex: 0 0 auto; font-size: .8rem; font-weight: 700; color: color-mix(in srgb, var(--primary) 70%, #000); white-space: nowrap; }
  .pp5-sf-chips { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px; }
  .pp5-sf-chips::-webkit-scrollbar { display: none; }
  .pp5-sf-chip {
    flex: 0 0 auto; min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 999px; font: inherit; font-size: .9rem; font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--primary-light) 30%, #fff); background: #fff; color: color-mix(in srgb, var(--primary) 70%, #000); white-space: nowrap;
  }
  .pp5-sf-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 30%, transparent); }

  /* โหมดทีละครั้ง: ตารางแคบพอดีจอ ช่องกรอกใหญ่ กดง่าย */
  .score-entry-table.pp5-sf-focus { min-width: 0 !important; width: 100% !important; }
  .score-entry-table.pp5-sf-focus td.score-entry-student-name,
  .score-entry-table.pp5-sf-focus thead tr:first-child th:nth-child(3) { width: 44% !important; min-width: 0 !important; }
  .score-entry-table.pp5-sf-focus td.score-entry-student-name { white-space: normal; line-height: 1.3; text-align: left !important; font-size: .9rem; }
  .score-entry-table.pp5-sf-focus td:first-child, .score-entry-table.pp5-sf-focus thead tr:first-child th:first-child { width: 2.2rem !important; min-width: 2.2rem !important; }
  .score-entry-table.pp5-sf-focus input.score-entry-input,
  .score-entry-table.pp5-sf-focus input.score-entry-final-input { width: 4.6rem !important; min-height: 44px; font-size: 1.15rem !important; font-weight: 700; }
}

[data-theme="dark"] .pp5-sf-bar { background: #1b2436; border-color: #2b3340; }
[data-theme="dark"] .pp5-sf-label { color: #c7d2fe; }
[data-theme="dark"] .pp5-sf-chip { background: #111827; border-color: #2b3340; color: #e5e7eb; }
[data-theme="dark"] .pp5-sf-chip.is-on { background: var(--primary); color: #fff; }
