.tg-insights{margin:22px 0;padding:24px;background:#fff;border:1px solid #dce7f6;border-radius:20px;color:#17365d;box-shadow:0 8px 25px #17365d07;font:16px/1.75 Arial,"Noto Sans Thai","Noto Sans KR",sans-serif;min-width:0}
.tg-insights *{box-sizing:border-box}.tg-heading{display:flex;justify-content:space-between;gap:16px;align-items:center}.tg-eyebrow{color:#6486ba;font-size:11px;font-weight:800;letter-spacing:1.4px}.tg-insights h2{font-size:25px!important;line-height:1.5;margin:6px 0;color:#173d72}.tg-insights h3{font-size:20px!important;line-height:1.5;margin:0 0 16px;color:#173d72}.tg-insights p{font-size:15px!important;line-height:1.8!important;color:#5a6f8d;margin:6px 0 16px}.tg-badge{padding:8px 14px;background:#edf4ff;color:#2463b8;border:1px solid #d8e7fc;border-radius:20px;white-space:nowrap;font-weight:800}
.tg-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end;padding:15px;background:#f6f9ff;border:1px solid #e1eaf8;border-radius:13px;margin:18px 0}.tg-filters label{display:grid;gap:6px;font-size:14px;font-weight:700}.tg-filters select,.tg-filters button{min-height:44px;border:1px solid #d4e1f4;border-radius:10px;padding:9px 14px;font:700 16px Arial,sans-serif;background:#fff;color:#234a7d}.tg-filters button{background:linear-gradient(135deg,#2379e3,#2856c5);border:0;color:#fff;cursor:pointer;box-shadow:0 4px 12px #245cb522}
.tg-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}.tg-kpis>div{min-width:0;border:1px solid #dce7f8;border-top:3px solid #3277d5;border-radius:14px;padding:16px;background:linear-gradient(130deg,#f2f7ff,#fff)}.tg-kpis small,.tg-kpis span{display:block;font-size:14px!important;color:#607797}.tg-kpis strong{display:block;font-size:25px;color:#2054a0;margin:6px 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.tg-kpis em{font-size:14px;font-style:normal;font-weight:500}
.tg-content{display:grid;grid-template-columns:1.3fr 1fr;gap:18px}.tg-chart-card,.tg-ideas{min-width:0;border:1px solid #e0e8f5;border-radius:16px;padding:20px}.tg-chart-layout{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:center}.tg-donut{position:relative;max-width:310px;width:100%;margin:auto;aspect-ratio:1}.tg-donut svg{width:100%;height:100%;display:block}.tg-donut-center{position:absolute;inset:30%;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.tg-donut-center strong{font-size:29px;color:#1f4f91;font-variant-numeric:tabular-nums}.tg-donut-center small{font-size:12px!important;line-height:1.5;color:#74839a}
.tg-legend{display:grid;grid-template-columns:1fr 1fr;gap:12px}.tg-legend>div{display:flex;gap:8px;align-items:center}.tg-digit{width:30px;height:30px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:var(--tg-color);color:#fff;font-size:16px;font-weight:800;box-shadow:0 3px 9px #18365f15}.tg-legend b{display:block;font-size:16px;font-variant-numeric:tabular-nums}.tg-legend small{display:block;font-size:12px!important;color:#71839c;line-height:1.4}.tg-insights .tg-caption{font-size:13px!important;margin-top:16px;color:#657891}.tg-idea-row{padding:13px 0;border-top:1px solid #e6edf8}.tg-idea-row h4{margin:0 0 9px;font-size:15px;color:#496183}.tg-number-list{display:flex;gap:9px;flex-wrap:wrap}.tg-number{font:800 23px/1.5 Arial,sans-serif;letter-spacing:2px;padding:7px 14px;border:1px solid #dbe6fa;border-radius:12px;color:#2458ae;background:linear-gradient(135deg,#edf3ff,#fff);font-variant-numeric:tabular-nums;box-shadow:0 4px 12px #2052a009}.tg-method{display:block;color:#70819a;font-size:13px!important;line-height:1.8;margin-top:13px}.tg-ai-link{display:inline-block;margin-top:12px;color:#2462bd;text-decoration:none;font-weight:750;font-size:14px}
.tg-insights .tg-history-title{margin-top:25px}.tg-history{overflow:auto;-webkit-overflow-scrolling:touch;border:1px solid #dce7f6;border-radius:14px}.tg-history table{width:100%;border-collapse:collapse;white-space:nowrap;font-variant-numeric:tabular-nums}.tg-history th{background:#edf3ff;color:#214777;font-size:14px!important}.tg-history td,.tg-history th{padding:13px 16px!important;border-bottom:1px solid #e5edf8;text-align:left;font-size:15px!important}.tg-history tr:last-child td{border-bottom:0}.tg-actual-list{display:flex;gap:7px}.tg-actual-list span{padding:4px 9px;border-radius:8px;color:#2456a1;background:#f0f5ff;font-weight:800;letter-spacing:1px}.tg-empty{padding:40px 10px;text-align:center}
@media(max-width:1100px){.tg-content{grid-template-columns:1fr 1fr}.tg-chart-layout{grid-template-columns:1fr}.tg-donut{max-width:240px}.tg-legend{grid-template-columns:repeat(5,1fr);gap:12px 7px}.tg-legend>div{flex-direction:column;gap:4px;text-align:center}.tg-legend b{font-size:14px}.tg-legend small{font-size:11px!important}}
@media(max-width:760px){.tg-insights{padding:18px 14px}.tg-insights h2{font-size:22px!important}.tg-heading{align-items:start}.tg-badge{font-size:13px;padding:7px 10px}.tg-content{grid-template-columns:1fr}.tg-kpis{grid-template-columns:1fr 1fr}.tg-kpis>div:last-child{grid-column:1/-1}.tg-kpis strong{font-size:22px}.tg-filters label{flex:1;min-width:125px}.tg-filters select{width:100%}.tg-filters button{flex:1}.tg-chart-card,.tg-ideas{padding:17px 14px}.tg-donut{max-width:260px}.tg-history table{min-width:650px}.tg-number{font-size:24px}.tg-heading p{font-size:14px!important}}

/* Match Thai prize grouping: 1 two-digit idea, 2 front and 2 last three-digit ideas. */
.tg-ideas .tg-idea-row{padding:0;overflow:hidden;border:1px solid #dce7f5;border-radius:12px;margin:14px 0;background:#f4f8ff}
.tg-ideas .tg-idea-row h4{margin:0;padding:8px 14px;text-align:center;color:#fff;background:linear-gradient(120deg,#2767ba,#3787ca);font-size:16px}
.tg-ideas .tg-idea-row:nth-of-type(2){background:#f1f8ed}
.tg-ideas .tg-idea-row:nth-of-type(3){background:#fffae9}
.tg-ideas .tg-number-list{display:flex;gap:0;flex-wrap:nowrap;justify-content:center;padding:14px 10px}
.tg-ideas .tg-number-list>.tg-number{flex:1;max-width:50%;border:0;border-radius:0;background:none;box-shadow:none;text-align:center;font-size:30px;letter-spacing:3px;color:#2054a0;padding:8px 12px}
.tg-ideas .tg-number-list>.tg-number+.tg-number{border-left:1px solid #ccdaed}

/* Natural chart height; align the actual winning-number columns. */
.tg-content{align-items:start}
.tg-chart-card{align-self:start;height:auto;min-height:0}
.tg-chart-card>.tg-caption:last-child{margin-bottom:0}
.tg-history table{table-layout:fixed;width:100%}
.tg-history th:nth-child(1){width:23%}
.tg-history th:nth-child(2){width:15%}
.tg-history th:nth-child(3){width:14%}
.tg-history th:nth-child(4),.tg-history th:nth-child(5){width:24%}
.tg-history th:nth-child(n+3),.tg-history td:nth-child(n+3){text-align:center}
.tg-history .tg-actual-list{display:grid;grid-template-columns:repeat(2,58px);gap:10px;justify-content:center;align-items:center}
.tg-history td:nth-child(3) .tg-actual-list{grid-template-columns:58px}
.tg-history .tg-actual-list span{display:block;width:58px;text-align:center;padding:6px 0;line-height:1.6;letter-spacing:1px;font:800 17px/1.6 Arial,sans-serif}
@media(max-width:760px){.tg-history table{min-width:690px}.tg-history td,.tg-history th{padding:12px 10px!important}}

/* Keep latest results directly below the chart on desktop and mobile. */
.tg-left-stack{min-width:0;display:flex;flex-direction:column;gap:0}.tg-left-stack .tg-history-title{margin-top:24px}.tg-left-stack .tg-history{width:100%;min-width:0}.tg-left-stack .tg-history table{min-width:650px}.tg-left-stack>.tg-caption{margin-bottom:0}

/* Borderless analysis panels with equal gutters and shrink-safe columns. */
.tg-insights{width:100%;max-width:100%;margin-inline:auto;border:0;box-shadow:none}
.tg-insights .tg-content{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);width:100%;margin-inline:auto}
.tg-insights .tg-chart-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);width:100%;min-width:0}
.tg-insights .tg-chart-card,.tg-insights .tg-ideas,.tg-insights .tg-filters,.tg-insights .tg-kpis>div,.tg-insights .tg-history,.tg-insights .tg-ideas .tg-idea-row{border:0;box-shadow:none}
.tg-insights .tg-chart-card,.tg-insights .tg-ideas{width:100%;max-width:100%;margin-inline:auto}
.tg-insights .tg-legend{width:100%;min-width:0;margin-inline:auto}
.tg-insights .tg-donut{margin-inline:auto}
.tg-insights .tg-ideas .tg-number-list>.tg-number+.tg-number{border-left:0}
.tg-insights .tg-history td,.tg-insights .tg-history th{border:0}
@media(max-width:1100px){.tg-insights .tg-content{grid-template-columns:repeat(2,minmax(0,1fr))}.tg-insights .tg-chart-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:760px){
.tg-insights{padding:18px 10px}
.tg-insights .tg-content{grid-template-columns:minmax(0,1fr)}
.tg-insights .tg-chart-card,.tg-insights .tg-ideas{padding:17px 8px}
.tg-insights .tg-chart-card>h3{text-align:center;overflow-wrap:anywhere}
.tg-insights .tg-legend{grid-template-columns:repeat(5,minmax(0,1fr))}
.tg-insights .tg-legend>div{min-width:0}
.tg-insights .tg-donut{width:min(100%,260px)}
}
