:root { --ink: #18201d; --paper: #f5f1e8; --cream: #fffdf7; --line: #d9d3c6; --muted: #7d8179; --red: #d94935; --gold: #e0a33e; --teal: #168b84; --shadow: 0 18px 50px rgba(32, 36, 28, .08); }
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Noto Sans SC", sans-serif; font-size: 14px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.grain { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: .055; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }
.topbar { height: 78px; padding: 0 5.5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(245,241,232,.92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--cream); background: var(--red); font-family: "DM Mono", monospace; font-size: 11px; font-weight: 500; transform: rotate(-7deg); }
.brand-logo { display: block; width: auto; max-width: 150px; height: 42px; object-fit: contain; }
.brand strong { display: block; font-size: 17px; letter-spacing: 1px; font-weight: 900; }.brand small { display: block; margin-top: 5px; color: var(--muted); font: 8px "DM Mono", monospace; letter-spacing: 1px; }
.main-nav { display: flex; align-self: stretch; gap: 33px; }.main-nav a { display: flex; align-items: center; color: #777a73; position: relative; }.main-nav a.active, .main-nav a:hover { color: var(--ink); font-weight: 700; }.main-nav a.active:after { content: ""; height: 3px; left: 0; right: 0; bottom: -1px; position: absolute; background: var(--red); }.category-nav { display: flex; align-self: stretch; gap: 33px; }.category-nav a { display: flex; align-items: center; color: #777a73; position: relative; white-space: nowrap; }.category-nav a:hover { color: var(--ink); font-weight: 700; }.nav-divider { width: 1px; margin: 25px 0; background: var(--line); }
.top-actions { display: flex; align-items: center; gap: 22px; }.sync-status { color: var(--muted); font: 11px "DM Mono", monospace; display: flex; align-items: center; gap: 7px; }.sync-status i { width: 6px; height: 6px; background: #57a465; border-radius: 50%; box-shadow: 0 0 0 4px rgba(87,164,101,.12); }.admin-trigger, .primary-button { border: 0; color: var(--cream); background: var(--ink); padding: 11px 16px; cursor: pointer; font-weight: 700; }.button-icon { color: #f2bd59; margin-right: 5px; }.admin-trigger:hover, .primary-button:hover { background: var(--red); }
.masthead { min-height: 360px; padding: 72px 11vw 54px; display: flex; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: #eee8dc; }.masthead:after { content: "LOTTERY / 26"; position: absolute; right: -30px; bottom: 10px; color: rgba(24,32,29,.06); font: 120px/1 "Playfair Display", serif; font-weight: 800; white-space: nowrap; }.mast-copy { max-width: 700px; position: relative; z-index: 1; }.kicker, .eyebrow { margin: 0; color: var(--red); font: 10px "DM Mono", monospace; letter-spacing: 1.6px; font-weight: 500; }.kicker span { color: var(--ink); margin-right: 11px; }.masthead h1 { margin: 18px 0 14px; font: 800 clamp(42px, 6vw, 76px)/1.08 "Playfair Display", serif; letter-spacing: 0; }.masthead h1 em { color: var(--red); font-style: normal; }.intro { max-width: 520px; margin: 0; color: #686b63; font-size: 16px; line-height: 1.9; }.mast-meta { display: flex; align-items: center; gap: 13px; margin-top: 28px; color: #92928a; font: 10px "DM Mono", monospace; }.meta-rule { width: 34px; border-top: 1px solid #aaa69c; }.date-stamp { position: absolute; right: 12vw; top: 84px; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; color: var(--red); }.date-stamp span { grid-column: 1/3; font: 11px "DM Mono", monospace; letter-spacing: 2px; }.date-stamp strong { font: 96px/.8 "Playfair Display", serif; font-weight: 800; }.date-stamp small { font: 12px/1.4 "DM Mono", monospace; font-weight: 500; }.paper-edge { position: absolute; right: 7vw; top: 65px; height: 205px; width: 180px; border: 1px solid rgba(217,73,53,.32); transform: rotate(8deg); }
.section-wrap { width: min(1170px, 87vw); margin: 0 auto; }.draw-board { padding: 68px 0 64px; }.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }.section-heading h2 { margin: 10px 0 0; font-size: 29px; line-height: 1; letter-spacing: 0; }.text-link { font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--ink); padding-bottom: 5px; }.text-link span { color: var(--red); margin-left: 8px; font-size: 16px; }.draw-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }.draw-card { position: relative; min-height: 238px; padding: 27px 28px 24px; color: var(--cream); background: var(--ink); box-shadow: var(--shadow); overflow: hidden; }.draw-card:before { content: ""; width: 105px; height: 105px; position: absolute; right: -29px; top: -33px; border: 1px solid currentColor; border-radius: 50%; opacity: .2; }.draw-card:after { content: ""; width: 160px; height: 160px; position: absolute; right: -50px; top: -60px; border: 1px solid currentColor; border-radius: 50%; opacity: .16; }.draw-card.red { background: var(--red); }.draw-card.gold { color: var(--ink); background: var(--gold); }.draw-card.teal { background: var(--teal); }.card-head { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }.card-head h3 { margin: 0; font-size: 19px; }.card-head small { display: block; margin-top: 5px; font: 9px "DM Mono", monospace; letter-spacing: 1.2px; opacity: .7; }.card-index { font: 11px "DM Mono", monospace; opacity: .75; }.main-number { display: flex; gap: 6px; margin: 31px 0 26px; position: relative; z-index: 1; }.number-ball { display: grid; place-items: center; width: 35px; height: 41px; border: 1px solid rgba(255,255,255,.6); font: 19px "DM Mono", monospace; }.gold .number-ball { border-color: rgba(24,32,29,.55); }.card-foot { display: flex; justify-content: space-between; align-items: flex-end; position: relative; z-index: 1; }.card-foot small { display: block; font: 9px "DM Mono", monospace; opacity: .73; }.card-foot strong { display: block; margin-top: 3px; font-size: 15px; }.card-arrow { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid currentColor; font-size: 17px; }
.quick-band { min-height: 98px; display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr auto; align-items: center; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }.quick-lead { display: flex; align-items: center; gap: 14px; }.quick-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--cream); background: var(--red); font-size: 22px; }.quick-lead strong { display: block; margin-top: 5px; font-size: 15px; }.quick-stat { padding-left: 23px; border-left: 1px solid var(--line); }.quick-stat small, .quick-stat span { display: inline-block; color: var(--muted); font-size: 10px; }.quick-stat strong { margin: 0 5px 0 0; color: var(--red); font: 700 25px "DM Mono", monospace; }.quick-mark { color: var(--red); font-size: 25px; padding-right: 8px; }
.history-section { padding: 83px 0 78px; }.filters { display: flex; gap: 6px; }.filter { padding: 8px 13px; color: #868780; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 11px; }.filter.active, .filter:hover { color: var(--cream); border-color: var(--ink); background: var(--ink); }.history-layout { display: grid; grid-template-columns: 1fr 263px; gap: 35px; }.history-table-wrap { min-width: 0; }.history-table { width: 100%; border-collapse: collapse; text-align: left; }.history-table th { padding: 0 15px 14px; color: #97978f; border-bottom: 1px solid var(--ink); font: 10px "DM Mono", monospace; font-weight: 400; }.history-table td { padding: 17px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }.history-table tr:hover td { background: rgba(255,253,247,.54); }.lottery-name { font-weight: 700; }.lottery-name small { display: block; margin-top: 4px; color: var(--muted); font: 10px "DM Mono", monospace; }.date-cell { color: #62665e; font: 11px "DM Mono", monospace; }.mini-numbers { display: flex; gap: 4px; }.mini-numbers span { display: grid; place-items: center; width: 25px; height: 28px; color: var(--ink); border: 1px solid #c9c4b8; font: 12px "DM Mono", monospace; }.special-cell { color: var(--red); font: 700 13px "DM Mono", monospace; }.jackpot-cell { color: #75776f; font-size: 11px; }.archive-note { min-height: 285px; padding: 24px 25px; color: var(--cream); background: var(--ink); position: relative; }.note-number { color: #e6ae49; font: 11px "DM Mono", monospace; }.archive-note h3 { margin: 55px 0 16px; font: 700 22px/1.45 "Playfair Display", serif; }.archive-note h3 em { color: #e7aa45; font-style: normal; }.archive-note p { max-width: 180px; color: #aeb3a9; font-size: 11px; line-height: 1.8; }.circle-arrow { display: grid; place-items: center; width: 37px; height: 37px; position: absolute; right: 23px; bottom: 22px; border: 1px solid #e2a743; color: #e2a743; font-size: 18px; }.empty-state { color: var(--muted); border-bottom: 1px solid var(--line); padding: 30px 15px; }.hidden { display: none !important; }
.notes-section { padding: 0 0 90px; }.section-caption { color: var(--muted); font: 10px "DM Mono", monospace; }.article-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; border-top: 1px solid var(--line); }.article-item { padding: 25px 25px 25px 0; margin-right: 24px; border-right: 1px solid var(--line); }.article-item:last-child { border: 0; }.article-item .eyebrow { color: var(--red); }.article-item h3 { margin: 13px 0 9px; font-size: 16px; line-height: 1.55; }.article-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }.article-date { display: block; margin-top: 21px; color: #9b9b91; font: 10px "DM Mono", monospace; }.footer { display: flex; justify-content: space-between; padding: 20px 0 27px; border-top: 1px solid var(--line); color: #9a9a91; font: 9px "DM Mono", monospace; letter-spacing: .8px; }
/* Admin */
.admin-shell { min-height: 100vh; background: #eef0eb; }.admin-topbar { height: 78px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: var(--cream); }.admin-topbar .brand small { color: #a5ada2; }.admin-topbar .brand-mark { background: var(--red); }.admin-top-actions { display: flex; align-items: center; gap: 16px; }.admin-user { color: #bbc0b6; font: 11px "DM Mono", monospace; }.icon-button { width: 35px; height: 35px; color: var(--cream); border: 1px solid #556058; background: transparent; cursor: pointer; font-size: 18px; }.admin-layout { display: grid; grid-template-columns: 225px 1fr; min-height: calc(100vh - 78px); }.admin-sidebar { padding: 47px 24px 25px; border-right: 1px solid #d5d9d1; background: #e5e9e1; display: flex; flex-direction: column; }.admin-title h2 { margin: 13px 0 45px; font-size: 22px; }.admin-nav { display: grid; gap: 5px; }.admin-nav button { padding: 13px 15px; color: #777e75; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: 13px; }.admin-nav button span { display: inline-block; width: 23px; color: var(--red); }.admin-nav button.active, .admin-nav button:hover { color: var(--ink); background: var(--cream); font-weight: 700; }.sidebar-foot { margin-top: auto; color: #8c9289; font: 10px "DM Mono", monospace; }.sidebar-foot strong { display: block; color: var(--ink); margin-top: 6px; }.online-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #57a465; }.admin-content { padding: 47px 5vw 80px; max-width: 1300px; width: 100%; }.admin-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 31px; }.admin-heading h1 { margin: 10px 0 0; font-size: 31px; }.admin-heading p { margin: 6px 0 0; color: var(--muted); }.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 36px; }.admin-stat { padding: 20px 21px; background: var(--cream); border: 1px solid #dce0d8; }.admin-stat span { color: var(--muted); font-size: 11px; }.admin-stat strong { display: block; margin-top: 9px; color: var(--red); font: 700 31px "DM Mono", monospace; }.admin-panel { padding: 25px; background: var(--cream); border: 1px solid #dce0d8; }.admin-panel h3 { margin: 0 0 20px; font-size: 15px; }.admin-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }.admin-panel-head h3 { margin: 0; }.admin-list { border-top: 1px solid var(--line); }.admin-list-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 15px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }.admin-list-row strong { font-size: 13px; }.admin-list-row small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }.status-tag { display: inline-block; padding: 4px 7px; color: #4d8c5c; background: #e5f1e5; font: 10px "DM Mono", monospace; }.status-tag.draft { color: #a16b25; background: #fff0d3; }.delete-button { border: 0; background: none; color: #a4a79f; cursor: pointer; font-size: 17px; }.delete-button:hover { color: var(--red); }.secondary-button { padding: 10px 13px; color: var(--ink); border: 1px solid #bbc1b8; background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }.secondary-button:hover { border-color: var(--ink); background: #f0f1eb; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }.form-field { display: grid; gap: 7px; color: #6d756c; font-size: 11px; }.form-field.full { grid-column: 1 / -1; }.form-field input, .form-field textarea, .form-field select { width: 100%; padding: 10px 11px; color: var(--ink); border: 1px solid #cbd0c7; background: #f6f7f3; outline: none; }.form-field textarea { min-height: 95px; resize: vertical; }.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--red); }.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }.primary-button { padding: 10px 16px; }.primary-button span { color: #efb34f; padding-left: 8px; }.login-modal { width: min(420px, calc(100vw - 32px)); padding: 38px; background: var(--cream); box-shadow: 0 25px 70px rgba(0,0,0,.25); position: relative; }.modal-backdrop { display: grid; place-items: center; position: fixed; inset: 0; z-index: 20; background: rgba(24,32,29,.62); }.modal-close { position: absolute; top: 13px; right: 15px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }.login-modal h2 { margin: 13px 0 5px; font: 700 25px "Playfair Display", serif; }.login-modal > p { margin: 0 0 27px; color: var(--muted); font-size: 12px; }.login-modal form { display: grid; gap: 16px; }.login-modal label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }.login-modal input { padding: 12px; border: 1px solid var(--line); background: #f7f4eb; outline: none; }.login-modal input:focus { border-color: var(--red); }.form-error { min-height: 16px; color: var(--red); font-size: 11px; }.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; padding: 12px 17px; color: var(--cream); background: var(--ink); opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; font-size: 12px; }.toast.show { opacity: 1; transform: translateY(0); }
.reveal { animation: rise .65s both; }.reveal-delay-1 { animation-delay: .12s; }@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 850px) { .topbar { padding: 0 5vw; }.main-nav { gap: 17px; }.sync-status { display: none; }.masthead { padding: 60px 7vw 47px; }.date-stamp { right: 8vw; top: 52px; opacity: .7; }.date-stamp strong { font-size: 70px; }.paper-edge { right: 5vw; top: 36px; }.draw-cards { grid-template-columns: 1fr; }.draw-card { min-height: 210px; }.quick-band { grid-template-columns: repeat(3, 1fr); gap: 20px 0; padding: 20px 0; }.quick-lead { grid-column: 1 / -1; }.quick-stat { padding-left: 13px; }.quick-stat:first-of-type { padding-left: 0; border: 0; }.quick-mark { display: none; }.history-layout { grid-template-columns: 1fr; }.archive-note { min-height: 220px; }.article-grid { grid-template-columns: 1fr; }.article-item { border-right: 0; border-bottom: 1px solid var(--line); margin-right: 0; }.admin-layout { grid-template-columns: 1fr; }.admin-sidebar { padding: 25px 5vw 18px; }.admin-title h2 { margin-bottom: 20px; }.admin-nav { display: flex; overflow-x: auto; }.sidebar-foot { display: none; }.admin-content { padding: 30px 5vw 60px; } }
.secondary-button { padding: 11px 16px; color: var(--ink); border: 1px solid #c9cec6; background: transparent; cursor: pointer; font-weight: 700; }.secondary-button:hover { border-color: var(--ink); background: #e5e9e1; }
@media (max-width: 560px) { .brand small { display: none; }.topbar { height: 65px; }.main-nav a { font-size: 12px; }.admin-trigger { padding: 9px; font-size: 0; }.admin-trigger .button-icon { font-size: 16px; margin: 0; }.masthead { min-height: 365px; }.date-stamp { top: 235px; left: 7vw; right: auto; opacity: .5; }.paper-edge { top: 218px; left: 5vw; right: auto; width: 150px; height: 110px; }.section-wrap { width: 90vw; }.section-heading { align-items: flex-start; flex-direction: column; }.section-heading .text-link, .section-caption { margin-left: auto; }.filters { width: 100%; overflow-x: auto; }.filter { white-space: nowrap; }.history-table-wrap { overflow-x: auto; }.history-table { min-width: 650px; }.history-table th, .history-table td { padding-left: 9px; padding-right: 9px; }.quick-band { grid-template-columns: 1fr 1fr; }.quick-lead { grid-column: 1 / -1; }.quick-stat:nth-of-type(3) { border-left: 0; padding-left: 0; }.admin-heading { align-items: flex-start; flex-direction: column; gap: 18px; }.admin-grid, .form-grid { grid-template-columns: 1fr; }.form-field.full { grid-column: auto; }.admin-list-row { grid-template-columns: 1fr auto; }.admin-list-row > span:not(.status-tag), .admin-list-row > small { grid-column: 1; }.admin-list-row .status-tag, .admin-list-row .delete-button { grid-column: 2; grid-row: 1; }.footer { flex-direction: column; gap: 8px; } }

/* Lottery theme: bright result board, ticket-like framing and high-contrast balls. */
:root { --ink: #11263f; --paper: #eef3f7; --cream: #ffffff; --line: #d2dce5; --muted: #738294; --red: #e33e37; --gold: #f5b632; --teal: #168f92; --blue: #1f6fb2; --shadow: 0 18px 35px rgba(17, 38, 63, .13); }
body { background: #eef3f7; color: var(--ink); }
.topbar { border-bottom: 0; background: #ffffff; box-shadow: 0 2px 14px rgba(17, 38, 63, .08); }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #f7c047; background: var(--red); font-weight: 900; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); transform: none; }
.brand strong { color: var(--ink); }
.main-nav a { color: #8491a0; font-weight: 600; }.main-nav a.active, .main-nav a:hover { color: var(--red); }.main-nav a.active:after { height: 3px; background: var(--red); }
.sync-status i { background: #27a569; }.admin-trigger { border-radius: 4px; background: var(--blue); }.admin-trigger:hover { background: var(--red); }
.masthead { min-height: 430px; padding: 78px 11vw 65px; border-bottom: 6px solid var(--gold); background: #102c4a; color: #fff; }
.masthead:before { content: ""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(135deg, transparent 0 49%, rgba(255,255,255,.18) 50% 51%, transparent 52%), linear-gradient(45deg, transparent 0 49%, rgba(255,255,255,.12) 50% 51%, transparent 52%); background-size: 44px 44px; }
.masthead:after { content: "LUCKY DRAW"; right: -25px; bottom: 10px; color: rgba(255,255,255,.06); font: 130px/1 "Playfair Display", serif; }
.mast-copy { max-width: 610px; }.mast-copy .kicker { color: #f9c34a; }.mast-copy .kicker span { color: #ffffff; }.masthead h1 { margin-top: 20px; color: #ffffff; text-shadow: 0 4px 20px rgba(0,0,0,.18); }.masthead h1 em { color: #f9bf3b; }.intro { color: #c3d2df; }.mast-meta { color: #91a6ba; }.meta-rule { border-color: #54708a; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; position: relative; z-index: 1; }.hero-tags span { padding: 6px 9px; color: #dce8f0; border: 1px solid #49657f; font: 9px "DM Mono", monospace; letter-spacing: .5px; }
.date-stamp { right: 13vw; top: 74px; color: #f9c34a; z-index: 1; }.date-stamp span { color: #ffffff; }.paper-edge { right: 8vw; top: 55px; border-color: rgba(249,195,74,.45); }
.hero-lotto-art { position: absolute; right: 12vw; bottom: 42px; width: 300px; height: 220px; z-index: 1; }.hero-art-label { position: absolute; left: 20px; bottom: 7px; color: rgba(255,255,255,.5); font: 10px/1.35 "DM Mono", monospace; letter-spacing: 2px; transform: rotate(-8deg); }.hero-ball { position: absolute; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; border: 5px solid rgba(255,255,255,.75); box-shadow: inset -8px -10px 13px rgba(0,0,0,.16), inset 7px 7px 8px rgba(255,255,255,.3), 0 10px 15px rgba(0,0,0,.22); font: 800 32px "DM Mono", monospace; }.ball-red { left: 23px; top: 55px; color: #fff; background: var(--red); transform: rotate(-11deg); }.ball-gold { left: 103px; top: 25px; color: #513719; background: var(--gold); transform: rotate(9deg); }.ball-blue { left: 175px; top: 71px; color: #fff; background: #327fbc; transform: rotate(-6deg); }.ball-white { left: 96px; top: 110px; color: var(--ink); background: #f7f9fb; transform: rotate(12deg); }.hero-star { position: absolute; right: 13px; top: 9px; color: var(--gold); font-size: 42px; transform: rotate(18deg); }
.draw-board { padding-top: 63px; }.section-heading h2 { color: var(--ink); font-size: 31px; }.section-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 12px; }.section-heading .kicker { color: var(--red); }.text-link { color: var(--blue); border-color: var(--blue); }.text-link span { color: var(--red); }
.draw-cards { gap: 20px; }.draw-card { min-height: 260px; padding: 25px 27px 23px; border-radius: 7px; border: 1px solid rgba(255,255,255,.13); }.draw-card:before, .draw-card:after { opacity: .3; }.draw-card.red { background: linear-gradient(145deg, #e74539, #c62f34); }.draw-card.gold { color: var(--ink); background: linear-gradient(145deg, #f7c54d, #e9a528); }.draw-card.teal { background: linear-gradient(145deg, #15999a, #147a91); }.card-live { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 8px; color: rgba(255,255,255,.78); font: 9px "DM Mono", monospace; letter-spacing: .7px; }.gold .card-live { color: rgba(17,38,63,.7); }.card-live i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }.gold .card-live i { background: var(--ink); box-shadow: 0 0 0 3px rgba(17,38,63,.14); }.card-head h3 { font-size: 20px; }.main-number { gap: 7px; margin: 31px 0 27px; }.number-ball { width: 40px; height: 46px; border-radius: 50%; border: 2px solid rgba(255,255,255,.65); background: rgba(255,255,255,.13); box-shadow: inset -3px -4px 5px rgba(0,0,0,.12); font-size: 19px; font-weight: 600; }.gold .number-ball { border-color: rgba(17,38,63,.45); background: rgba(255,255,255,.2); }.card-arrow { border-radius: 50%; }.quick-band { margin-top: 4px; min-height: 108px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: #ffffff; }.quick-icon { border-radius: 50%; background: var(--red); font-size: 15px; }.quick-stat strong { color: var(--blue); }.quick-mark { color: var(--gold); }
.history-section { padding-top: 78px; }.filter { border-radius: 18px; padding: 8px 15px; color: #7d8b9b; background: #fff; }.filter.active, .filter:hover { color: #fff; border-color: var(--blue); background: var(--blue); }.history-table-wrap { padding: 21px 24px 0; background: #fff; border: 1px solid #dce4eb; border-radius: 6px; box-shadow: 0 10px 25px rgba(17,38,63,.05); }.history-table th { color: #8a98a7; border-bottom-color: #b6c4d0; }.history-table td { border-bottom-color: #e2e8ee; }.history-table tr:hover td { background: #f4f8fb; }.mini-numbers { gap: 5px; }.mini-numbers span { width: 27px; height: 30px; border-radius: 50%; border: 1px solid #ccd8e2; background: #f6f9fb; }.special-cell { color: var(--red); }.archive-note { border-radius: 6px; background: #112f4e; box-shadow: var(--shadow); }.archive-note h3 em { color: #f8c249; }.circle-arrow { border-radius: 50%; color: #f8c249; border-color: #f8c249; }.notes-section { padding-bottom: 84px; }.article-grid { gap: 16px; border-top: 0; }.article-item { padding: 24px; margin-right: 0; border: 1px solid #dce4eb; border-radius: 6px; background: #fff; box-shadow: 0 8px 22px rgba(17,38,63,.04); }.article-item:last-child { border: 1px solid #dce4eb; }.article-item h3 { color: var(--ink); }.footer { border-top-color: #cbd8e2; }
@media (max-width: 850px) { .masthead { min-height: 515px; }.hero-lotto-art { right: 7vw; bottom: 35px; transform: scale(.82); transform-origin: right bottom; }.date-stamp { right: 8vw; }.quick-band { background: #fff; } }
@media (max-width: 560px) { .masthead { min-height: 560px; padding-top: 52px; }.hero-tags { max-width: 250px; }.hero-lotto-art { left: calc(50% - 145px); right: auto; bottom: 17px; transform: scale(.7); transform-origin: center bottom; }.date-stamp { top: 255px; left: auto; right: 7vw; opacity: .85; }.paper-edge { top: 235px; left: auto; right: 5vw; }.draw-card { min-height: 240px; }.main-number { margin-top: 25px; }.history-table-wrap { padding-left: 12px; padding-right: 12px; }.archive-note { margin-top: 0; }.article-grid { gap: 12px; }.article-item { padding: 21px; } }

/* CMS refinements for longer SEO forms and six-module navigation. */

/* Shared result-desk language: the home page and every lottery page use the same surfaces. */
:root {
  --desk-navy: #102c4a;
  --desk-blue: #1f6fb2;
  --desk-red: #e33e37;
  --desk-gold: #f5b632;
  --desk-teal: #168f92;
  --desk-surface: #ffffff;
  --desk-background: #eef3f7;
  --desk-border: #d2dce5;
  --desk-muted: #738294;
  --desk-radius: 8px;
}

body { background: var(--desk-background); color: var(--desk-navy); }
.section-wrap, .seo-page-inner { width: min(1170px, 87vw); }
.quick-band { border-color: var(--desk-navy); border-radius: var(--desk-radius); }
.quick-lead small { display: block; margin-top: 5px; color: var(--desk-muted); font-size: 11px; }
.draw-card, .archive-note, .lottery-query-panel, .thai-result-card, .laos-result-card, .hanoi-result-card, .public-article-card, .article-item { border-radius: var(--desk-radius); }
.draw-card, .archive-note { box-shadow: 0 12px 28px rgba(16, 44, 74, .12); }
.lottery-page-heading { border-bottom-color: var(--desk-border); }
.lottery-query-panel { background: var(--desk-surface); border-color: var(--desk-border); box-shadow: 0 12px 28px rgba(16, 44, 74, .1); }
.lottery-query-form label { display: grid; gap: 7px; margin-top: 13px; color: var(--desk-navy); font-size: 12px; font-weight: 700; }
.lottery-query-form label:first-child { margin-top: 0; }
.lottery-query-form input, .lottery-query-form select { width: 100%; min-height: 43px; padding: 9px 11px; color: var(--desk-navy); border: 1px solid var(--desk-border); border-radius: 5px; background: #f8fafc; outline: none; }
.lottery-query-form input:focus, .lottery-query-form select:focus { border-color: var(--desk-blue); box-shadow: 0 0 0 3px rgba(31, 111, 178, .14); }
.lottery-query-result { background: #f4f8fb; }
.query-submit { border-radius: 4px; background: var(--desk-blue); }
.query-submit:hover { background: var(--desk-navy); }
.query-reset { border-radius: 4px; }
.public-article-card, .article-item, .history-table-wrap { background: var(--desk-surface); border-color: var(--desk-border); }
.seo-page { background: var(--desk-background); }

@media (max-width: 700px) {
  .section-wrap, .seo-page-inner { width: 92vw; }
  .quick-band { border-radius: 0; }
  .lottery-query-form { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
  .lottery-query-form label { min-width: 0; }
  .lottery-query-form label:first-child, .lottery-query-actions { grid-column: 1 / -1; }
}
.admin-panel { overflow: hidden; }
.admin-panel h3 { margin-top: 0; }
.admin-nav button { white-space: nowrap; border-left: 3px solid transparent; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.admin-nav button.active { border-left-color: var(--red); }
.admin-nav button:hover { transform: translateX(2px); }
.form-field input, .form-field select, .form-field textarea { width: 100%; }
.form-field textarea { min-height: 112px; resize: vertical; line-height: 1.65; }
.form-field input[type="checkbox"] { width: auto; }
.admin-list-row > div { min-width: 0; }
.admin-list-row small { overflow-wrap: anywhere; }
.form-actions { padding-top: 4px; }
.seo-page { min-height: calc(100vh - 78px); padding: 70px 7vw 100px; background: var(--paper); }
.seo-page-inner { max-width: 1080px; margin: 0 auto; }
.category-page .seo-page-inner { max-width: 1180px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--red); font: 11px "DM Mono", monospace; letter-spacing: .6px; }
.seo-page .kicker { margin-top: 58px; }
.seo-page h1 { max-width: 900px; margin: 16px 0 14px; font: 800 clamp(38px, 6vw, 72px)/1.08 "Playfair Display", serif; }
.seo-lead { max-width: 720px; margin: 0; color: #686b63; font-size: 16px; line-height: 1.9; }
.public-article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 52px; }
.public-article-card { min-height: 220px; padding: 25px; border: 1px solid var(--line); background: var(--cream); box-shadow: var(--shadow); }
.public-article-media { display: block; height: 150px; margin: -25px -25px 18px; overflow: hidden; background: #e8e5dc; }
.public-article-media img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.public-article-card:hover .public-article-media img { transform: scale(1.03); }
.public-article-card h2 { margin: 18px 0 12px; font-size: 22px; line-height: 1.4; }
.public-article-card h2 a:hover { color: var(--red); }
.public-article-card p { color: #686b63; line-height: 1.8; }
.public-article-card time, .content-meta { color: var(--muted); font: 11px "DM Mono", monospace; }
.content-page .seo-page-inner { max-width: 820px; }
.content-meta { display: flex; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.content-copy { margin-top: 34px; color: #3d443e; font-size: 16px; line-height: 2.05; white-space: normal; }
.public-route-state { max-width: 700px; min-height: calc(100vh - 78px); margin: 0 auto; padding: 15vh 7vw; }
.public-route-state h1 { margin: 18px 0 12px; font: 800 clamp(36px, 6vw, 64px)/1.1 "Playfair Display", serif; }
.public-route-state p { color: #686b63; line-height: 1.8; }
.seo-empty { grid-column: 1 / -1; padding: 35px 0; color: var(--muted); }
/* Legacy Thailand selectors — superseded by the result-sheet layout below.
.thai-lottery-page { background: #f7f7f7; color: #3f4143; }
.thai-lottery-page .seo-page-inner { max-width: 1180px; }
.thai-lottery-page .back-link { display: none; }
.thai-page-heading { display: none; }
.thai-result-grid { display: grid; gap: 32px; margin: 0 auto; }
.thai-result-card { min-width: 0; padding: 0 0 34px; border-bottom: 1px solid #e6e7e8; background: #fff; }
.thai-result-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 43px; }
.thai-result-head h2 { margin: 0; color: #454648; font-size: 19px; font-weight: 500; line-height: 1.35; }
.thai-print-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; color: #526777; background: transparent; cursor: pointer; }
.thai-print-button:hover { color: #1f465f; }
.thai-print-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.thai-result-context { display: none; }
.thai-primary-grid, .thai-secondary-prizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #eceeef; }
.thai-near-prize { margin-top: 18px; border-top: 1px solid #eceeef; }
.thai-prize { min-width: 0; min-height: 127px; padding: 13px 18px 15px 0; border-right: 1px solid #eceeef; }
.thai-primary-grid .thai-prize:nth-child(4n), .thai-secondary-prizes .thai-prize:nth-child(4n) { padding-right: 0; border-right: 0; }
.thai-primary-grid .thai-prize:nth-child(n + 5), .thai-secondary-prizes .thai-prize:nth-child(n + 5) { border-top: 1px solid #eceeef; }
.thai-prize-label { margin: 0; color: #4d4e50; font-size: 16px; font-weight: 700; line-height: 1.45; }
.thai-prize-note { min-height: 21px; margin: 1px 0 11px; color: #55575a; font-size: 13px; line-height: 1.45; }
.thai-prize-note:empty { display: block; }
.thai-prize-numbers { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 25px; min-width: 0; }
.thai-prize-numbers span { display: inline-block; color: #536979; font: 700 27px/1.25 "DM Mono", monospace; letter-spacing: 0; white-space: nowrap; }
.thai-prize-numbers em { color: #8a8d90; font-size: 13px; font-style: normal; }
.thai-prize-1 .thai-prize-numbers span { font-size: 29px; }
.thai-prize-1 { grid-column: span 1; }
.thai-prize-5, .thai-prize-6, .thai-prize-7, .thai-prize-8 { min-height: 117px; }
.thai-prize-5 .thai-prize-numbers, .thai-prize-6 .thai-prize-numbers, .thai-prize-7 .thai-prize-numbers, .thai-prize-8 .thai-prize-numbers { gap: 8px 22px; }
.thai-prize-5 .thai-prize-numbers span, .thai-prize-6 .thai-prize-numbers span, .thai-prize-7 .thai-prize-numbers span, .thai-prize-8 .thai-prize-numbers span { font-size: 16px; }
.thai-result-card .seo-empty { padding: 30px 0; }
*/

/* Effective final cascade: these rules intentionally stay after legacy theme blocks. */
.topbar, .main-nav, .category-nav { min-width: 0; }
.category-nav { overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.main-nav a[aria-current="false"] { color: #8491a0; font-weight: 600; }
.section-wrap { width: min(1170px, calc(100% - 48px)); }
.draw-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.draw-card, .card-head, .card-foot, .main-number { min-width: 0; }
.card-head { gap: 12px; }
.card-head h3, .card-head small, .card-foot strong { overflow-wrap: anywhere; }
.main-number { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.number-ball { flex: 0 0 auto; }
.history-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 290px); gap: 24px; align-items: stretch; }
.history-table-wrap { min-width: 0; overflow-x: auto; }
.history-table { width: 100%; min-width: 720px; table-layout: fixed; }
.history-table td .main-number { gap: 5px; }
.history-table .number-ball { width: 30px; height: 30px; font-size: 12px; }
.archive-note, .article-item { min-width: 0; }
.article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.article-item { margin: 0; overflow-wrap: anywhere; }
.public-ad { width: 100%; margin: 0 0 24px; overflow: hidden; border: 1px solid var(--line); background: var(--cream); }
.public-ad a, .public-ad img { display: block; width: 100%; }
.public-ad img { max-height: 260px; object-fit: cover; }
.public-ad a { transition: opacity .2s ease; }
.public-ad a:hover { opacity: .84; }
.route-loading { margin: 0 0 18px; padding: 12px 14px; color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.7); font: 11px "DM Mono", monospace; }

.seo-page.thai-lottery-page { min-height: 100vh; padding: 0 20px 56px; background: #fff; color: #111; font-family: "Noto Sans Thai", "Noto Sans SC", sans-serif; }
.thai-lottery-page .seo-page-inner { width: min(100%, 1120px); max-width: 1120px; margin: 0 auto; }
.thai-lottery-page .back-link, .thai-lottery-page .thai-page-heading { display: none; }
.thai-lottery-page .lottery-page-layout { display: block !important; }
.thai-lottery-page .thai-sheet-layout > .thai-result-grid, .thai-lottery-page .thai-sheet-layout > .thai-query-wrap { width: 100%; }
.thai-lottery-page .thai-query-wrap { margin-top: 38px; }
.thai-lottery-page .thai-query-wrap .lottery-query-panel { position: static; width: 100%; }
.thai-lottery-page .thai-result-grid { display: grid; gap: 42px; min-width: 0; margin: 0; }
.thai-lottery-page .thai-result-card { min-width: 0; padding: 0 0 38px; border: 0; border-bottom: 1px solid #d7d7d7; border-radius: 0; background: transparent; box-shadow: none; }
.thai-lottery-page .thai-result-head { position: relative; display: block; min-height: 0; padding: 16px 48px 34px; text-align: center; }
.thai-lottery-page .thai-result-kicker { margin: 0 0 4px; color: #050505; font-size: 31px; font-weight: 800; line-height: 1.2; }
.thai-lottery-page .thai-result-head h2 { margin: 0; color: #20b675; font-size: 27px; font-weight: 700; line-height: 1.35; }
.thai-lottery-page .thai-primary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0 2px; background: #fff; }
.thai-lottery-page .thai-primary-grid .thai-prize { display: flex; flex-direction: column; min-width: 0; min-height: 150px; padding: 0; border: 0; background: #f5f5f5; text-align: center; }
.thai-lottery-page .thai-primary-grid .thai-prize-label { order: 1; margin: 0; padding: 10px 5px; color: #fff; background: #20b675; font-size: 20px; font-weight: 700; line-height: 1.25; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers { order: 2; display: flex; flex: 1; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 18px; min-width: 0; padding: 8px 10px; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 42px; font-weight: 700; line-height: 1; }
.thai-lottery-page .thai-near-prize { margin: 2px 0 28px; padding: 20px 5px 24px; border-bottom: 1px solid #d0d0d0; }
.thai-lottery-page .thai-near-prize .thai-prize { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 0; border: 0; background: transparent; }
.thai-lottery-page .thai-near-prize .thai-prize-label { grid-row: 1; margin: 0; color: #111; font-size: 19px; font-weight: 800; text-align: left; }
.thai-lottery-page .thai-near-prize .thai-prize-note { grid-column: 1; grid-row: 2; margin: -12px 0 0; padding: 10px 8px; color: #222; background: #e9e9e9; font-size: 13px; text-align: center; }
.thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 2 / -1; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.thai-lottery-page .thai-near-prize .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 34px; font-weight: 700; text-align: center; }
.thai-lottery-page .thai-secondary-prizes { display: grid; gap: 48px; padding: 8px 8px 0; }
.thai-lottery-page .thai-secondary-prizes .thai-prize { min-width: 0; padding: 0; border: 0; background: transparent; text-align: center; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-label { display: inline; margin: 0; color: #111; font-size: 20px; font-weight: 800; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-note { display: inline; margin-left: 7px; padding: 0; color: #09af6c; background: transparent; font-size: 16px; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-width: 0; margin-top: 28px; padding: 14px 8px; background: #f5f5f5; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 22px; font-weight: 700; line-height: 1.45; }

@media (max-width: 1050px) {
  .sync-status { display: none; }
  .thai-lottery-page .lottery-page-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
}
@media (max-width: 850px) {
  .section-wrap { width: min(92vw, 680px); }
  .draw-cards, .history-layout, .article-grid { grid-template-columns: 1fr; }
  .thai-lottery-page .lottery-page-layout { grid-template-columns: 1fr; }
  .thai-lottery-page .lottery-query-panel { order: -1; position: static; width: 100%; }
}
@media (max-width: 700px) {
  .topbar { height: auto; min-height: 65px; padding-block: 12px; align-items: flex-start; }
  .main-nav { max-width: calc(100% - 48px); overflow: hidden; }
  .category-nav { gap: 17px; }
  .section-wrap { width: 90vw; }
  .history-table-wrap { padding-inline: 12px; }
  .thai-lottery-page { padding-inline: 12px; }
  .thai-lottery-page .thai-result-head { padding: 14px 38px 26px; }
  .thai-lottery-page .thai-result-kicker { font-size: 25px; }
  .thai-lottery-page .thai-result-head h2 { font-size: 22px; }
  .thai-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .thai-lottery-page .thai-primary-grid .thai-prize { min-height: 132px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-label { font-size: 17px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-numbers span { font-size: 32px; }
  .thai-lottery-page .thai-near-prize .thai-prize { grid-template-columns: 1fr; gap: 10px; }
  .thai-lottery-page .thai-near-prize .thai-prize-label, .thai-lottery-page .thai-near-prize .thai-prize-note, .thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 1; grid-row: auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-label { text-align: center; }
  .thai-lottery-page .thai-near-prize .thai-prize-note { width: fit-content; margin: 0 auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers { width: 100%; margin-top: 8px; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers span { font-size: 28px; }
  .thai-lottery-page .thai-secondary-prizes { gap: 38px; padding-inline: 0; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-label { font-size: 18px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { padding-block: 2px; font-size: 19px; }
  .public-ad { margin-bottom: 18px; }
  .public-ad img { max-height: 180px; }
}

/* Final Thailand-only layout override: results left, checker right on desktop. */
.thai-lottery-page .lottery-page-layout.thai-sheet-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: start;
  gap: 42px;
  min-width: 0;
}
.thai-lottery-page .thai-sheet-layout > .thai-result-grid {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}
.thai-lottery-page .thai-sheet-layout > .thai-query-wrap {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  margin-top: 0;
}
.thai-lottery-page .thai-query-wrap .lottery-query-panel {
  position: sticky;
  top: 102px;
  width: 100%;
  min-width: 0;
}
@media (max-width: 850px) {
  .thai-lottery-page .lottery-page-layout.thai-sheet-layout {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .thai-lottery-page .thai-sheet-layout > .thai-result-grid,
  .thai-lottery-page .thai-sheet-layout > .thai-query-wrap {
    grid-column: 1;
  }
  .thai-lottery-page .thai-sheet-layout > .thai-query-wrap {
    margin-top: 38px;
  }
  .thai-lottery-page .thai-query-wrap .lottery-query-panel {
    position: static;
  }
}

/* Thailand official result sheet layout. */
.seo-page.thai-lottery-page {
  width: 100%;
  min-height: 100vh;
  padding: 0 20px 70px;
  background: #fff;
  color: #111;
  font-family: "Noto Sans Thai", "Noto Sans SC", sans-serif;
}
.thai-lottery-page .seo-page-inner {
  width: min(100%, 880px);
  max-width: 880px;
  margin: 0 auto;
}
.thai-lottery-page .back-link { display: none; }
.thai-sheet-title {
  padding: 18px 0 26px;
  border-bottom: 1px dashed #d6d6d6;
  text-align: center;
}
.thai-sheet-title h1 {
  margin: 0;
  color: #050505;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.25;
}
.thai-lottery-page .thai-result-grid { display: grid; gap: 0; margin: 0; }
.thai-lottery-page .thai-result-card {
  min-width: 0;
  padding: 44px 0 34px;
  border-bottom: 1px solid #cfcfcf;
  background: #fff;
  box-shadow: none;
}
.thai-lottery-page .thai-result-card:last-child { border-bottom: 0; }
.thai-lottery-page .thai-result-head {
  display: block;
  padding: 0 0 32px;
  text-align: center;
}
.thai-lottery-page .thai-result-kicker {
  margin: 0;
  color: #050505;
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 800;
  line-height: 1.25;
}
.thai-lottery-page .thai-result-head h2 {
  margin: 2px 0 0;
  color: #18ad70;
  font-size: clamp(23px, 2.8vw, 30px);
  font-weight: 700;
  line-height: 1.3;
}
.thai-lottery-page .thai-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  background: #fff;
}
.thai-lottery-page .thai-primary-grid .thai-prize {
  display: flex;
  min-width: 0;
  min-height: 151px;
  padding: 0;
  flex-direction: column;
  border: 0;
  background: #f7f7f7;
  text-align: center;
}
.thai-lottery-page .thai-primary-grid .thai-prize-label {
  display: grid;
  min-height: 54px;
  margin: 0;
  padding: 8px 5px;
  place-items: center;
  color: #fff;
  background: #20b675;
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 700;
  line-height: 1.2;
}
.thai-lottery-page .thai-primary-grid .thai-prize-numbers {
  display: grid;
  flex: 1;
  min-width: 0;
  padding: 8px 5px;
  align-items: center;
  justify-content: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.thai-lottery-page .thai-primary-grid .thai-prize-first .thai-prize-numbers { grid-template-columns: 1fr; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers span {
  min-width: 0;
  color: #606164;
  font-family: "DM Mono", monospace;
  font-size: clamp(27px, 3.5vw, 43px);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.thai-lottery-page .thai-primary-grid .thai-prize-note {
  min-height: 38px;
  margin: 0;
  padding: 8px 4px 6px;
  color: #222;
  background: #e8e8e8;
  font-size: 12px;
  line-height: 1.25;
}
.thai-lottery-page .thai-near-prize {
  margin: 0;
  padding: 25px 5px 27px;
  border-bottom: 1px solid #cfcfcf;
}
.thai-lottery-page .thai-near-prize .thai-prize {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.thai-lottery-page .thai-near-prize .thai-prize-label {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}
.thai-lottery-page .thai-near-prize .thai-prize-note {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  padding: 9px 7px;
  color: #222;
  background: #e8e8e8;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}
.thai-lottery-page .thai-near-prize .thai-prize-numbers {
  display: grid;
  grid-column: 2 / -1;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}
.thai-lottery-page .thai-near-prize .thai-prize-numbers span {
  min-width: 0;
  color: #606164;
  font-family: "DM Mono", monospace;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.thai-lottery-page .thai-secondary-prizes {
  display: grid;
  gap: 49px;
  padding: 38px 9px 0;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize {
  min-width: 0;
  padding: 0;
  border: 0;
  background: #fff;
  text-align: center;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-label {
  display: inline;
  margin: 0;
  color: #111;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-note {
  display: inline;
  margin-left: 7px;
  color: #08ad6b;
  background: transparent;
  font-size: 15px;
  line-height: 1.45;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  margin-top: 27px;
  padding: 13px 7px;
  background: #f7f7f7;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span {
  min-width: 0;
  color: #606164;
  font-family: "DM Mono", monospace;
  font-size: clamp(15px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.thai-query-wrap { margin-top: 38px; }
.thai-query-wrap .lottery-query-panel { position: static; width: 100%; }
@media (max-width: 700px) {
  .seo-page.thai-lottery-page { padding-inline: 12px; }
  .thai-sheet-title { padding-top: 12px; }
  .thai-lottery-page .thai-result-card { padding-top: 30px; }
  .thai-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thai-lottery-page .thai-primary-grid .thai-prize { min-height: 135px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-label { font-size: 17px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-numbers span { font-size: 31px; }
  .thai-lottery-page .thai-near-prize .thai-prize { grid-template-columns: 1fr; gap: 10px; }
  .thai-lottery-page .thai-near-prize .thai-prize-label, .thai-lottery-page .thai-near-prize .thai-prize-note, .thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 1; grid-row: auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-label { text-align: center; }
  .thai-lottery-page .thai-near-prize .thai-prize-note { width: fit-content; margin: 0 auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers { width: 100%; margin-top: 7px; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers span { font-size: 27px; }
  .thai-lottery-page .thai-secondary-prizes { gap: 35px; padding: 30px 0 0; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-label { font-size: 17px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-note { font-size: 13px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { font-size: 17px; }
}

/* Final public layout corrections. Keep each page inside one predictable content column. */
.topbar { min-width: 0; }
.main-nav { min-width: 0; }
.category-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.main-nav a[aria-current="false"] { color: #777a73; font-weight: 400; }

.masthead { min-height: 410px; }
.section-wrap { width: min(1170px, calc(100% - 48px)); }
.draw-board { padding-top: 62px; padding-bottom: 54px; }
.draw-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.draw-card { min-width: 0; }
.card-head { min-width: 0; gap: 12px; }
.card-head h3, .card-head small { min-width: 0; overflow-wrap: anywhere; }
.main-number { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-width: 0; }
.number-ball { flex: 0 0 auto; }
.card-foot { min-width: 0; gap: 12px; }
.card-foot strong { min-width: 0; overflow-wrap: anywhere; }

.history-section { padding-top: 58px; }
.history-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 290px); gap: 24px; align-items: stretch; }
.history-table-wrap { min-width: 0; overflow-x: auto; }
.history-table { width: 100%; min-width: 720px; table-layout: fixed; }
.history-table th:nth-child(1) { width: 20%; }
.history-table th:nth-child(2) { width: 16%; }
.history-table th:nth-child(3) { width: 34%; }
.history-table th:nth-child(4) { width: 15%; }
.history-table th:nth-child(5) { width: 15%; }
.history-table td { min-width: 0; }
.history-table td .main-number { gap: 5px; }
.history-table .number-ball { width: 30px; height: 30px; font-size: 12px; }
.archive-note { min-width: 0; min-height: 100%; }
.notes-section { clear: both; padding-top: 70px; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.article-item { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.article-item h3, .article-item p { overflow-wrap: anywhere; }

/* Homepage result summaries keep each lottery's awards scannable before the archive. */
.lottery-result-sections { align-items: stretch; }
.home-lottery-card { min-height: 390px; display: flex; flex-direction: column; }
.home-lottery-card .card-head { align-items: flex-start; }
.home-lottery-card .card-live { flex: 0 0 auto; }
.home-result-date { margin-top: 8px; color: rgba(255,255,255,.72); font: 11px "DM Mono", monospace; }
.gold .home-result-date { color: rgba(24,32,29,.68); }
.home-prize-list { display: grid; gap: 9px; margin: 22px 0 24px; }
.home-prize-row { display: grid; grid-template-columns: minmax(70px, .7fr) minmax(0, 1.3fr); gap: 10px; align-items: center; min-width: 0; padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.2); }
.gold .home-prize-row { border-color: rgba(24,32,29,.18); }
.home-prize-label { min-width: 0; color: rgba(255,255,255,.78); font-size: 11px; line-height: 1.3; }
.gold .home-prize-label { color: rgba(24,32,29,.72); }
.home-prize-numbers { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.home-prize-numbers b { color: #fff; font: 700 17px "DM Mono", monospace; letter-spacing: 0; overflow-wrap: anywhere; }
.gold .home-prize-numbers b { color: var(--ink); }
.home-result-empty { margin: 24px 0; color: rgba(255,255,255,.72); }
.draw-detail-link, .article-more { color: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; }
.draw-detail-link span, .article-more span { margin-left: 5px; color: var(--gold); }
.draw-detail-link:hover, .article-more:hover { text-decoration: underline; text-underline-offset: 4px; }
.article-item h3 a:hover { color: var(--red); }

/* Restore the original Thailand result sheet layout. */
.seo-page.thai-lottery-page { min-height: 100vh; padding: 0 20px 56px; background: #fff; color: #111; font-family: "Noto Sans Thai", "Noto Sans SC", sans-serif; }
.thai-lottery-page .seo-page-inner { width: min(100%, 1120px); max-width: 1120px; margin: 0 auto; }
.thai-lottery-page .back-link, .thai-lottery-page .thai-page-heading { display: none; }
.thai-lottery-page .lottery-page-layout { display: block !important; }
.thai-lottery-page .thai-sheet-layout > .thai-result-grid, .thai-lottery-page .thai-sheet-layout > .thai-query-wrap { width: 100%; }
.thai-lottery-page .thai-query-wrap { margin-top: 38px; }
.thai-lottery-page .thai-query-wrap .lottery-query-panel { position: static; width: 100%; }
.thai-lottery-page .thai-result-grid { display: grid; gap: 42px; min-width: 0; margin: 0; }
.thai-lottery-page .thai-result-card { min-width: 0; padding: 0 0 38px; border: 0; border-bottom: 1px solid #d7d7d7; border-radius: 0; background: transparent; box-shadow: none; }
.thai-lottery-page .thai-result-card:last-child { border-bottom: 0; }
.thai-lottery-page .thai-result-head { position: relative; display: block; min-height: 0; padding: 16px 48px 34px; text-align: center; }
.thai-lottery-page .thai-result-kicker { margin: 0 0 4px; color: #050505; font-size: 31px; font-weight: 800; line-height: 1.2; }
.thai-lottery-page .thai-result-head h2 { margin: 0; color: #20b675; font-size: 27px; font-weight: 700; line-height: 1.35; }
.thai-lottery-page .thai-result-context { margin: -22px 0 16px; color: #777; text-align: center; }
.thai-lottery-page .thai-primary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0 2px; background: #fff; }
.thai-lottery-page .thai-primary-grid .thai-prize { display: flex; flex-direction: column; min-width: 0; min-height: 150px; padding: 0; border: 0; background: #f5f5f5; text-align: center; }
.thai-lottery-page .thai-primary-grid .thai-prize-label { order: 1; margin: 0; padding: 10px 5px; color: #fff; background: #20b675; font-size: 20px; font-weight: 700; line-height: 1.25; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers { order: 2; display: flex; flex: 1; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 18px; min-width: 0; padding: 8px 10px; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 42px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.thai-lottery-page .thai-primary-grid .thai-prize-note { order: 3; min-height: 0; margin: 0; padding: 9px 6px; color: #222; background: #e8e8e8; font-size: 13px; line-height: 1.25; }
.thai-lottery-page .thai-near-prize { margin: 2px 0 28px; padding: 20px 5px 24px; border-bottom: 1px solid #d0d0d0; }
.thai-lottery-page .thai-near-prize .thai-prize { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 0; border: 0; background: transparent; }
.thai-lottery-page .thai-near-prize .thai-prize-label { grid-row: 1; margin: 0; color: #111; font-size: 19px; font-weight: 800; line-height: 1.35; text-align: left; }
.thai-lottery-page .thai-near-prize .thai-prize-note { grid-column: 1; grid-row: 2; min-height: 0; margin: -12px 0 0; padding: 10px 8px; color: #222; background: #e9e9e9; font-size: 13px; line-height: 1.25; text-align: center; }
.thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 2 / -1; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.thai-lottery-page .thai-near-prize .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 34px; font-weight: 700; line-height: 1.15; text-align: center; }
.thai-lottery-page .thai-secondary-prizes { display: grid; gap: 48px; padding: 8px 8px 0; }
.thai-lottery-page .thai-secondary-prizes .thai-prize { min-width: 0; padding: 0; border: 0; background: transparent; text-align: center; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-label { display: inline; margin: 0; color: #111; font-size: 20px; font-weight: 800; line-height: 1.45; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-note { display: inline; min-height: 0; margin-left: 7px; padding: 0; color: #09af6c; background: transparent; font-size: 16px; line-height: 1.45; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-width: 0; margin-top: 28px; padding: 14px 8px; background: #f5f5f5; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 22px; font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.thai-lottery-page .thai-prize-numbers em { color: #888; font-size: 14px; font-style: normal; }

@media (max-width: 1050px) {
  .top-actions { gap: 10px; }
  .sync-status { display: none; }
  .thai-lottery-page .lottery-page-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
}
@media (max-width: 850px) {
  .topbar { padding-inline: 4vw; }
  .main-nav { gap: 17px; }
  .section-wrap { width: min(92vw, 680px); }
  .draw-cards { grid-template-columns: 1fr; }
  .history-layout, .article-grid { grid-template-columns: 1fr; }
  .archive-note { min-height: 220px; }
  .thai-lottery-page .lottery-page-layout { display: block !important; }
  .thai-lottery-page .lottery-query-panel { order: -1; position: static; width: 100%; }
}
@media (max-width: 700px) {
  .topbar { height: auto; min-height: 65px; padding-block: 12px; align-items: flex-start; }
  .main-nav { max-width: calc(100% - 48px); overflow: hidden; }
  .category-nav { gap: 17px; }
  .section-wrap { width: 90vw; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .history-table-wrap { padding-inline: 12px; }
  .thai-lottery-page { padding-inline: 12px; }
  .thai-lottery-page .thai-result-head { padding: 14px 38px 26px; }
  .thai-lottery-page .thai-result-kicker { font-size: 25px; }
  .thai-lottery-page .thai-result-head h2 { font-size: 22px; }
  .thai-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .thai-lottery-page .thai-primary-grid .thai-prize { min-height: 132px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-label { font-size: 17px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-numbers span { font-size: 32px; }
  .thai-lottery-page .thai-near-prize .thai-prize { grid-template-columns: 1fr; gap: 10px; }
  .thai-lottery-page .thai-near-prize .thai-prize-label, .thai-lottery-page .thai-near-prize .thai-prize-note, .thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 1; grid-row: auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-label { text-align: center; }
  .thai-lottery-page .thai-near-prize .thai-prize-note { width: fit-content; margin: 0 auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers { width: 100%; margin-top: 8px; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers span { font-size: 28px; }
  .thai-lottery-page .thai-secondary-prizes { gap: 38px; padding-inline: 0; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-label { font-size: 18px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { padding-block: 2px; font-size: 19px; }
}
@media (max-width: 850px) { .admin-nav button { flex: 0 0 auto; border-left: 0; border-bottom: 3px solid transparent; }.admin-nav button.active { border-bottom-color: var(--red); }.admin-nav button:hover { transform: translateY(-1px); } }
@media (max-width: 850px) { .public-article-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 850px) { .thai-result-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .thai-primary-grid, .thai-secondary-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }.thai-prize { padding-right: 15px; }.thai-primary-grid .thai-prize:nth-child(4n), .thai-secondary-prizes .thai-prize:nth-child(4n) { padding-right: 15px; border-right: 1px solid #eceeef; }.thai-primary-grid .thai-prize:nth-child(2n), .thai-secondary-prizes .thai-prize:nth-child(2n) { padding-right: 0; border-right: 0; }.thai-primary-grid .thai-prize:nth-child(n + 3), .thai-secondary-prizes .thai-prize:nth-child(n + 3) { border-top: 1px solid #eceeef; } }
@media (max-width: 560px) { .admin-topbar { height: 66px; padding-inline: 5vw; }.admin-layout { min-height: calc(100vh - 66px); }.admin-sidebar { padding-top: 20px; }.admin-title h2 { margin-bottom: 14px; }.admin-content { padding-top: 24px; }.admin-panel { padding: 20px 16px; }.admin-nav { scrollbar-width: thin; }.admin-list-row { row-gap: 8px; }.seo-page { min-height: calc(100vh - 66px); padding: 8px 6vw 72px; }.seo-page .kicker { margin-top: 42px; }.public-article-grid { grid-template-columns: 1fr; margin-top: 36px; }.public-article-card { min-height: auto; }.content-copy { font-size: 15px; }.thai-result-grid { margin-top: 0; }.thai-result-card { padding-bottom: 28px; }.thai-result-head { gap: 12px; }.thai-result-head h2 { font-size: 17px; }.thai-primary-grid, .thai-secondary-prizes { grid-template-columns: 1fr; }.thai-prize, .thai-primary-grid .thai-prize:nth-child(2n), .thai-primary-grid .thai-prize:nth-child(4n), .thai-secondary-prizes .thai-prize:nth-child(2n), .thai-secondary-prizes .thai-prize:nth-child(4n) { min-height: 0; padding: 14px 0; border-right: 0; border-top: 1px solid #eceeef; }.thai-prize:first-child { border-top: 0; }.thai-prize-numbers { gap: 7px 15px; }.thai-prize-numbers span, .thai-prize-first .thai-prize-numbers span { font-size: 25px; }.thai-prize-second .thai-prize-numbers span, .thai-prize-third .thai-prize-numbers span, .thai-prize-fourth .thai-prize-numbers span, .thai-prize-fifth .thai-prize-numbers span { font-size: 15px; } }
@media print { .grain, .topbar, .back-link { display: none !important; }.thai-lottery-page { padding: 0; background: #fff; }.thai-lottery-page .seo-page-inner { max-width: none; }.thai-result-grid { gap: 18px; }.thai-result-card { break-inside: avoid; }.thai-result-card:not(:first-child) { margin-top: 18px; } }

/* Reference homepage: compact four-column lottery result sheets. */
body.thai-home-active { background: #fff; color: #222; font-family: Arial, "Noto Sans Thai", "Noto Sans SC", sans-serif; }
body.thai-home-active .grain { display: none; }
body.thai-home-active .topbar { display: flex; }
.thai-home { width: min(870px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 30px; }
.thai-home-results { padding: 0 4px; }
.thai-home-heading { padding: 25px 0 37px; text-align: center; }
.thai-home-heading h1 { margin: 0; color: #111; font-size: clamp(31px, 4.2vw, 43px); font-weight: 800; line-height: 1.2; }
.thai-home-heading p { margin: 9px 0 0; color: #16a968; font-size: clamp(23px, 3vw, 29px); line-height: 1.2; }
.thai-home .thai-result-board { display: grid; gap: 26px; }
.thai-home-lottery-section { min-width: 0; padding-bottom: 25px; border-bottom: 1px solid #dedede; }
.thai-home-lottery-section:last-child { border-bottom: 0; }
.thai-home-lottery-section > header { padding: 0 0 12px; text-align: center; }
.thai-home-empty { margin: 0; padding: 18px; color: #777; text-align: center; }
.thai-home-table-scroll { width: 100%; overflow-x: auto; }
.thai-home-table { min-width: 620px; }
.thai-home .thai-result-head, .thai-home .thai-result-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.thai-home .thai-result-head > div { min-height: 53px; display: grid; place-items: center; padding: 8px 5px; color: #fff; background: #20b474; font-size: clamp(16px, 2.3vw, 22px); font-weight: 700; line-height: 1.2; text-align: center; }
.thai-home .thai-result-cell { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 101px; text-align: center; background: #f7f7f7; }
.thai-home .thai-result-cell strong { display: flex; min-height: 62px; align-items: center; justify-content: center; gap: 16px; padding: 8px 4px; color: #626466; font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; line-height: 1; overflow-wrap: anywhere; }
.thai-home .thai-result-cell strong span { min-width: 0; }
.thai-home .thai-result-cell small { min-height: 39px; display: grid; place-items: center; padding: 6px 3px; color: #222; background: #e7e7e7; font-size: 12px; line-height: 1.25; }
.thai-home-section-link { margin-top: 12px; }
.thai-home-section-link .thai-outline-link { margin: 0; font-size: 13px; }
.thai-outline-link { display: block; margin: 12px 0 0; padding: 8px 12px; border: 1px solid #0eaa65; border-radius: 4px; color: #222; font-size: 15px; text-align: center; transition: color .18s ease, background-color .18s ease; }
.thai-outline-link:hover { color: #fff; background: #20b474; }
.thai-home-history { padding: 42px 0 0; }
.thai-home-history h2, .thai-home-news h2 { margin: 0 0 19px; color: #14aa68; font-size: clamp(28px, 4vw, 34px); font-weight: 400; line-height: 1.25; text-align: center; }
.thai-history-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 72px; row-gap: 25px; padding: 0 7px; }
.thai-history-group { min-width: 0; }
.thai-history-group h3 { margin: 0 0 8px; color: #16a968; font-size: 17px; font-weight: 700; }
.thai-history-group a, .thai-history-group > span { display: block; position: relative; margin: 0 0 9px; padding-left: 13px; color: #333; font-size: 13px; line-height: 1.45; }
.thai-history-group a::before { content: ""; position: absolute; top: .5em; left: 0; border-width: 4px 0 4px 6px; border-style: solid; border-color: transparent transparent transparent #56a82d; }
.thai-history-links a, .thai-history-links > span { position: relative; padding-left: 13px; color: #333; font-size: 14px; line-height: 1.5; }
.thai-history-links a::before { content: ""; position: absolute; top: .5em; left: 0; border-width: 4px 0 4px 6px; border-style: solid; border-color: transparent transparent transparent #56a82d; }
.thai-home-news { padding: 56px 0 0; }
.thai-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.thai-news-item { min-width: 0; display: grid; grid-template-columns: 166px minmax(0, 1fr); gap: 10px; }
.thai-news-item img { width: 166px; height: 124px; display: block; object-fit: cover; background: linear-gradient(135deg, #d4d0c6, #8a9c91); }
.thai-news-featured { display: grid; grid-row: auto; }
.thai-news-featured img { width: 166px; height: 124px; }
.thai-news-featured .thai-news-copy { padding-top: 12px; }
.thai-news-copy h3 { margin: 0; color: #111; font-size: 16px; line-height: 1.28; }
.thai-news-copy h3 a:hover { color: #13a969; }
.thai-news-copy p { margin: 10px 0 0; color: #777; font-size: 14px; line-height: 1.45; }
.thai-news-item:not(.thai-news-featured) { grid-column: auto; }
.thai-news-grid .thai-news-item:nth-child(2) { grid-row: auto; }
.thai-news-grid .thai-news-item:nth-child(3) { grid-row: auto; }
.thai-news-grid .thai-news-item:nth-child(4) { grid-row: auto; }
.thai-home-legacy { display: none; }
@media (max-width: 650px) {
  .thai-home { width: min(94vw, 520px); padding-top: 6px; }
  body.thai-home-active .topbar { display: flex; }
  .thai-home-heading { padding: 21px 0 26px; }
  .thai-home-table { min-width: 560px; }
  .thai-home .thai-result-head, .thai-home .thai-result-numbers { gap: 2px; }
  .thai-home .thai-result-head > div { min-height: 56px; font-size: 15px; }
  .thai-home .thai-result-cell { min-height: 88px; }
  .thai-home .thai-result-cell strong { min-height: 52px; gap: 8px; font-size: 25px; }
  .thai-home .thai-result-cell small { min-height: 36px; font-size: 10px; }
  .thai-history-links { grid-template-columns: 1fr; gap: 11px; }
  .thai-news-grid { display: flex; flex-direction: column; gap: 18px; }
  .thai-news-featured { display: block; }
  .thai-news-featured img { height: 245px; }
  .thai-news-item:not(.thai-news-featured) { display: grid; grid-column: auto; }
  .thai-news-item img { width: 135px; height: 100px; }
}

/* Thailand result sheet overrides */
.seo-page.thai-lottery-page {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 34px 20px 72px;
  background: #fff;
}
.thai-lottery-page .seo-page-inner {
  width: min(100%, 1040px);
  max-width: 1040px;
  margin: 0 auto;
}
.thai-lottery-page .thai-result-grid {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: grid;
  gap: 46px;
}
.thai-lottery-page .thai-result-card {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 34px;
  border: 0;
  border-bottom: 1px solid #cfcfcf;
  background: #fff;
  box-shadow: none;
}
.thai-lottery-page .thai-result-card:last-child { border-bottom: 0; }
.thai-lottery-page .thai-result-head {
  display: block;
  padding: 4px 0 30px;
  text-align: center;
}
.thai-lottery-page .thai-result-kicker {
  margin: 0 0 2px;
  color: #080808;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.22;
}
.thai-lottery-page .thai-result-head h2 {
  margin: 0;
  color: #16a86b;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.3;
}
.thai-lottery-page .thai-result-context {
  margin: -14px 0 18px;
  color: #777;
  text-align: center;
  line-height: 1.5;
}
.thai-lottery-page .thai-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  border: 0;
  background: #fff;
}
.thai-lottery-page .thai-primary-grid .thai-prize {
  display: flex;
  min-width: 0;
  min-height: 150px;
  padding: 0 0 2px;
  flex-direction: column;
  border: 0;
  background: #f7f7f7;
  text-align: center;
}
.thai-lottery-page .thai-primary-grid .thai-prize-label {
  display: grid;
  min-height: 54px;
  margin: 0;
  padding: 10px 6px;
  place-items: center;
  color: #fff;
  background: #20b675;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.thai-lottery-page .thai-primary-grid .thai-prize-note {
  order: 3;
  min-height: 38px;
  margin: auto 0 0;
  padding: 9px 5px 7px;
  color: #222;
  background: #e8e8e8;
  font-size: 13px;
  line-height: 1.25;
}
.thai-lottery-page .thai-primary-grid .thai-prize-numbers {
  display: grid;
  min-width: 0;
  min-height: 57px;
  padding: 8px 5px;
  align-items: center;
  justify-content: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #f7f7f7;
}
.thai-lottery-page .thai-primary-grid .thai-prize-first .thai-prize-numbers { grid-template-columns: 1fr; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers span {
  min-width: 0;
  color: #606164;
  font-family: "DM Mono", monospace;
  font-size: clamp(28px, 3.4vw, 43px);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.thai-lottery-page .thai-near-prize {
  margin: 0;
  padding: 24px 4px 30px;
  border-bottom: 1px solid #cfcfcf;
}
.thai-lottery-page .thai-near-prize .thai-prize {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #fff;
}
.thai-lottery-page .thai-near-prize .thai-prize-label {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: #111;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}
.thai-lottery-page .thai-near-prize .thai-prize-note {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  padding: 10px 8px;
  color: #222;
  background: #e8e8e8;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
}
.thai-lottery-page .thai-near-prize .thai-prize-numbers {
  display: grid;
  grid-column: 2 / -1;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}
.thai-lottery-page .thai-near-prize .thai-prize-numbers span {
  min-width: 0;
  color: #606164;
  font-family: "DM Mono", monospace;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.thai-lottery-page .thai-secondary-prizes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  padding: 42px 10px 0;
  border: 0;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize {
  display: block;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  text-align: center;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-label {
  display: inline;
  margin: 0;
  color: #111;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-note {
  display: inline;
  margin: 0 0 0 7px;
  color: #09af6c;
  font-size: 16px;
  line-height: 1.45;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  margin-top: 26px;
  padding: 14px 10px;
  background: #f7f7f7;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span {
  min-width: 0;
  padding: 4px 3px;
  color: #606164;
  font-family: "DM Mono", monospace;
  font-size: clamp(15px, 1.65vw, 23px);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.thai-lottery-page .thai-prize-numbers em { color: #888; font-size: 14px; font-style: normal; }

@media (max-width: 700px) {
  .seo-page.thai-lottery-page { padding: 20px 12px 48px; }
  .thai-lottery-page .thai-result-grid { gap: 32px; }
  .thai-lottery-page .thai-result-card { padding-bottom: 26px; }
  .thai-lottery-page .thai-result-head { padding-bottom: 22px; }
  .thai-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .thai-lottery-page .thai-primary-grid .thai-prize { min-height: 126px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-label { min-height: 48px; font-size: 16px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-numbers span { font-size: clamp(24px, 7vw, 34px); }
  .thai-lottery-page .thai-near-prize { padding: 20px 0 24px; }
  .thai-lottery-page .thai-near-prize .thai-prize { grid-template-columns: 1fr; gap: 10px; }
  .thai-lottery-page .thai-near-prize .thai-prize-label,
  .thai-lottery-page .thai-near-prize .thai-prize-note,
  .thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 1; grid-row: auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-label { text-align: center; }
  .thai-lottery-page .thai-near-prize .thai-prize-note { width: min(100%, 220px); margin: 0 auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers { width: 100%; gap: 8px; margin-top: 4px; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers span { font-size: clamp(25px, 7vw, 32px); }
  .thai-lottery-page .thai-secondary-prizes { grid-template-columns: 1fr; gap: 34px; padding: 30px 0 0; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-label { font-size: 18px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-note { font-size: 14px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; padding-inline: 6px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { font-size: 17px; }
}

@media print {
  .seo-page.thai-lottery-page { padding: 0; }
  .thai-lottery-page .seo-page-inner { width: 100%; max-width: none; }
  .thai-lottery-page .thai-result-grid { gap: 18px; }
  .thai-lottery-page .thai-result-card { break-inside: avoid; }
}

/* Public lottery/news additions: intentionally scoped to the new regions. */
.public-news-section {
  margin-top: 56px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.public-news-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}
.public-news-heading .kicker { margin: 0; }
.public-news-heading h2 {
  margin: 0;
  color: #15966f;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}
.public-news-heading > span {
  color: var(--muted);
  font-size: 13px;
}
.public-news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.public-news-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--cream);
  box-shadow: 0 10px 26px rgba(32, 36, 28, .045);
}
.public-news-card.is-featured { border-top: 3px solid #15966f; }
.public-news-card-index {
  color: #15966f;
  font: 500 15px/1 "DM Mono", monospace;
}
.public-news-card-body { min-width: 0; }
.public-news-card-media { width: 100%; height: 132px; margin: 0 0 14px; overflow: hidden; background: #e8e5dc; }
.public-news-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.public-news-card small {
  color: var(--red);
  font: 10px "DM Mono", monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.public-news-card h3 {
  margin: 8px 0 7px;
  font-size: 17px;
  line-height: 1.45;
}
.public-news-card h3 a:hover { color: #15966f; }
.public-news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.public-news-card time {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font: 11px "DM Mono", monospace;
}
.public-news-more,
.lottery-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 14px;
  border: 1px solid #15966f;
  color: #15966f;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s ease, color .2s ease;
}
.public-news-more:hover,
.lottery-detail-link:hover { color: #fff; background: #15966f; }
.lottery-detail-link { margin: 0 30px 24px; }
.query-bottom-ad {
  width: 100%;
  margin: 16px 0 0;
}
.query-bottom-ad .public-ad { margin-bottom: 0; }
.query-bottom-ad .public-ad img { max-height: 180px; }
.lottery-detail-full {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}
.lottery-detail-full-row {
  display: grid;
  grid-template-columns: minmax(180px, .38fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--cream);
}
.lottery-detail-full-row h2 { margin: 0; font-size: 18px; }
.lottery-detail-full-row > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  color: #606164;
  font: 700 clamp(24px, 4vw, 42px)/1.1 "DM Mono", monospace;
}

body[data-page-template="home"] .home-results-with-rail {
  display: grid;
  grid-template-columns: minmax(120px, 0.18fr) minmax(0, 1fr) minmax(120px, 0.18fr);
  align-items: start;
  gap: 22px;
}
body[data-page-template="home"] .home-ad-rail {
  min-width: 0;
}
body[data-page-template="home"] .home-ad-rail .public-ad {
  position: sticky;
  top: 98px;
  margin-bottom: 16px;
}
body[data-page-template="home"] .home-ad-rail .public-ad img {
  height: 200px;
  max-height: 200px;
  object-fit: cover;
}
body[data-page-template="home"] .home-query-ad {
  max-width: 720px;
  margin: 22px auto 0;
}
body[data-page-template="home"] .home-query-ad .public-ad { margin-bottom: 0; }
body[data-page-template="home"] .home-query-ad .public-ad img { max-height: 180px; }

@media (max-width: 900px) {
  .public-news-grid { grid-template-columns: 1fr; }
  .public-news-heading { display: block; }
  .public-news-heading h2 { margin: 7px 0; }
  body[data-page-template="home"] .home-results-with-rail { grid-template-columns: 1fr; }
  body[data-page-template="home"] .home-ad-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body[data-page-template="home"] .home-ad-rail .public-ad { position: static; margin: 0; }
  body[data-page-template="home"] .home-ad-rail .public-ad img { height: auto; max-height: 150px; }
  body[data-page-template="home"] .home-ad-rail-left { order: 2; }
  body[data-page-template="home"] .home-ad-rail-right { order: 3; }
  body[data-page-template="home"] .home-results-with-rail .thai-result-board { order: 1; }
}
@media (max-width: 560px) {
  .public-news-card { grid-template-columns: 28px minmax(0, 1fr); padding: 15px; }
  .public-news-card-media { height: 118px; }
  .public-article-media { height: 132px; margin: -15px -15px 15px; }
  .lottery-detail-link { margin-inline: 18px; }
  .lottery-detail-full-row { grid-template-columns: 1fr; gap: 10px; }
  body[data-page-template="home"] .home-ad-rail { grid-template-columns: 1fr; }
}

/* Web-source category pages group each fetched game into one compact card. */
.web-source-category-page .seo-page-inner { max-width: 1600px; }
.web-source-grid { display: block; min-width: 0; margin-top: 24px; padding: 0; overflow: visible; }
.web-source-grid.has-game-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.web-source-grid > * { min-width: 0; max-width: 100%; }
.web-source-grid.has-game-cards > .web-source-intro { grid-column: 1 / -1; }
.web-source-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px; border: 1px solid #d4e4d6; border-radius: 4px; background: rgba(255, 255, 255, .9); color: #18a950; overflow: hidden; }
.web-source-card > * { min-width: 0; max-width: 100%; margin: 0 0 7px; padding: 0; border: 0; background: transparent; box-shadow: none; overflow-wrap: anywhere; word-break: break-word; }
.web-source-card > *:last-child { margin-bottom: 0; }
.web-source-card img, .web-source-card video, .web-source-card svg { display: block; width: auto; max-width: 100%; height: auto; max-height: 150px; margin: 4px auto; object-fit: contain; }
.web-source-card .game-status { display: block; margin-bottom: 10px; }
.web-source-card .game-teams { display: grid; gap: 6px; }
.web-source-card .game-team { display: grid; grid-template-columns: 56px minmax(0, 1fr) 34px; align-items: center; gap: 8px; min-width: 0; }
.web-source-card .game-team-mark { display: grid; place-items: center; width: 56px; height: 56px; min-width: 0; border-radius: 8px; background: #f2f7f3; overflow: hidden; }
.web-source-card .game-team-mark img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; }
.web-source-card .game-team-mark-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: #15966f; font-size: 11px; font-weight: 800; }
.web-source-card .game-team-mark img[hidden], .web-source-card .game-team-mark-fallback[hidden] { display: none; }
.web-source-card .game-team > div { min-width: 0; }
.web-source-card .team-name { display: block; min-width: 0; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; word-break: normal; }
.web-source-card .team-record { font-size: 11px; line-height: 1.25; }
.web-source-card .game-score { min-width: 0; font-size: 15px; font-weight: 700; text-align: right; }
.web-source-card .game-vs { display: block; width: 56px; margin-left: 64px; padding: 0; font-size: 11px; line-height: 1; text-align: center; }
.web-source-card iframe { display: block; width: 100%; max-width: 100%; height: min(180px, 56.25vw); max-height: 180px; margin: 6px 0; border: 0; }
.web-source-card table { display: block; max-width: 100%; margin: 6px 0; overflow-x: auto; }
.web-source-card pre { max-width: 100%; margin: 6px 0; overflow-x: auto; white-space: pre-wrap; }
.web-source-card h1, .web-source-card h2, .web-source-card h3, .web-source-card h4, .web-source-card p { margin: 3px 0; }
.web-source-card .game-status { order: 1; font-size: 13px; line-height: 1.35; }
.web-source-card .game-teams { order: 2; }
.web-source-card .game-info { order: 3; font-size: 12px; line-height: 1.35; }
.web-source-card .game-detail-link { order: 4; font-size: 12px; line-height: 1.35; }
@media (max-width: 1100px) { .web-source-grid.has-game-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .web-source-grid.has-game-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (max-width: 560px) { .web-source-grid.has-game-cards { grid-template-columns: 1fr; gap: 12px; } .web-source-grid { margin-top: 18px; } .web-source-card { padding: 12px; } .web-source-card img, .web-source-card video, .web-source-card svg { max-height: 130px; } .web-source-card .game-team { grid-template-columns: 48px minmax(0, 1fr) 32px; gap: 7px; } .web-source-card .game-team-mark { width: 48px; height: 48px; } .web-source-card .game-vs { width: 48px; margin-left: 55px; } .web-source-card iframe { height: 180px; max-height: 180px; } }

/* Keep fetched markup inside the category grid, even when a source has oversized media. */
.web-source-category-page .web-source-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}
.web-source-category-page .web-source-grid > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.web-source-category-page .web-source-grid img,
.web-source-category-page .web-source-grid video,
.web-source-category-page .web-source-grid canvas,
.web-source-category-page .web-source-grid svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto !important;
  max-height: 240px;
  object-fit: contain;
}
.web-source-category-page .web-source-grid iframe,
.web-source-category-page .web-source-grid table,
.web-source-category-page .web-source-grid pre {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.web-source-category-page .web-source-grid table,
.web-source-category-page .web-source-grid pre { overflow-x: auto; }
.web-source-category-page .web-source-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  max-height: none;
  padding: clamp(12px, 1.25vw, 18px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}
.web-source-category-page .web-source-grid > *:not(.web-source-card) {
  min-height: 0;
  overflow: hidden;
}
.web-source-category-page .web-source-card .game-status,
.web-source-category-page .web-source-card .game-info,
.web-source-category-page .web-source-card .game-detail-link {
  flex: 0 0 auto;
}
.web-source-category-page .web-source-card .game-teams {
  flex: 0 1 auto;
  min-height: 0;
  align-content: start;
  overflow: hidden;
}
.web-source-category-page .web-source-card small {
  display: block;
  color: #52635d;
  font-size: 11px;
  line-height: 1.35;
}
.web-source-category-page .web-source-card .match-team-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "homeLogo vs awayLogo"
    "homeName vs awayName";
  align-items: center;
  justify-items: center;
  gap: 8px 10px;
  min-height: 0;
  margin: 6px 0;
  color: #08233d;
  font-size: clamp(12px, .9vw, 15px);
  line-height: 1.25;
  text-align: center;
}
.web-source-category-page .web-source-card .match-team-logo {
  width: min(34%, 108px) !important;
  max-width: 108px;
  max-height: 108px;
  margin: 0 auto;
}
.web-source-category-page .web-source-card .match-team-logo:first-of-type { grid-area: homeLogo; }
.web-source-category-page .web-source-card .match-team-logo:last-of-type { grid-area: awayLogo; }
.web-source-category-page .web-source-card .match-team-name {
  min-width: 0;
  max-width: 100%;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.web-source-category-page .web-source-card .match-team-name:first-of-type { grid-area: homeName; }
.web-source-category-page .web-source-card .match-team-name:last-of-type { grid-area: awayName; }
.web-source-category-page .web-source-card .match-team-vs {
  grid-area: vs;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eaf5f7;
  color: #168b84;
  font: 800 11px/1 "DM Mono", monospace;
}
.web-source-category-page .web-source-card .meta-row,
.web-source-category-page .web-source-card .section-note,
.web-source-category-page .web-source-card .btn {
  flex: 0 0 auto;
}
.web-source-category-page .web-source-card .section-note {
  margin: 4px 0;
  color: #52635d;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.web-source-category-page .web-source-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #18201d;
  color: #fffdf7;
  font-size: 12px;
  font-weight: 800;
}
.web-source-category-page .web-source-card img,
.web-source-category-page .web-source-card video,
.web-source-category-page .web-source-card canvas,
.web-source-category-page .web-source-card svg {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(32cqi, 180px);
  max-height: 180px;
  object-fit: contain;
}
.web-source-category-page .web-source-card table,
.web-source-category-page .web-source-card pre,
.web-source-category-page .web-source-card iframe {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.web-source-category-page .web-source-card table,
.web-source-category-page .web-source-card pre {
  overflow-x: auto;
}
.web-source-category-page .web-source-card * {
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .web-source-category-page .web-source-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .web-source-category-page .web-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 560px) {
  .web-source-category-page .web-source-grid { grid-template-columns: 1fr; gap: 12px; }
  .web-source-category-page .web-source-grid img,
  .web-source-category-page .web-source-grid video,
  .web-source-category-page .web-source-grid canvas,
  .web-source-category-page .web-source-grid svg { max-height: 130px; }
  .web-source-category-page .web-source-card { padding: 12px; }
}

/* Laos / Hanoi public result sheets */
.lottery-page-heading { margin: 58px 0 42px; }
.lottery-page-heading .kicker { margin: 0; }
.lottery-page-heading h1 { margin: 15px 0 12px; }
.laos-lottery-page { --laos-ink: #2b2118; --laos-red: #ae4030; --laos-gold: #dca64a; background: #f4ead8; }
.laos-lottery-page .seo-page-inner, .hanoi-lottery-page .seo-page-inner { max-width: 1050px; }
.laos-lottery-page .back-link, .hanoi-lottery-page .back-link { color: var(--laos-red); }
.laos-lottery-page .lottery-page-heading { position: relative; padding-bottom: 30px; border-bottom: 1px solid rgba(174,64,48,.28); }
.laos-lottery-page .lottery-page-heading:after { content: "LAO / 06"; position: absolute; right: 0; bottom: 15px; color: rgba(174,64,48,.12); font: 800 clamp(52px, 10vw, 120px)/1 "Playfair Display", serif; }
.laos-lottery-page .lottery-page-heading h1 { color: var(--laos-ink); }
.laos-result-grid { display: grid; gap: 25px; }
.laos-result-card { position: relative; overflow: hidden; padding: 0; color: var(--laos-ink); border: 1px solid rgba(104,72,35,.2); background: #fffaf0; box-shadow: 0 18px 42px rgba(91,62,30,.1); }
.laos-result-card:before { content: ""; position: absolute; inset: 12px; pointer-events: none; border: 1px solid rgba(220,166,74,.32); }
.laos-result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 28px 36px 23px; border-bottom: 1px solid rgba(104,72,35,.18); }
.laos-result-kicker { margin: 0 0 6px; color: var(--laos-red); font: 10px "DM Mono", monospace; letter-spacing: 2px; }
.laos-result-head h2 { margin: 0; font: 800 clamp(27px, 4vw, 44px)/1.05 "Playfair Display", serif; }
.laos-draw-label { padding: 7px 10px; color: #fffaf0; background: var(--laos-red); font: 11px "DM Mono", monospace; letter-spacing: .5px; }
.laos-result-foot, .hanoi-result-foot { display: flex; justify-content: space-between; gap: 15px; padding: 13px 36px; color: #927d67; border-top: 1px solid rgba(104,72,35,.18); font: 10px "DM Mono", monospace; letter-spacing: .45px; }

.hanoi-lottery-page { background: #eff3f1; --hanoi-ink: #183a39; --hanoi-accent: #168b84; --hanoi-line: #cbd9d5; }
.laos-prize-table { padding: 0 30px; }
.laos-table-head, .laos-prize-row { display: grid; grid-template-columns: minmax(140px, .4fr) minmax(0, 1.6fr); gap: 20px; align-items: center; }
.laos-table-head { padding: 14px 0 10px; color: #a27d41; border-bottom: 2px solid rgba(104,72,35,.25); font: 10px "DM Mono", monospace; letter-spacing: 1.2px; text-transform: uppercase; }
.laos-prize-row { min-height: 58px; border-bottom: 1px solid rgba(104,72,35,.14); }
.laos-prize-row:last-child { border-bottom: 0; }
.laos-prize-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.laos-prize-name strong { color: var(--laos-ink); font-size: 14px; overflow-wrap: anywhere; }
.laos-prize-name small { color: #a88752; font: 9px "DM Mono", monospace; overflow-wrap: anywhere; }
.laos-prize-numbers { display: flex; flex-wrap: wrap; gap: 7px 15px; min-width: 0; }
.laos-prize-numbers span { color: #684823; font: 600 clamp(16px, 2vw, 22px)/1.25 "DM Mono", monospace; letter-spacing: .4px; }
.laos-prize-numbers em { color: #a88752; font-style: normal; }
.hanoi-lottery-page .lottery-page-heading { padding-bottom: 30px; border-bottom: 2px solid var(--hanoi-ink); }
.hanoi-lottery-page .lottery-page-heading h1 { color: var(--hanoi-ink); }
.hanoi-lottery-page .kicker { color: var(--hanoi-accent); }
.hanoi-result-grid { display: grid; gap: 32px; }
.hanoi-result-card { overflow: hidden; border: 1px solid var(--hanoi-line); background: #fff; box-shadow: 0 16px 36px rgba(24,58,57,.08); }
.hanoi-result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding: 25px 30px 22px; background: var(--hanoi-ink); color: #fff; }
.hanoi-result-kicker { margin: 0 0 8px; color: #9ad5c8; font: 10px "DM Mono", monospace; letter-spacing: 1.4px; }
.hanoi-result-head h2 { margin: 0; font: 800 clamp(25px, 4vw, 39px)/1 "Playfair Display", serif; }
.hanoi-result-meta { display: grid; gap: 7px; min-width: 145px; text-align: right; }
.hanoi-result-meta span { color: #9ad5c8; font-size: 12px; }
.hanoi-result-meta b { color: #f2c75c; font: 500 19px "DM Mono", monospace; letter-spacing: 1px; }
.hanoi-prize-table { padding: 0 30px; }
.hanoi-table-head, .hanoi-prize-row { display: grid; grid-template-columns: minmax(140px, .4fr) minmax(0, 1.6fr); gap: 20px; align-items: center; }
.hanoi-table-head { padding: 14px 0 10px; color: #7c9691; border-bottom: 2px solid var(--hanoi-line); font: 10px "DM Mono", monospace; letter-spacing: 1.2px; text-transform: uppercase; }
.hanoi-prize-row { min-height: 56px; border-bottom: 1px solid #e4ece9; }
.hanoi-prize-row:last-child { border-bottom: 0; }
.hanoi-prize-name { display: flex; align-items: center; gap: 9px; }
.hanoi-prize-name strong { color: var(--hanoi-ink); font-size: 14px; }
.hanoi-prize-name small { color: #91aaa4; font: 9px "DM Mono", monospace; }
.hanoi-prize-numbers { display: flex; flex-wrap: wrap; gap: 7px 19px; min-width: 0; }
.hanoi-prize-numbers span { color: #315d59; font: 600 clamp(16px, 2vw, 22px)/1.25 "DM Mono", monospace; letter-spacing: .4px; }
.hanoi-prize-numbers em { color: #9baca9; font-style: normal; }
.hanoi-result-foot { color: #78918d; border-top-color: var(--hanoi-line); }

/* Lottery number checker */
.lottery-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  align-items: start;
  gap: 42px;
}
.lottery-query-panel {
  position: sticky;
  top: 102px;
  min-width: 0;
  padding: 24px 22px 20px;
  border: 1px solid var(--line);
  background: var(--cream);
  box-shadow: 0 14px 30px rgba(32, 36, 28, .07);
}
.lottery-query-panel.red { --query-accent: #c44838; }
.lottery-query-panel.gold { --query-accent: #a96e20; }
.lottery-query-panel.teal { --query-accent: #167a73; }
.lottery-query-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--query-accent);
  font: 10px "DM Mono", monospace;
  letter-spacing: 1.2px;
}
.query-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}
.lottery-query-panel h2 { margin: 18px 0 8px; color: var(--ink); font-size: 24px; line-height: 1.3; }
.lottery-query-intro, .lottery-query-help { color: #686b63; font-size: 13px; line-height: 1.7; }
.lottery-query-intro { margin: 0 0 20px; }
.lottery-query-form label { display: grid; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 700; }
.lottery-query-form input {
  width: 100%;
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid #cfc8bb;
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font: 600 20px "DM Mono", monospace;
  letter-spacing: 1px;
}
.lottery-query-form input:focus { border-color: var(--query-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--query-accent) 14%, transparent); }
.lottery-query-actions { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; margin-top: 10px; }
.query-submit, .query-reset { min-height: 42px; border: 0; cursor: pointer; }
.query-submit { color: #fff; background: var(--query-accent); font-size: 13px; font-weight: 700; }
.query-submit span { margin-right: 5px; font-size: 16px; }
.query-submit:hover { filter: brightness(.92); }
.query-reset { color: var(--muted); border: 1px solid var(--line); background: transparent; font-size: 22px; line-height: 1; }
.query-reset:hover { color: var(--ink); border-color: var(--ink); }
.lottery-query-help { margin: 13px 0 0; font-size: 12px; }
.lottery-query-result { min-height: 82px; margin-top: 18px; padding: 13px; border-top: 2px solid var(--query-accent); background: #f4f0e7; }
.query-result-placeholder, .query-result-invalid span, .query-result-none span { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.query-result-invalid strong, .query-result-none strong, .query-result-hit > strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.4; }
.query-result-invalid strong, .query-result-none strong { margin-bottom: 4px; }
.query-result-hit > strong { color: var(--query-accent); }
.query-hit-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #ddd6c9; }
.query-hit-row span { color: var(--ink); font-size: 12px; font-weight: 700; }
.query-hit-row b { color: var(--query-accent); font: 11px "DM Mono", monospace; }
.query-hit-row small { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.4; }
.query-hit-more { display: block; margin-top: 11px; color: var(--muted); font-size: 11px; }
.lottery-query-rules { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.lottery-query-rules > span { color: var(--muted); font: 10px "DM Mono", monospace; letter-spacing: 1px; }
.lottery-query-rules ul { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.lottery-query-rules li { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 12px; }
.lottery-query-rules li small { color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  .lottery-page-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 26px; }
  .lottery-query-panel { padding-inline: 17px; }
}

@media (max-width: 700px) {
  .lottery-page-layout { display: flex; flex-direction: column; gap: 32px; }
  .lottery-query-panel { position: static; order: -1; width: 100%; }
  .lottery-page-heading { margin-top: 42px; margin-bottom: 28px; }
  .laos-lottery-page .lottery-page-heading:after { right: -8px; bottom: 15px; font-size: 52px; }
  .laos-result-head, .hanoi-result-head { align-items: flex-start; flex-direction: column; padding: 22px 20px 18px; }
  .laos-draw-label { align-self: flex-start; }
  .laos-result-foot, .hanoi-result-foot { align-items: flex-start; flex-direction: column; padding: 12px 20px; }
  .hanoi-result-meta { width: 100%; min-width: 0; text-align: left; }
  .laos-prize-table, .hanoi-prize-table { padding: 0 16px; }
  .laos-table-head, .laos-prize-row, .hanoi-table-head, .hanoi-prize-row { grid-template-columns: minmax(74px, .55fr) minmax(0, 1.45fr); gap: 9px; }
  .laos-prize-row, .hanoi-prize-row { min-height: 60px; }
  .hanoi-prize-name { display: block; }
  .hanoi-prize-name small { display: block; margin-top: 3px; }
  .hanoi-prize-numbers { gap: 4px 10px; }
  .hanoi-prize-numbers span { font-size: 14px; }
}

@media print {
  .laos-lottery-page, .hanoi-lottery-page { padding: 0; }
  .laos-result-card, .hanoi-result-card { break-inside: avoid; box-shadow: none; }
}

/* Legacy Thailand lottery result sheet — superseded below.
.thai-lottery-page {
  --thai-green: #20b675;
  --thai-ink: #111;
  --thai-number: #626466;
  --thai-strip: #f5f5f5;
  min-height: 100vh;
  padding: 0 20px 56px;
  background: #fff;
  color: var(--thai-ink);
  font-family: "Noto Sans Thai", "Noto Sans SC", sans-serif;
}
.thai-lottery-page .seo-page-inner { max-width: 880px; margin: 0 auto; }
.thai-lottery-page .back-link, .thai-page-heading { display: none; }
.thai-result-grid { display: grid; gap: 42px; margin: 0; }
.thai-result-card { min-width: 0; padding: 0 0 38px; border: 0; border-bottom: 1px solid #d7d7d7; background: transparent; box-shadow: none; }
.thai-result-card:last-child { border-bottom: 0; }
.thai-result-head { position: relative; display: block; min-height: 0; padding: 16px 48px 34px; text-align: center; }
.thai-result-kicker { margin: 0 0 4px; color: #050505; font-size: 31px; font-weight: 800; line-height: 1.2; }
.thai-result-head h2 { margin: 0; color: var(--thai-green); font-size: 27px; font-weight: 700; line-height: 1.35; }
.thai-print-button { position: absolute; top: 18px; right: 0; display: inline-grid; place-items: center; width: 32px; height: 32px; color: #777; }
.thai-print-button:hover { color: var(--thai-green); }
.thai-result-context { margin: -22px 0 16px; color: #777; text-align: center; }
.thai-primary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0 2px; background: #fff; }
.thai-primary-grid .thai-prize { display: flex; flex-direction: column; min-width: 0; min-height: 150px; padding: 0; border: 0; background: var(--thai-strip); text-align: center; }
.thai-primary-grid .thai-prize-label { order: 1; margin: 0; padding: 10px 5px; color: #fff; background: var(--thai-green); font-size: 20px; font-weight: 700; line-height: 1.25; }
.thai-primary-grid .thai-prize-numbers { order: 2; display: flex; flex: 1; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 24px; min-width: 0; padding: 8px 10px; }
.thai-primary-grid .thai-prize-numbers span { color: var(--thai-number); font-family: "DM Mono", monospace; font-size: 39px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.thai-primary-grid .thai-prize-note { order: 3; min-height: 0; margin: 0; padding: 9px 6px; color: #222; background: #e8e8e8; font-size: 13px; line-height: 1.25; }
.thai-primary-grid .thai-prize-first .thai-prize-numbers span { font-size: 42px; }
.thai-near-prize { margin: 2px 0 28px; padding: 20px 5px 24px; border-bottom: 1px solid #d0d0d0; }
.thai-near-prize .thai-prize { display: grid; grid-template-columns: minmax(180px, .8fr) 1fr 1fr; align-items: center; gap: 18px; padding: 0; border: 0; background: transparent; }
.thai-near-prize .thai-prize-label { grid-row: 1; margin: 0; color: #111; font-size: 19px; font-weight: 800; line-height: 1.35; text-align: left; }
.thai-near-prize .thai-prize-note { grid-column: 1; grid-row: 2; min-height: 0; margin: -12px 0 0; padding: 10px 8px; color: #222; background: #e9e9e9; font-size: 13px; line-height: 1.25; text-align: center; }
.thai-near-prize .thai-prize-numbers { grid-column: 2 / -1; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.thai-near-prize .thai-prize-numbers span { color: var(--thai-number); font-family: "DM Mono", monospace; font-size: 34px; font-weight: 700; line-height: 1.15; text-align: center; }
.thai-secondary-prizes { display: grid; gap: 48px; padding: 8px 8px 0; }
.thai-secondary-prizes .thai-prize { min-width: 0; padding: 0; border: 0; background: transparent; text-align: center; }
.thai-secondary-prizes .thai-prize-label { display: inline; margin: 0; color: #111; font-size: 20px; font-weight: 800; line-height: 1.45; }
.thai-secondary-prizes .thai-prize-note { display: inline; min-height: 0; margin: 0 0 0 7px; padding: 0; color: #09af6c; background: transparent; font-size: 16px; line-height: 1.45; }
.thai-secondary-prizes .thai-prize-numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-width: 0; margin-top: 28px; padding: 14px 8px; background: var(--thai-strip); }
.thai-secondary-prizes .thai-prize-numbers span { min-width: 0; color: var(--thai-number); font-family: "DM Mono", monospace; font-size: 22px; font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.thai-prize-numbers em { color: #888; font-size: 14px; font-style: normal; }
@media (max-width: 700px) {
  .thai-lottery-page { padding-inline: 12px; }
  .thai-result-head { padding: 14px 38px 26px; }
  .thai-result-kicker { font-size: 25px; }
  .thai-result-head h2 { font-size: 22px; }
  .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .thai-primary-grid .thai-prize { min-height: 132px; }
  .thai-primary-grid .thai-prize-label { font-size: 17px; }
  .thai-primary-grid .thai-prize-numbers span, .thai-primary-grid .thai-prize-first .thai-prize-numbers span { font-size: 32px; }
  .thai-near-prize { margin-bottom: 34px; }
  .thai-near-prize .thai-prize { grid-template-columns: 1fr; gap: 10px; }
  .thai-near-prize .thai-prize-label, .thai-near-prize .thai-prize-note, .thai-near-prize .thai-prize-numbers { grid-column: 1; grid-row: auto; }
  .thai-near-prize .thai-prize-label { text-align: center; }
  .thai-near-prize .thai-prize-note { width: fit-content; margin: 0 auto; }
  .thai-near-prize .thai-prize-numbers { width: 100%; margin-top: 8px; }
  .thai-near-prize .thai-prize-numbers span { font-size: 28px; }
  .thai-secondary-prizes { gap: 38px; padding-inline: 0; }
  .thai-secondary-prizes .thai-prize-label { font-size: 18px; }
  .thai-secondary-prizes .thai-prize-note { font-size: 14px; }
  .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
  .thai-secondary-prizes .thai-prize-numbers span { padding-block: 2px; font-size: 19px; }
}
@media print {
  .thai-lottery-page { padding: 0; }
  .thai-result-grid { gap: 18px; }
  .thai-result-card { padding-bottom: 18px; }
  .thai-result-head { padding-top: 0; }
}
*/

/* Final cascade after legacy comments and theme blocks. */
.topbar, .main-nav, .category-nav { min-width: 0; }
.category-nav { overflow-x: auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }
.main-nav a[aria-current="false"] { color: #8491a0; font-weight: 600; }
.section-wrap { width: min(1170px, calc(100% - 48px)); }
.draw-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.draw-card, .card-head, .card-foot, .main-number, .history-table-wrap, .article-item { min-width: 0; }
.card-head { gap: 12px; }
.card-head h3, .card-head small, .card-foot strong { overflow-wrap: anywhere; }
.main-number { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.number-ball { flex: 0 0 auto; }
.history-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 290px); gap: 24px; align-items: stretch; }
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; min-width: 720px; table-layout: fixed; }
.history-table td .main-number { gap: 5px; }
.history-table .number-ball { width: 30px; height: 30px; font-size: 12px; }
.article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.article-item { margin: 0; overflow-wrap: anywhere; }

.seo-page.thai-lottery-page { min-height: 100vh; padding: 0 20px 56px; background: #fff; color: #111; font-family: "Noto Sans Thai", "Noto Sans SC", sans-serif; }
.thai-lottery-page .seo-page-inner { width: min(100%, 1120px); max-width: 1120px; margin: 0 auto; }
.thai-lottery-page .back-link, .thai-lottery-page .thai-page-heading { display: none; }
.thai-lottery-page .lottery-page-layout { display: block !important; }
.thai-lottery-page .thai-sheet-layout > .thai-result-grid, .thai-lottery-page .thai-sheet-layout > .thai-query-wrap { width: 100%; }
.thai-lottery-page .thai-query-wrap { margin-top: 38px; }
.thai-lottery-page .thai-query-wrap .lottery-query-panel { position: static; width: 100%; }
.thai-lottery-page .thai-result-grid { display: grid; gap: 42px; min-width: 0; margin: 0; }
.thai-lottery-page .thai-result-card { min-width: 0; padding: 0 0 38px; border: 0; border-bottom: 1px solid #d7d7d7; border-radius: 0; background: transparent; box-shadow: none; }
.thai-lottery-page .thai-result-head { position: relative; display: block; min-height: 0; padding: 16px 48px 34px; text-align: center; }
.thai-lottery-page .thai-result-kicker { margin: 0 0 4px; color: #050505; font-size: 31px; font-weight: 800; line-height: 1.2; }
.thai-lottery-page .thai-result-head h2 { margin: 0; color: #20b675; font-size: 27px; font-weight: 700; line-height: 1.35; }
.thai-lottery-page .thai-primary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0 2px; background: #fff; }
.thai-lottery-page .thai-primary-grid .thai-prize { display: flex; flex-direction: column; min-width: 0; min-height: 150px; padding: 0; border: 0; background: #f5f5f5; text-align: center; }
.thai-lottery-page .thai-primary-grid .thai-prize-label { order: 1; margin: 0; padding: 10px 5px; color: #fff; background: #20b675; font-size: 20px; font-weight: 700; line-height: 1.25; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers { order: 2; display: flex; flex: 1; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 18px; min-width: 0; padding: 8px 10px; }
.thai-lottery-page .thai-primary-grid .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 42px; font-weight: 700; line-height: 1; }
.thai-lottery-page .thai-near-prize { margin: 2px 0 28px; padding: 20px 5px 24px; border-bottom: 1px solid #d0d0d0; }
.thai-lottery-page .thai-near-prize .thai-prize { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 0; border: 0; background: transparent; }
.thai-lottery-page .thai-near-prize .thai-prize-label { grid-row: 1; margin: 0; color: #111; font-size: 19px; font-weight: 800; text-align: left; }
.thai-lottery-page .thai-near-prize .thai-prize-note { grid-column: 1; grid-row: 2; margin: -12px 0 0; padding: 10px 8px; color: #222; background: #e9e9e9; font-size: 13px; text-align: center; }
.thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 2 / -1; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.thai-lottery-page .thai-near-prize .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 34px; font-weight: 700; text-align: center; }
.thai-lottery-page .thai-secondary-prizes { display: grid; gap: 48px; padding: 8px 8px 0; }
.thai-lottery-page .thai-secondary-prizes .thai-prize { min-width: 0; padding: 0; border: 0; background: transparent; text-align: center; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-label { display: inline; margin: 0; color: #111; font-size: 20px; font-weight: 800; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-note { display: inline; margin-left: 7px; padding: 0; color: #09af6c; background: transparent; font-size: 16px; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-width: 0; margin-top: 28px; padding: 14px 8px; background: #f5f5f5; }
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { min-width: 0; color: #626466; font-family: "DM Mono", monospace; font-size: 22px; font-weight: 700; line-height: 1.45; }
@media (max-width: 850px) {
  .section-wrap { width: min(92vw, 680px); }
  .draw-cards, .history-layout, .article-grid { grid-template-columns: 1fr; }
  .home-lottery-card { min-height: 0; }
  .thai-lottery-page .lottery-page-layout { grid-template-columns: 1fr; }
  .thai-lottery-page .lottery-query-panel { order: -1; position: static; width: 100%; }
}
@media (max-width: 700px) {
  .topbar { height: auto; min-height: 65px; padding-block: 12px; align-items: flex-start; }
  .main-nav { max-width: calc(100% - 48px); overflow: hidden; }
  .category-nav { gap: 17px; }
  .section-wrap { width: 90vw; }
  .history-table-wrap { padding-inline: 12px; }
  .thai-lottery-page { padding-inline: 12px; }
  .thai-lottery-page .thai-result-head { padding: 14px 38px 26px; }
  .thai-lottery-page .thai-result-kicker { font-size: 25px; }
  .thai-lottery-page .thai-result-head h2 { font-size: 22px; }
  .thai-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .thai-lottery-page .thai-primary-grid .thai-prize { min-height: 132px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-label { font-size: 17px; }
  .thai-lottery-page .thai-primary-grid .thai-prize-numbers span { font-size: 32px; }
  .thai-lottery-page .thai-near-prize .thai-prize { grid-template-columns: 1fr; gap: 10px; }
  .thai-lottery-page .thai-near-prize .thai-prize-label, .thai-lottery-page .thai-near-prize .thai-prize-note, .thai-lottery-page .thai-near-prize .thai-prize-numbers { grid-column: 1; grid-row: auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-label { text-align: center; }
  .thai-lottery-page .thai-near-prize .thai-prize-note { width: fit-content; margin: 0 auto; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers { width: 100%; margin-top: 8px; }
  .thai-lottery-page .thai-near-prize .thai-prize-numbers span { font-size: 28px; }
  .thai-lottery-page .thai-secondary-prizes { gap: 38px; padding-inline: 0; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-label { font-size: 18px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span { padding-block: 2px; font-size: 19px; }
}

/* EOF Thailand checker layout override */
.thai-lottery-page .lottery-page-layout.thai-sheet-layout { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); align-items: start; gap: 42px; }
.thai-lottery-page .thai-sheet-layout > .thai-result-grid { grid-column: 1; width: 100%; min-width: 0; }
.thai-lottery-page .thai-sheet-layout > .thai-query-wrap { grid-column: 2; width: 100%; min-width: 0; margin-top: 0; }
.thai-lottery-page .thai-query-wrap .lottery-query-panel { position: sticky; top: 102px; width: 100%; }
@media (max-width: 850px) {
  .thai-lottery-page .lottery-page-layout.thai-sheet-layout { display: grid !important; grid-template-columns: 1fr; gap: 0; }
  .thai-lottery-page .thai-sheet-layout > .thai-result-grid, .thai-lottery-page .thai-sheet-layout > .thai-query-wrap { grid-column: 1; }
  .thai-lottery-page .thai-sheet-layout > .thai-query-wrap { margin-top: 38px; }
  .thai-lottery-page .thai-query-wrap .lottery-query-panel { position: static; }
}

/* Public homepage portal layout. */
body.thai-home-active { background: #f4f1ea; color: #202522; }
body.thai-home-active .topbar { position: sticky; top: 0; z-index: 5; background: rgba(244, 241, 234, .94); }
body.thai-home-active .brand-mark { background: #c74635; }
.thai-home { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 56px 0 0; }
.thai-home-results { padding: 0; }
.thai-home-heading { max-width: 720px; padding: 20px 0 46px; text-align: left; }
.thai-home-kicker, .thai-section-kicker { margin: 0; color: #c74635; font: 500 11px/1.4 "DM Mono", monospace; letter-spacing: 1.5px; }
.thai-home-kicker span { color: #bc9a52; padding: 0 5px; }
.thai-home-heading h1 { margin: 15px 0 12px; color: #202522; font: 800 clamp(38px, 6vw, 72px)/1.04 "Playfair Display", serif; letter-spacing: 0; }
.thai-home-date { margin: 0; color: #168b84; font: 500 13px/1.5 "DM Mono", monospace; letter-spacing: .4px; }
.thai-home-intro { max-width: 520px; margin: 19px 0 0; color: #6f756f; font-size: 15px; line-height: 1.85; }
.thai-home .thai-result-board { display: grid; grid-template-columns: 1fr; gap: 22px; }
.thai-home-lottery-section { min-width: 0; padding: 0 0 21px; border: 1px solid #d9d3c6; background: #fffdf7; box-shadow: 0 12px 28px rgba(32, 36, 28, .05); }
.thai-home-lottery-section > header { min-height: 126px; padding: 22px 23px 18px; border-bottom: 1px solid #e4ded2; text-align: left; }
.thai-home-lottery-section > header p { margin: 0 0 9px; color: #c74635; font: 500 10px/1.3 "DM Mono", monospace; letter-spacing: 1.2px; text-transform: uppercase; }
.thai-home-lottery-section > header h2 { margin: 0; color: #202522; font-size: 22px; line-height: 1.25; }
.thai-home-lottery-section > header time { display: block; margin-top: 9px; color: #7a8079; font: 11px/1.4 "DM Mono", monospace; }
.thai-home .thai-home-table-scroll { overflow-x: auto; padding: 18px 15px 0; }
.thai-home .thai-home-table { min-width: 360px; }
.thai-home .thai-result-head, .thai-home .thai-result-numbers { gap: 3px; }
.thai-home .thai-result-head > div { min-height: 47px; padding: 7px 3px; color: #fffdf7; background: #168b84; font-size: 13px; }
.thai-home .thai-result-cell { min-height: 93px; background: #f1eee7; }
.thai-home .thai-result-cell strong { min-height: 57px; gap: 6px; padding: 7px 3px; color: #3e4741; font: 700 clamp(21px, 2.5vw, 29px)/1 "DM Mono", monospace; }
.thai-home .thai-result-cell small { min-height: 36px; padding: 7px 2px; color: #6d716d; background: #e6e1d7; font-size: 10px; }
.thai-home .thai-outline-link { margin: 18px 15px 0; padding: 10px 12px; border-color: #c74635; color: #c74635; font-size: 12px; font-weight: 700; }
.thai-home .thai-outline-link:hover { background: #c74635; }
.thai-section-heading { max-width: 660px; margin-bottom: 28px; }
.thai-section-heading h2 { margin: 8px 0 7px; color: #202522; font: 700 clamp(29px, 4vw, 43px)/1.1 "Playfair Display", serif; }
.thai-section-heading > p:last-child { margin: 0; color: #777d76; font-size: 14px; line-height: 1.7; }
.thai-home-history { padding: 105px 0 0; }
.thai-history-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 38px; padding: 0; border-top: 1px solid #d9d3c6; }
.thai-history-group { min-width: 0; padding: 22px 0 17px; border-bottom: 1px solid #d9d3c6; }
.thai-history-group h3 { margin: 0 0 15px; color: #168b84; font-size: 18px; }
.thai-history-group a, .thai-history-group > span { margin: 0 0 9px; padding-left: 0; color: #555c56; font: 12px/1.45 "DM Mono", monospace; }
.thai-history-group a::before, .thai-history-links a::before { display: none; }
.thai-history-group a:hover { color: #c74635; }
.thai-history-group .thai-history-all { display: flex; justify-content: space-between; margin-top: 17px; padding-top: 12px; border-top: 1px solid #e5e0d6; color: #c74635; font-family: "Noto Sans SC", sans-serif; font-weight: 700; }
.thai-history-all span { font-size: 17px; line-height: 12px; }
.thai-home-news { padding: 105px 0 0; }
.thai-news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; border-top: 1px solid #d9d3c6; }
.thai-news-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 15px; min-width: 0; padding: 21px 0; border-bottom: 1px solid #d9d3c6; }
.thai-news-index { color: #c74635; font: 500 12px/1.4 "DM Mono", monospace; }
.thai-news-copy small { color: #168b84; font: 500 10px/1.4 "DM Mono", monospace; letter-spacing: .8px; text-transform: uppercase; }
.thai-news-copy h3 { margin: 7px 0 0; color: #202522; font-size: 17px; line-height: 1.4; }
.thai-news-copy h3 a:hover { color: #c74635; }
.thai-news-copy p { margin: 8px 0 0; color: #777d76; font-size: 13px; line-height: 1.65; }
.thai-news-media { margin: 0 0 16px; overflow: hidden; background: linear-gradient(135deg, #d4d0c6, #8a9c91); }
.thai-home .thai-news-media img { display: block; width: 100%; height: 220px; object-fit: cover; }
.thai-news-featured { grid-column: 1 / -1; padding: 28px 0; }
.thai-news-featured .thai-news-copy h3 { font-size: 25px; }
.thai-news-featured .thai-news-media { margin-bottom: 19px; }
.thai-news-featured .thai-news-media img { height: 340px; }
.thai-home-guide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 70px; margin-top: 105px; padding: 42px 0 45px; border-top: 4px solid #202522; border-bottom: 1px solid #d9d3c6; }
.thai-guide-copy h2 { margin: 9px 0 11px; color: #202522; font: 700 clamp(28px, 4vw, 42px)/1.1 "Playfair Display", serif; }
.thai-guide-copy > p:last-child { max-width: 520px; margin: 0; color: #6f756f; font-size: 14px; line-height: 1.8; }
.thai-guide-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; align-items: end; margin: 0; padding: 0; list-style: none; }
.thai-guide-steps li { display: grid; gap: 14px; min-height: 112px; padding: 15px 12px; border-left: 1px solid #c74635; }
.thai-guide-steps strong { color: #c74635; font: 500 12px/1 "DM Mono", monospace; }
.thai-guide-steps span { align-self: end; color: #3f4741; font-size: 13px; line-height: 1.45; }
.thai-home-footer { display: flex; justify-content: space-between; gap: 24px; padding: 25px 0 31px; color: #858a82; font: 10px/1.5 "DM Mono", monospace; letter-spacing: .2px; }
.thai-home-legacy { display: none; }
.thai-ad { display: block; margin: 0 0 28px; overflow: hidden; border: 1px solid #d9d3c6; background: #fffdf7; }
.thai-ad img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.brand-mark .brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; transform: rotate(7deg); }
.thai-news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.thai-news-item, .thai-news-featured, .thai-news-item:not(.thai-news-featured) { grid-column: auto; grid-row: auto; }
.thai-news-featured .thai-news-copy h3 { font-size: 17px; }
.thai-news-featured .thai-news-media img { height: 220px; }
@media (max-width: 900px) {
  .thai-home { width: min(100% - 40px, 700px); }
  .thai-home .thai-result-board { grid-template-columns: 1fr; }
  .thai-home-lottery-section > header { min-height: 0; }
  .thai-home-guide { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 650px) {
  .thai-home { width: calc(100% - 32px); padding-top: 28px; }
  .thai-home-heading { padding: 13px 0 35px; }
  .thai-home-heading h1 { font-size: 42px; }
  .thai-home-intro { font-size: 14px; }
  .thai-home-history, .thai-home-news { padding-top: 72px; }
  .thai-history-links, .thai-news-grid { grid-template-columns: 1fr; }
  .thai-news-featured { grid-column: auto; }
  .thai-news-featured .thai-news-copy h3 { font-size: 20px; }
  .thai-home .thai-news-media img, .thai-news-featured .thai-news-media img { height: 220px; }
  .thai-home-guide { margin-top: 72px; padding-top: 31px; }
  .thai-guide-steps { gap: 7px; }
  .thai-guide-steps li { min-height: 96px; padding: 11px 8px; }
  .thai-guide-steps span { font-size: 12px; }
  .thai-home-footer { display: grid; gap: 6px; }
}

/* Scoped final fixes for the public homepage and Thailand lottery sheet only. */
body[data-page-template="home"],
body.thai-home-active {
  background: #f4f1ea;
  color: #202522;
}
body[data-page-template="home"] .grain,
body.thai-home-active .grain { display: none; }
body[data-page-template="home"] .thai-home,
body.thai-home-active .thai-home {
  width: min(1120px, calc(100vw - 48px));
  max-width: 1120px;
  margin-inline: auto !important;
  padding: clamp(34px, 4vw, 56px) 0 0;
  transform: none;
}
body[data-page-template="home"] .thai-home-heading,
body.thai-home-active .thai-home-heading {
  max-width: 760px;
  padding: 18px 0 44px;
}
body[data-page-template="home"] .thai-home-heading h1,
body.thai-home-active .thai-home-heading h1 {
  margin-block-start: 14px;
  overflow-wrap: anywhere;
}
body[data-page-template="home"] .thai-home .thai-result-board,
body.thai-home-active .thai-home .thai-result-board {
  width: 100%;
  min-width: 0;
  grid-template-columns: 1fr;
}
body[data-page-template="home"] .thai-home-lottery-section,
body.thai-home-active .thai-home-lottery-section,
body[data-page-template="home"] .thai-home-history,
body.thai-home-active .thai-home-history,
body[data-page-template="home"] .thai-home-news,
body.thai-home-active .thai-home-news,
body[data-page-template="home"] .thai-home-guide,
body.thai-home-active .thai-home-guide { min-width: 0; }
body[data-page-template="home"] .thai-home .thai-home-table-scroll,
body.thai-home-active .thai-home .thai-home-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
body[data-page-template="home"] .thai-home .thai-result-cell strong,
body.thai-home-active .thai-home .thai-result-cell strong,
body[data-page-template="home"] .thai-news-copy,
body.thai-home-active .thai-news-copy,
body[data-page-template="home"] .thai-news-copy h3,
body.thai-home-active .thai-news-copy h3,
body[data-page-template="home"] .thai-news-copy p,
body.thai-home-active .thai-news-copy p { overflow-wrap: anywhere; }

.seo-page.thai-lottery-page {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  padding: clamp(24px, 3.2vw, 42px) 20px 72px;
  overflow-x: clip;
}
.thai-lottery-page .seo-page-inner {
  width: min(1150px, calc(100vw - 48px));
  max-width: 1150px;
  margin-inline: auto !important;
  transform: none;
}
.thai-lottery-page .thai-sheet-title {
  padding: 8px 0 30px;
  border-bottom: 1px dashed #d6d6d6;
}
.thai-lottery-page .thai-sheet-title h1 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 43px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.thai-lottery-page .lottery-page-layout.thai-sheet-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 36px;
  align-items: start;
  width: 100%;
  min-width: 0;
}
.thai-lottery-page .thai-sheet-layout > .thai-result-grid,
.thai-lottery-page .thai-sheet-layout > .thai-query-wrap {
  min-width: 0;
  max-width: 100%;
}
.thai-lottery-page .thai-sheet-layout > .thai-result-grid {
  grid-column: 1;
  overflow: hidden;
}
.thai-lottery-page .thai-sheet-layout > .thai-query-wrap {
  grid-column: 2;
  width: 100%;
  margin-top: 0;
}
.thai-lottery-page .thai-query-wrap .lottery-query-panel {
  position: sticky;
  top: 98px;
  width: 100%;
  min-width: 0;
}
.thai-lottery-page .thai-result-card,
.thai-lottery-page .thai-primary-grid,
.thai-lottery-page .thai-near-prize,
.thai-lottery-page .thai-secondary-prizes,
.thai-lottery-page .thai-prize,
.thai-lottery-page .thai-prize-numbers {
  min-width: 0;
  max-width: 100%;
}
.thai-lottery-page .reveal {
  animation: none;
  opacity: 1;
  transform: none;
}
.thai-lottery-page .thai-prize-numbers {
  overflow: hidden;
}
.thai-lottery-page .thai-prize-numbers span,
.thai-lottery-page .thai-prize-numbers em {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span {
  line-height: 1.55;
}

@media (max-width: 980px) {
  .thai-lottery-page .lottery-page-layout.thai-sheet-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .thai-lottery-page .thai-sheet-layout > .thai-result-grid,
  .thai-lottery-page .thai-sheet-layout > .thai-query-wrap { grid-column: 1; }
  .thai-lottery-page .thai-query-wrap .lottery-query-panel { position: static; }
}

/* Laos/Hanoi use the same compact results sheet as Thailand. */
.seo-page.laos-lottery-page .seo-page-inner,
.seo-page.hanoi-lottery-page .seo-page-inner { width: min(1150px, calc(100vw - 48px)); max-width: 1150px; margin-inline: auto; }
.seo-page.laos-lottery-page .thai-sheet-title,
.seo-page.hanoi-lottery-page .thai-sheet-title { padding: 8px 0 30px; }
.seo-page.laos-lottery-page .lottery-page-layout,
.seo-page.hanoi-lottery-page .lottery-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 34px; align-items: start; }
.seo-page.laos-lottery-page .thai-query-wrap,
.seo-page.hanoi-lottery-page .thai-query-wrap { min-width: 0; }
.seo-page.laos-lottery-page .thai-query-wrap .lottery-query-panel,
.seo-page.hanoi-lottery-page .thai-query-wrap .lottery-query-panel { position: sticky; top: 98px; }
.seo-page.laos-lottery-page .thai-result-card,
.seo-page.hanoi-lottery-page .thai-result-card { padding-top: 38px; }
.seo-page.laos-lottery-page .thai-result-kicker,
.seo-page.hanoi-lottery-page .thai-result-kicker { font-size: clamp(22px, 2.7vw, 30px); }
.seo-page.laos-lottery-page .thai-primary-grid .thai-prize,
.seo-page.hanoi-lottery-page .thai-primary-grid .thai-prize { min-height: 145px; }
.seo-page.laos-lottery-page .thai-primary-grid .thai-prize-label,
.seo-page.hanoi-lottery-page .thai-primary-grid .thai-prize-label { overflow-wrap: anywhere; }
.seo-page.laos-lottery-page .thai-prize-label,
.seo-page.hanoi-lottery-page .thai-prize-label { color: #000; }
.seo-page.laos-lottery-page .thai-secondary-prizes,
.seo-page.hanoi-lottery-page .thai-secondary-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 30px 0 0; }
.seo-page.laos-lottery-page .thai-secondary-prizes .thai-prize,
.seo-page.hanoi-lottery-page .thai-secondary-prizes .thai-prize { background: #f7f7f7; padding: 0 0 12px; }
.lottery-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin: 28px 0 12px; }
.lottery-pagination a { min-width: 38px; padding: 9px 13px; border: 1px solid #d6d6d6; background: #fff; color: #4d5551; text-align: center; }
.lottery-pagination a:hover, .lottery-pagination a.active { border-color: #20b675; color: #fff; background: #20b675; }
.lottery-pagination-summary { color: #7d8179; font-size: 12px; }

/* Full draw pages keep the same hierarchy as the reference result sheet. */
.lottery-result-detail-page .seo-page-inner { width: min(1150px, calc(100vw - 48px)); max-width: 1150px; margin-inline: auto; }
.lottery-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 34px; align-items: start; margin-top: 28px; }
.lottery-detail-full { min-width: 0; }
.lottery-detail-prize { padding: 26px 10px; border-bottom: 1px solid #d4d4d4; text-align: center; }
.lottery-detail-prize h2 { margin: 0 0 17px; color: #151515; font-size: clamp(19px, 2.4vw, 28px); line-height: 1.35; }
.lottery-detail-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px clamp(22px, 4vw, 58px); padding: 20px 12px; background: #f7f7f7; }
.lottery-detail-numbers span { color: #5f6061; font-family: "DM Mono", monospace; font-size: clamp(24px, 3vw, 38px); font-weight: 700; line-height: 1.2; }
.lottery-detail-prize p { margin: 10px 0 0; color: #555; font-size: 13px; }
.lottery-detail-secondary { display: grid; gap: 30px; padding-top: 30px; }
.lottery-detail-secondary .lottery-detail-prize { padding: 0 10px 25px; }
.lottery-detail-query .lottery-query-panel { position: sticky; top: 98px; }

@media (max-width: 980px) {
  .seo-page.laos-lottery-page .lottery-page-layout,
  .seo-page.hanoi-lottery-page .lottery-page-layout,
  .lottery-detail-layout { grid-template-columns: 1fr; gap: 28px; }
  .seo-page.laos-lottery-page .thai-query-wrap .lottery-query-panel,
  .seo-page.hanoi-lottery-page .thai-query-wrap .lottery-query-panel,
  .lottery-detail-query .lottery-query-panel { position: static; }
}

@media (max-width: 650px) {
  .seo-page.laos-lottery-page .seo-page-inner,
  .seo-page.hanoi-lottery-page .seo-page-inner,
  .lottery-result-detail-page .seo-page-inner { width: calc(100vw - 24px); }
  .seo-page.laos-lottery-page .thai-primary-grid,
  .seo-page.hanoi-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-page.laos-lottery-page .thai-secondary-prizes,
  .seo-page.hanoi-lottery-page .thai-secondary-prizes { grid-template-columns: 1fr; }
  .lottery-detail-numbers { gap: 10px 22px; }
}

@media (max-width: 650px) {
  body[data-page-template="home"] .thai-home,
  body.thai-home-active .thai-home,
  .thai-lottery-page .seo-page-inner { width: calc(100vw - 32px); }
  body[data-page-template="home"] .thai-home-heading,
  body.thai-home-active .thai-home-heading { padding-top: 8px; }
  body[data-page-template="home"] .thai-home-heading h1,
  body.thai-home-active .thai-home-heading h1 { font-size: clamp(34px, 11vw, 42px); }
  body[data-page-template="home"] .thai-history-links,
  body.thai-home-active .thai-history-links,
  body[data-page-template="home"] .thai-news-grid,
  body.thai-home-active .thai-news-grid,
  body[data-page-template="home"] .thai-home-guide,
  body.thai-home-active .thai-home-guide { grid-template-columns: 1fr; }
  .seo-page.thai-lottery-page { padding: 20px 12px 52px; }
  .thai-lottery-page .thai-sheet-title { padding-top: 4px; }
  .thai-lottery-page .thai-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------------------- */
/* Kapook-inspired public lottery layouts                                     */
/* These rules are deliberately scoped to the two requested pages only.      */
/* -------------------------------------------------------------------------- */

body[data-page-template="home"] {
  --kapook-green: #16a968;
  --kapook-red: #e31d2d;
  --kapook-line: #e5e5e5;
  background: #f3f3f3;
  color: #333;
  font-family: Arial, "Noto Sans Thai", "Noto Sans SC", sans-serif;
}

body[data-page-template="home"] .grain,
body[data-page-template="home"] .sync-status {
  display: none;
}

body[data-page-template="home"] .topbar,
body.thai-home-active .topbar {
  position: relative;
  z-index: 5;
  min-height: 62px;
  height: auto;
  padding: 0 max(18px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid #dedede;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .025);
  backdrop-filter: none;
}

body[data-page-template="home"] .brand,
body.thai-home-active .brand {
  gap: 9px;
  min-height: 62px;
}

body[data-page-template="home"] .brand-mark,
body.thai-home-active .brand-mark {
  width: 35px;
  height: 35px;
  transform: none;
  border-radius: 3px;
  background: var(--kapook-red);
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
}

body[data-page-template="home"] .brand strong,
body.thai-home-active .brand strong {
  color: #e31d2d;
  font-size: 18px;
  letter-spacing: 0;
}

body[data-page-template="home"] .brand small,
body.thai-home-active .brand small {
  margin-top: 2px;
  color: #929292;
  font: 9px Arial, sans-serif;
  letter-spacing: .6px;
}

body[data-page-template="home"] .main-nav,
body.thai-home-active .main-nav {
  gap: 0;
  align-items: stretch;
}

body[data-page-template="home"] .main-nav > a,
body.thai-home-active .main-nav > a,
body[data-page-template="home"] .category-nav a,
body.thai-home-active .category-nav a {
  padding: 0 15px;
  color: #555;
  font-size: 14px;
  font-weight: 400;
}

body[data-page-template="home"] .main-nav a.active,
body[data-page-template="home"] .main-nav a:hover,
body.thai-home-active .main-nav a.active,
body.thai-home-active .main-nav a:hover,
body[data-page-template="home"] .category-nav a:hover,
body.thai-home-active .category-nav a:hover {
  color: var(--kapook-red);
  font-weight: 700;
}

body[data-page-template="home"] .main-nav a.active::after,
body.thai-home-active .main-nav a.active::after,
body[data-page-template="home"] .category-nav a.active::after,
body.thai-home-active .category-nav a.active::after {
  right: 10px;
  left: 10px;
  bottom: 0;
  height: 3px;
  background: var(--kapook-red);
}

body[data-page-template="home"] .nav-divider,
body.thai-home-active .nav-divider {
  margin: 19px 0;
  background: #e1e1e1;
}

body[data-page-template="home"] .thai-home {
  width: min(1100px, calc(100% - 32px));
  padding: 0 0 58px;
}

body[data-page-template="home"] .thai-home-results {
  margin-top: 18px;
  padding: 0;
}

body[data-page-template="home"] .thai-home-heading {
  padding: 18px 0 16px;
  text-align: left;
}

body[data-page-template="home"] .thai-home-kicker {
  margin: 0 0 5px;
  color: #888;
  font-size: 12px;
  letter-spacing: .2px;
}

body[data-page-template="home"] .thai-home-heading h1 {
  display: inline-block;
  margin: 0;
  padding-left: 11px;
  border-left: 5px solid var(--kapook-red);
  color: #333;
  font-size: clamp(26px, 3.3vw, 36px);
  font-weight: 700;
  line-height: 1.25;
}

body[data-page-template="home"] .thai-home-date {
  margin: 9px 0 0 16px;
  color: var(--kapook-green) !important;
  font-size: 17px !important;
  font-weight: 700;
}

body[data-page-template="home"] .thai-home-intro {
  max-width: 760px;
  margin: 6px 0 0 16px !important;
  color: #777 !important;
  font-size: 13px !important;
  line-height: 1.55;
}

body[data-page-template="home"] .home-ad-slot {
  min-height: 0;
  margin: 0 0 18px;
}

body[data-page-template="home"] .public-ad {
  margin: 0;
  padding: 0;
  border: 0;
  background: #e9e9e9;
  text-align: center;
}

body[data-page-template="home"] .public-ad img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}

body[data-page-template="home"] .home-result-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

body[data-page-template="home"] .thai-home-lottery-section {
  min-width: 0;
  padding: 0 0 14px;
  border: 1px solid #ddd;
  border-bottom: 3px solid var(--kapook-green);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .035);
}

body[data-page-template="home"] .thai-home-lottery-section > header {
  min-height: 86px;
  padding: 14px 15px 11px;
  border-bottom: 1px solid #ededed;
  background: #fff;
  text-align: left;
}

body[data-page-template="home"] .thai-home-lottery-section > header p {
  margin: 0 0 3px;
  color: #999;
  font-size: 11px;
  text-transform: uppercase;
}

body[data-page-template="home"] .thai-home-lottery-section > header h2 {
  margin: 0;
  color: #333;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

body[data-page-template="home"] .thai-home-lottery-section > header time {
  display: block;
  margin-top: 4px;
  color: var(--kapook-green);
  font-size: 12px;
}

body[data-page-template="home"] .thai-home-table-scroll {
  overflow: visible;
}

body[data-page-template="home"] .thai-home-table {
  min-width: 0;
  padding: 12px 12px 0;
}

body[data-page-template="home"] .thai-home .thai-result-head,
body[data-page-template="home"] .thai-home .thai-result-numbers {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
}

body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] .thai-home-table-scroll {
  overflow-x: auto;
}

body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] .thai-home-table {
  min-width: 560px;
}

body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] .thai-result-head,
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] .thai-result-numbers {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body[data-page-template="home"] .thai-home .thai-result-head > div {
  min-height: 54px;
  padding: 6px 3px;
  color: #fff;
  background: var(--kapook-green);
  font-size: 12px;
  line-height: 1.25;
}

body[data-page-template="home"] .thai-home .thai-result-cell {
  min-height: 92px;
  background: #f6f6f6;
}

body[data-page-template="home"] .thai-home .thai-result-cell strong {
  min-height: 56px;
  gap: 4px;
  padding: 6px 2px;
  color: #555;
  font: 700 clamp(17px, 2.1vw, 25px)/1 Arial, sans-serif;
}

body[data-page-template="home"] .thai-home .thai-result-cell small {
  min-height: 36px;
  padding: 5px 2px;
  color: #777;
  background: #e9e9e9;
  font-size: 10px;
}

body[data-page-template="home"] .thai-home-lottery-section > .thai-outline-link {
  width: calc(100% - 24px);
  margin: 12px auto 0;
  padding: 7px 10px;
  border: 1px solid var(--kapook-green);
  border-radius: 2px;
  color: var(--kapook-green);
  font-size: 13px;
}

body[data-page-template="home"] .thai-home-lottery-section > .thai-outline-link:hover {
  color: #fff;
  background: var(--kapook-green);
}

body[data-page-template="home"] .thai-home-history,
body[data-page-template="home"] .thai-home-news,
body[data-page-template="home"] .thai-home-guide {
  margin-top: 28px;
  padding: 22px 24px 26px;
  border: 1px solid #ddd;
  background: #fff;
}

body[data-page-template="home"] .thai-section-heading {
  margin-bottom: 18px;
  padding-bottom: 11px;
  border-bottom: 2px solid var(--kapook-green);
}

body[data-page-template="home"] .thai-section-heading .thai-section-kicker,
body[data-page-template="home"] .thai-guide-copy .thai-section-kicker {
  margin: 0 0 3px;
  color: #999;
  font-size: 11px;
  letter-spacing: .3px;
}

body[data-page-template="home"] .thai-home-history h2,
body[data-page-template="home"] .thai-home-news h2,
body[data-page-template="home"] .thai-home-guide h2 {
  margin: 0;
  color: #333;
  font-size: 25px;
  font-weight: 700;
  text-align: left;
}

body[data-page-template="home"] .thai-section-heading > p:last-child {
  margin: 6px 0 0;
  color: #888;
  font-size: 13px;
}

body[data-page-template="home"] .thai-history-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
}

body[data-page-template="home"] .thai-history-group {
  padding: 13px 15px 11px;
  border: 1px solid #e5e5e5;
  background: #fafafa;
}

body[data-page-template="home"] .thai-history-group h3 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
  color: var(--kapook-green);
  font-size: 16px;
}

body[data-page-template="home"] .thai-history-group a,
body[data-page-template="home"] .thai-history-group > span {
  margin: 0 0 7px;
  color: #555;
  font-size: 13px;
}

body[data-page-template="home"] .thai-history-group a::before {
  border-color: transparent transparent transparent var(--kapook-green);
}

body[data-page-template="home"] .thai-history-all {
  display: block;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid #e5e5e5;
  color: var(--kapook-red) !important;
  font-weight: 700;
}

body[data-page-template="home"] .thai-news-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px 26px;
}

body[data-page-template="home"] .thai-news-item {
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 13px;
  padding-bottom: 17px;
  border-bottom: 1px solid #e7e7e7;
}

body[data-page-template="home"] .thai-news-item img,
body[data-page-template="home"] .thai-news-featured img {
  width: 145px;
  height: 108px;
  border-radius: 2px;
}

body[data-page-template="home"] .thai-news-featured .thai-news-copy {
  padding-top: 0;
}

body[data-page-template="home"] .thai-news-copy small {
  display: block;
  margin-bottom: 4px;
  color: var(--kapook-green);
  font-size: 11px;
}

body[data-page-template="home"] .thai-news-copy h3 {
  font-size: 15px;
  line-height: 1.4;
}

body[data-page-template="home"] .thai-news-copy p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: #888;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

body[data-page-template="home"] .thai-home-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 30px;
  align-items: center;
}

body[data-page-template="home"] .thai-guide-copy p:not(.thai-section-kicker) {
  max-width: 630px;
  margin: 9px 0 0;
  color: #777;
  font-size: 13px;
  line-height: 1.7;
}

body[data-page-template="home"] .thai-guide-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-page-template="home"] .thai-guide-steps li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  border-left: 3px solid var(--kapook-red);
  background: #f6f6f6;
  color: #555;
  font-size: 13px;
}

body[data-page-template="home"] .thai-guide-steps strong {
  color: var(--kapook-red);
  font: 700 15px Arial, sans-serif;
}

body[data-page-template="home"] .thai-home-footer,
body.thai-home-active .thai-home-footer {
  width: 100%;
  min-height: 54px;
  padding: 18px max(18px, calc((100vw - 1100px) / 2));
  border-top: 1px solid #dedede;
  background: #fff;
  color: #999;
  font-size: 11px;
}

/* Thailand results page: the target keeps a white article sheet, green prize */
/* bars, light-gray number cells and a compact checker column. */
body.thai-lottery-active {
  --thai-kapook-green: #20b675;
  --thai-kapook-red: #e31d2d;
  background: #f1f1f1;
  color: #333;
  font-family: Arial, "Noto Sans Thai", "Noto Sans SC", sans-serif;
}

body.thai-lottery-active .grain,
body.thai-lottery-active .sync-status {
  display: none;
}

body.thai-lottery-active .topbar {
  position: relative;
  height: 62px;
  padding: 0 max(18px, calc((100vw - 1100px) / 2));
  background: #fff;
  backdrop-filter: none;
}

body[data-page-template="lottery-category"] .thai-lottery-page {
  min-height: calc(100vh - 62px);
  padding: 0 16px 58px;
  background: #fff;
}

body[data-page-template="lottery-category"] .thai-lottery-page .seo-page-inner {
  width: min(1100px, 100%);
  max-width: 1100px;
  margin: 0 auto;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-sheet-title {
  padding: 28px 0 19px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-sheet-title h1 {
  padding-left: 12px;
  border-left: 5px solid var(--thai-kapook-red);
  color: #333;
  font-size: clamp(26px, 3.2vw, 35px);
  line-height: 1.25;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-sheet-layout {
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 30px;
  margin-top: 24px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-results {
  gap: 28px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-result-card {
  padding: 0 0 28px;
  border-bottom: 1px solid #d5d5d5;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-result-head {
  padding: 5px 0 22px;
  text-align: left;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-result-kicker {
  margin: 0 0 2px;
  color: #333;
  font-size: 25px;
  line-height: 1.25;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-result-head h2 {
  color: var(--thai-kapook-green);
  font-size: 20px;
  line-height: 1.35;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 0;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize {
  min-height: 141px;
  background: #f6f6f6;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-label {
  min-height: 48px;
  padding: 8px 4px;
  background: var(--thai-kapook-green);
  font-size: 16px;
  line-height: 1.2;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-numbers {
  padding: 8px 4px;
  background: #f6f6f6;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-numbers span {
  color: #5c5e60;
  font-size: clamp(26px, 3.1vw, 39px);
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-note {
  min-height: 34px;
  padding: 7px 3px 5px;
  background: #e8e8e8;
  font-size: 11px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize {
  margin: 0;
  padding: 18px 4px 23px;
  border-bottom: 1px solid #d3d3d3;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize {
  grid-template-columns: minmax(180px, .8fr) repeat(2, minmax(0, 1fr));
  gap: 15px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-label {
  color: #333;
  font-size: 16px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-note {
  padding: 8px 5px;
  background: #e9e9e9;
  font-size: 11px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-numbers {
  gap: 10px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-numbers span {
  color: #5c5e60;
  font-size: clamp(25px, 2.8vw, 34px);
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes {
  gap: 30px;
  padding: 22px 4px 0;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes .thai-prize-label {
  font-size: 17px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes .thai-prize-note {
  color: var(--thai-kapook-green);
  font-size: 13px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers {
  margin-top: 16px;
  padding: 10px 7px;
  background: #f6f6f6;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers span {
  color: #626466;
  font-size: clamp(15px, 1.55vw, 20px);
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar {
  margin: 0;
  position: sticky;
  top: 18px;
  align-self: start;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-panel {
  position: static;
  padding: 19px 17px 17px;
  border: 1px solid #ddd;
  border-top: 4px solid var(--thai-kapook-red);
  border-radius: 2px;
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-kicker {
  color: var(--thai-kapook-red);
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-panel h2 {
  margin: 12px 0 6px;
  color: #333;
  font-size: 23px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-intro,
body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-help {
  color: #777;
  font-size: 12px;
  line-height: 1.65;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-form input,
body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  background: #fff;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-form input {
  color: #555;
  font-size: 19px;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .query-submit {
  min-height: 40px;
  border-radius: 2px;
  background: var(--thai-kapook-red);
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-result {
  margin-top: 15px;
  padding: 11px;
  border-top: 2px solid var(--thai-kapook-green);
  background: #f0f0f0;
}

body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-rules {
  margin-top: 17px;
  padding-top: 13px;
}

@media (max-width: 900px) {
  body[data-page-template="home"] .home-result-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page-template="home"] .thai-history-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-sheet-layout {
    grid-template-columns: minmax(0, 1fr) 270px !important;
    gap: 20px;
  }
}

@media (max-width: 700px) {
  body[data-page-template="home"] .topbar,
  body.thai-home-active .topbar,
  body.thai-lottery-active .topbar {
    min-height: 58px;
    padding: 0 12px;
  }

  body[data-page-template="home"] .brand,
  body.thai-home-active .brand {
    min-height: 58px;
  }

  body[data-page-template="home"] .brand strong,
  body.thai-home-active .brand strong {
    font-size: 15px;
  }

  body[data-page-template="home"] .main-nav > a,
  body.thai-home-active .main-nav > a,
  body[data-page-template="home"] .category-nav a,
  body.thai-home-active .category-nav a {
    padding: 0 9px;
    font-size: 12px;
  }

  body[data-page-template="home"] .thai-home {
    width: calc(100% - 24px);
    padding-bottom: 30px;
  }

  body[data-page-template="home"] .home-result-list,
  body[data-page-template="home"] .thai-history-links,
  body[data-page-template="home"] .thai-news-grid,
  body[data-page-template="home"] .thai-home-guide {
    grid-template-columns: 1fr;
  }

  body[data-page-template="home"] .thai-home-history,
  body[data-page-template="home"] .thai-home-news,
  body[data-page-template="home"] .thai-home-guide {
    padding: 18px 14px 20px;
  }

  body[data-page-template="home"] .thai-news-item {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  body[data-page-template="home"] .thai-news-item img,
  body[data-page-template="home"] .thai-news-featured img {
    width: 118px;
    height: 88px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page {
    padding: 0 12px 40px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-sheet-title {
    padding: 20px 0 15px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-sheet-layout {
    display: flex !important;
    flex-direction: column;
    gap: 22px;
    margin-top: 18px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar {
    order: -1;
    width: 100%;
    position: static;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-kapook-sidebar .lottery-query-panel {
    position: static;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-result-kicker {
    font-size: 22px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-result-head h2 {
    font-size: 18px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize {
    min-height: 126px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-label {
    min-height: 44px;
    font-size: 15px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-numbers span {
    font-size: clamp(24px, 8vw, 34px);
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-label,
  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-note,
  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-numbers {
    grid-column: 1;
    grid-row: auto;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-label {
    text-align: center;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-note {
    width: fit-content;
    margin: 0 auto;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-near-prize .thai-prize-numbers {
    width: 100%;
    margin-top: 4px;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes {
    gap: 25px;
    padding: 20px 0 0;
  }

  body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Final public-header cascade: keep legacy page themes from changing the shared header. */
body[data-page-template] .topbar {
  height: 80px;
  padding: 0 max(18px, calc((100vw - 1250px) / 2));
  background: #fff;
  position: relative;
  box-shadow: 0 3px 14px rgba(17, 38, 63, .06);
  backdrop-filter: none;
}
body[data-page-template] .main-nav { gap: 30px; }
body[data-page-template] .category-nav { gap: 30px; }
body[data-page-template] .main-nav a.active::after { height: 2px; background: #e33e37; }
body[data-page-template="lottery-category"] .laos-lottery-page .thai-prize-label,
body[data-page-template="lottery-category"] .hanoi-lottery-page .thai-prize-label { color: #000 !important; }
@media (max-width: 700px) {
  body[data-page-template] .topbar { height: auto; min-height: 58px; padding: 0 12px; }
  body[data-page-template] .main-nav { gap: 12px; }
  body[data-page-template] .category-nav { gap: 12px; }
}

/* Public color system: restrained tints separate data, archive and editorial areas. */
body[data-page-template] {
  --public-red: #d93d3d;
  --public-green: #159661;
  --public-gold: #9b6818;
  --public-teal: #187d83;
  --public-warm: #fff8e8;
  --public-mint: #edf8f2;
  --public-aqua: #edf7f7;
  --public-rose: #fff1ef;
}

body[data-page-template] .topbar {
  position: relative;
}
body[data-page-template] .topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--public-red) 0 34%, var(--public-gold) 34% 67%, var(--public-teal) 67%);
  pointer-events: none;
}

body[data-page-template] .category-nav a:nth-child(3n + 1):hover { color: var(--public-green); }
body[data-page-template] .category-nav a:nth-child(3n + 2):hover { color: var(--public-gold); }
body[data-page-template] .category-nav a:nth-child(3n):hover { color: var(--public-teal); }

/* Homepage: each result family and supporting section gets its own quiet color. */
body[data-page-template="home"] { background: #f4f5f1; }
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="thai-lottery"] {
  border-bottom-color: var(--public-green);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="thai-lottery"] > header,
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="thai-lottery"] .thai-result-cell {
  background: var(--public-mint);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] {
  border-bottom-color: var(--public-gold);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] > header,
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] .thai-result-cell {
  background: var(--public-warm);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] .thai-result-head > div {
  background: var(--public-gold);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] > .thai-outline-link {
  border-color: var(--public-gold);
  color: #9b6818;
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="laos-lottery"] > .thai-outline-link:hover {
  background: var(--public-gold);
  color: #fff;
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="hanoi-lottery"] {
  border-bottom-color: var(--public-teal);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="hanoi-lottery"] > header,
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="hanoi-lottery"] .thai-result-cell {
  background: var(--public-aqua);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="hanoi-lottery"] .thai-result-head > div {
  background: var(--public-teal);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="hanoi-lottery"] > .thai-outline-link {
  border-color: var(--public-teal);
  color: var(--public-teal);
}
body[data-page-template="home"] .thai-home-lottery-section[data-lottery-slug="hanoi-lottery"] > .thai-outline-link:hover {
  background: var(--public-teal);
  color: #fff;
}
body[data-page-template="home"] .thai-home-history { background: var(--public-warm); }
body[data-page-template="home"] .thai-home-history .thai-section-heading { border-bottom-color: var(--public-gold); }
body[data-page-template="home"] .thai-home-history .thai-section-kicker,
body[data-page-template="home"] .thai-home-history .thai-history-group h3 { color: #9b6818; }
body[data-page-template="home"] .thai-home-history .thai-history-group { background: rgba(255, 255, 255, .72); }
body[data-page-template="home"] .thai-home-news { background: var(--public-aqua); }
body[data-page-template="home"] .thai-home-news .thai-section-heading { border-bottom-color: var(--public-teal); }
body[data-page-template="home"] .thai-home-news .thai-section-kicker,
body[data-page-template="home"] .thai-home-news .thai-news-copy small { color: var(--public-teal); }
body[data-page-template="home"] .thai-home-guide { background: var(--public-rose); }
body[data-page-template="home"] .thai-home-guide .thai-section-kicker { color: var(--public-red); }
body[data-page-template="home"] .thai-home-guide .thai-guide-steps li { background: rgba(255, 255, 255, .68); }

/* Lottery pages inherit the country color without changing their result structure. */
body[data-page-template="lottery-category"] .thai-lottery-page { background: #f8fbf9; }
body[data-page-template="lottery-category"] .laos-lottery-page {
  --thai-kapook-green: #d09a36;
  --thai-kapook-red: #b54a3d;
  background: #fffaf0;
}
body[data-page-template="lottery-category"] .hanoi-lottery-page {
  --thai-kapook-green: var(--public-teal);
  --thai-kapook-red: #cc4c45;
  background: #f3fafa;
}
body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize,
body[data-page-template="lottery-category"] .thai-lottery-page .thai-primary-grid .thai-prize-numbers,
body[data-page-template="lottery-category"] .thai-lottery-page .thai-secondary-prizes .thai-prize-numbers {
  background: var(--public-mint);
}
body[data-page-template="lottery-category"] .laos-lottery-page .thai-primary-grid .thai-prize,
body[data-page-template="lottery-category"] .laos-lottery-page .thai-primary-grid .thai-prize-numbers,
body[data-page-template="lottery-category"] .laos-lottery-page .thai-secondary-prizes .thai-prize-numbers {
  background: var(--public-warm);
}
body[data-page-template="lottery-category"] .hanoi-lottery-page .thai-primary-grid .thai-prize,
body[data-page-template="lottery-category"] .hanoi-lottery-page .thai-primary-grid .thai-prize-numbers,
body[data-page-template="lottery-category"] .hanoi-lottery-page .thai-secondary-prizes .thai-prize-numbers {
  background: var(--public-aqua);
}
body[data-page-template="lottery-category"] .thai-kapook-sidebar .lottery-query-panel.red { background: var(--public-rose); }
body[data-page-template="lottery-category"] .thai-kapook-sidebar .lottery-query-panel.gold { background: var(--public-warm); }
body[data-page-template="lottery-category"] .thai-kapook-sidebar .lottery-query-panel.teal { background: var(--public-aqua); }

/* Editorial, generic category, detail and error pages share the same palette. */
body[data-page-template="news"] .seo-page,
body[data-page-template="category"] .seo-page,
body[data-page-template="web-source"] .seo-page { background: #f3f7f5; }
body[data-page-template="content"] .seo-page { background: #fffaf1; }
body[data-page-template="content"] .lottery-result-detail-page { background: #f4f8f6; }
body[data-page-template="error"] { background: var(--public-rose); }
body[data-page-template="news"] .public-article-card:nth-child(3n + 1),
body[data-page-template="category"] .public-article-card:nth-child(3n + 1) {
  border-top: 4px solid var(--public-green);
  background: var(--public-mint);
}
body[data-page-template="news"] .public-article-card:nth-child(3n + 2),
body[data-page-template="category"] .public-article-card:nth-child(3n + 2) {
  border-top: 4px solid var(--public-gold);
  background: var(--public-warm);
}
body[data-page-template="news"] .public-article-card:nth-child(3n),
body[data-page-template="category"] .public-article-card:nth-child(3n) {
  border-top: 4px solid var(--public-teal);
  background: var(--public-aqua);
}
body[data-page-template="content"] .content-meta,
body[data-page-template="content"] .lottery-result-detail-page .content-meta {
  border-color: #cfe2d8;
  background: var(--public-mint);
}
body[data-page-template="content"] .lottery-result-detail-page .lottery-detail-numbers { background: var(--public-aqua); }
body[data-page-template="content"] .lottery-result-detail-page .lottery-detail-prize:nth-child(even) .lottery-detail-numbers { background: var(--public-warm); }
body[data-page-template] .public-news-card:nth-child(3n + 1) { border-top: 3px solid var(--public-green); background: var(--public-mint); }
body[data-page-template] .public-news-card:nth-child(3n + 2) { border-top: 3px solid var(--public-gold); background: var(--public-warm); }
body[data-page-template] .public-news-card:nth-child(3n) { border-top: 3px solid var(--public-teal); background: var(--public-aqua); }
body[data-page-template="web-source"] .web-source-grid { border-top-color: var(--public-teal); background: var(--public-aqua); }
