/* <select> กลางของเว็บ (dropdown กลุ่มหุ้น ?list=, ไตรมาส ?fs= ฯลฯ) — คลาส .site-select คู่กับ lib/site_select.php */
/* ความกว้างมาตรฐาน: พอดีตัวเลือกที่ยาวสุด (ไม่เปลี่ยนตามค่าที่เลือก) แต่ไม่เกิน --select-max-w ข้อความที่ยาวกว่าตัดด้วย "…"
   ที่อยากให้เต็มความกว้างของตัวห่อ (เช่น sidebar, มือถือ) ใส่ width:100% + max-width:none เฉพาะที่นั้น */
:root { --select-max-w: 240px; }
/* ลูกศรวาดเองด้วย gradient (appearance:none) เพราะลูกศร native ของเบราว์เซอร์ชิดขอบขวาแก้ด้วย padding ไม่ได้ */
.site-select {
    appearance: none; -webkit-appearance: none;
    padding: 6px 32px 6px 12px; font-size: 14px; font-weight: 600; font-family: var(--font-main);
    background-color: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border-strong);
    border-radius: var(--radius-box); cursor: pointer;
    max-width: var(--select-max-w); text-overflow: ellipsis; white-space: nowrap;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px; background-repeat: no-repeat;
}
.site-select:hover { border-color: var(--accent); }

/* เมนูที่คุมหน้าตาเอง (assets/rich-select.js) — ปุ่มใช้ .site-select เดิม; <select> จริงซ่อนไว้ในฟอร์ม */
.rich-select { position: relative; display: inline-block; }
.rich-select-native { display: none; }
.rich-select-btn { text-align: left; width: 100%; overflow: hidden; }
.rich-select-menu {
    position: fixed; z-index: 2000; overflow-y: auto; padding: 6px;
    background: var(--card-bg); border: 1px solid var(--border-strong); border-radius: var(--radius-box); box-shadow: 0 12px 36px var(--shadow);
    font-family: var(--font-main); font-size: 14px;
}
.rich-select-menu[hidden] { display: none; }
.rich-select-item { position: relative; padding: 5px 12px 5px 28px; border-radius: 6px; color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.rich-select-item.is-bold { font-weight: 700; }
.rich-select-item.is-selected::before { content: '✓'; position: absolute; left: 9px; font-weight: 700; }
.rich-select-item.is-active { background: var(--accent); color: var(--on-accent); }
.rich-select-group { padding: 6px 12px 2px 12px; font-size: 12px; color: var(--text-muted); }
.rich-select-sep { height: 1px; margin: 5px 6px; background: var(--border); }

/* ปุ่มเลือกกลุ่มกดได้เลย (universeButtonsHtml) — หน้าตาเดียวกับ .site-select, ปุ่มที่เลือกอยู่ไฮไลต์สีเน้น */
.site-btn-group { display: inline-flex; gap: 6px; }
.site-btn {
    padding: 6px 14px; font-size: 14px; font-weight: 600; font-family: var(--font-main); line-height: 1.4; text-align: center; white-space: nowrap;
    background-color: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius-box);
    text-decoration: none; cursor: pointer;
}
.site-btn:hover { border-color: var(--accent); }
.site-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* ปุ่มที่มีไอคอนสีของตัวเอง (เขียว/แดง/ส้ม) — ปุ่มที่เลือกอยู่ไม่ถมสีเน้นเต็ม (ไอคอนสีจะมองไม่ชัด) ใช้พื้นอ่อน + ขอบสีเน้นแทน */
.site-btn .btn-icon { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.site-btn.has-icon.active { background: color-mix(in srgb, var(--accent) 14%, var(--card-bg)); color: var(--text-primary); }
