/*
 * ตารางหน้า screener (stock_screener / view_dividend_screener / view_np_screener) — กฎที่ทั้ง 3 หน้าใช้เหมือนกัน
 * selector ไม่ผูกคลาสตาราง (table/th/td เปล่า) ให้ specificity เท่าเดิมก่อนแยกไฟล์
 * padding ของ th/td, สี hover แถว และความกว้างลูกศรต่างกันต่อหน้า — ให้แต่ละหน้ากำหนดเองหลังโหลดไฟล์นี้
 * ต้องโหลดก่อน <style> ของหน้า
 */

/* ห้ามใส่ overflow-x:auto นอก media query — จะเป็น scroll container แล้ว th sticky ยึดกับกรอบนี้แทนหน้าเว็บ */
.table-responsive { width: 100%; background: var(--card-bg); border-radius: var(--radius); box-shadow: 0 2px 8px var(--shadow); }
/* มือถือ/แท็บเล็ตเล็ก (≤768px): เลื่อนแนวนอนเอง + เงาขอบซ้าย/ขวาบอกว่าเลื่อนต่อได้ + (คลาส .freeze-1 — renderScreenerPageStart() ใส่ให้) ตรึงคอลัมน์ Symbol ซ้ายสุด */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
    .table-responsive.freeze-1 thead th:nth-child(1) { left: 0; z-index: 3; }
    .table-responsive.freeze-1 tbody tr:not(.empty-row):not(.row-subhead) td:nth-child(1) { position: sticky; left: 0; z-index: 2; background-color: var(--card-bg); }
    .table-responsive.freeze-1 thead th:nth-child(1), .table-responsive.freeze-1 tbody td:nth-child(1) { box-shadow: 1px 0 0 var(--border-strong); }
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: var(--table-head-bg); color: var(--text-primary); font-weight: 600; border-bottom: 0; }
/* เส้นหนาใต้หัวตารางวาดเป็นพื้นหลัง ไม่ใช่ border: ตาราง border-collapse + th sticky ทำให้ border ไม่ติดไปกับเซลล์ที่ตรึง (เส้นหายตอนเลื่อน) — เทคนิคเดียวกับ .head-line ใน data-table.css */
th { background-image: linear-gradient(var(--border-strong), var(--border-strong)); background-size: 100% 2px; background-position: bottom; background-repeat: no-repeat; }
th .unit { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
th.sortable .arrow { display: inline-block; width: 0.6em; opacity: 0.3; }
th.sortable.sorted-asc .arrow, th.sortable.sorted-desc .arrow { opacity: 1; color: var(--accent); }
td.code-cell { font-size: 12px; color: var(--text-muted); }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }
.center-cell { text-align: center; }
.empty-val { color: var(--text-faint); }
/* ไฮไลต์แถวตอนชี้สีเน้นเต็มแถว (.row-hover-accent บน .table-responsive — renderScreenerPageStart() ใส่ให้) — ตัวแปรเดียวกับ .data-table-card.row-hover-accent
   (assets/data-table.css); ช่อง heat-scale ([data-heat]) คงสีไล่เฉดของตัวเองไว้ ไม่ถูกทับ */
.table-responsive.row-hover-accent tbody tr:not(.no-row-hover):hover td:not([data-heat]) { background: var(--fs-row-hover-bg); }
