body, .main-sidebar, .content-wrapper, .main-header, .login-page {
  font-family: 'Sarabun', 'Source Sans Pro', -apple-system, 'Segoe UI', sans-serif;
}
.btn-xs { padding: .15rem .45rem; font-size: .75rem; line-height: 1.5; border-radius: .2rem; }
.games-table td { vertical-align: middle; }
.brand-link .brand-image { float: left; line-height: .8; margin-left: .8rem; margin-right: .5rem; margin-top: -3px; max-height: 33px; width: auto; }

/* sidebar — merchant ที่กำลังจัดการ */
.merchant-avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; font-size: .95rem; }
.merchant-panel .info { flex: 1; min-width: 0; line-height: 1.3; }
.merchant-caption { font-size: .72rem; color: #8a939d; }
.merchant-name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.merchant-panel .badge { flex-shrink: 0; }

/* preview รูป */
.img-preview { border: 1px dashed #ccc; border-radius: 6px; background: #f8f9fa repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 16px 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-preview-banner { height: 150px; }
.img-preview-sm { height: 90px; }
.layer-disabled { opacity: .45; }

/* เงื่อนไข */
.prob-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: #e9ecef; }
.prob-seg { color: #fff; font-size: 11px; font-weight: 600; line-height: 22px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.prob-empty { color: #888; text-shadow: none; flex: 1; }
.segment-card { border-left: 5px solid #ccc; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segment-card label { font-weight: 600; }
.wheel-preview { width: 100%; max-width: 170px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.2); }

/* คลังรูป */
.media-tile { border: 1px solid #dee2e6; border-radius: 6px; padding: 6px; background: #fff; height: 100%; }
.media-pick { cursor: pointer; transition: box-shadow .15s; }
.media-pick:hover { box-shadow: 0 0 0 3px #007bff; }
.media-thumb { height: 110px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 14px 14px; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.media-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ตัวอย่างการใช้งาน */
.demo-step-no { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; margin-right: .4rem; border-radius: 50%; background: #6c757d; color: #fff; font-size: .85rem; font-weight: 600; }
.demo-step.is-done .demo-step-no { background: #28a745; }
.demo-step-flash { animation: demo-flash 1.4s ease-out; }
@keyframes demo-flash { from { box-shadow: 0 0 0 4px rgba(40, 167, 69, .55); } to { box-shadow: 0 0 0 4px rgba(40, 167, 69, 0); } }
.demo-code-label { margin: .9rem 0 .25rem; font-size: .75rem; font-weight: 600; color: #6c757d; }
.demo-code { margin: 0; max-height: 380px; overflow: auto; padding: 10px 12px; border-radius: 6px; background: #1e1e2e; color: #e0e0e0; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.demo-code.is-empty { color: #8a8fa3; font-style: italic; }
.demo-browser { overflow: hidden; }
.demo-browser-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #e9ecef; border-bottom: 1px solid #dee2e6; }
.demo-browser-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.demo-browser-bar .dot:nth-child(2) { background: #febc2e; }
.demo-browser-bar .dot:nth-child(3) { background: #28c840; }
.demo-browser-url { flex: 1; margin-left: 8px; padding: 2px 10px; border-radius: 4px; background: #fff; color: #6c757d; font-size: .8rem; }
.demo-site-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 12px; background: #0d1f4a; color: #fff; font-size: .85rem; }
.demo-screen { position: relative; height: 760px; background: #1c1c1c; }
.demo-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.demo-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: #9a9a9a; text-align: center; }
@media (min-width: 992px) and (min-height: 700px) {
  .demo-sticky { position: sticky; top: 1rem; }
  .demo-screen { height: calc(100vh - 10rem); max-height: 860px; }
}

/* คู่มือ API */
.api-docs h1 { font-size: 1.6rem; }
.api-docs h2 { font-size: 1.3rem; margin-top: 1.8rem; padding-bottom: .3rem; border-bottom: 1px solid #dee2e6; }
.api-docs h3 { font-size: 1.1rem; margin-top: 1.3rem; }
.api-docs pre { background: #1e1e2e; color: #e0e0e0; padding: 12px; border-radius: 6px; font-size: 12.5px; }
.api-docs pre code { color: inherit; }
.api-docs table { width: 100%; margin-bottom: 1rem; font-size: 14px; }
.api-docs th, .api-docs td { border: 1px solid #dee2e6; padding: 4px 8px; vertical-align: top; }
.api-docs th { background: #f4f6f9; }
