/* Beger AI Inspire beta.14.20 -- responsive controls, one-by-one history gallery */
/* History independent full-width gallery; one tap previews the full branded export. */
html body .beger-history-section .beger-history-header{display:block!important;margin:0 0 18px!important}
html body .beger-history-section .beger-history-hint{font:400 14px/1.7 Prompt,'Noto Sans Thai',Tahoma,sans-serif!important;color:#61738a!important;margin:4px 0 0!important}
html body .beger-history-section .beger-history-card{appearance:none!important;display:block!important;padding:0!important;margin:0!important;width:100%!important;min-width:0!important;height:auto!important;aspect-ratio:4/3!important;cursor:pointer!important;overflow:hidden!important;border:1px solid #d9e3ef!important;border-radius:12px!important;background:#f6f8fb!important;box-shadow:none!important}
html body .beger-history-section .beger-history-card:hover{border-color:#0b3f94!important}
html body .beger-history-section .beger-history-card:focus-visible{outline:3px solid #83afe5!important;outline-offset:2px!important}
html body .beger-history-section .beger-history-card img{width:100%!important;height:100%!important;display:block!important;object-fit:contain!important}
html body .beger-history-section .beger-history-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr))!important;gap:14px!important}
body.beger-history-preview-open{overflow:hidden!important}
.beger-history-preview-backdrop,.beger-history-preview-backdrop *{box-sizing:border-box}
.beger-history-preview-backdrop{position:fixed;inset:0;background:rgba(7,17,30,.77);z-index:2147483400;display:flex;justify-content:center;align-items:center;padding:16px}
.beger-history-preview-dialog{background:#fff;color:#19324f;border-radius:16px;display:flex;flex-direction:column;width:min(1100px,100%);max-height:calc(100dvh - 32px);overflow:hidden;font-family:Prompt,'Noto Sans Thai',Tahoma,sans-serif;box-shadow:0 22px 65px #0003}
.beger-history-preview-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 20px;border-bottom:1px solid #e7eaf0}
.beger-history-preview-header h3{margin:0;font-size:18px;font-weight:600;line-height:1.45;color:#19324f}
html body .beger-history-preview-close{appearance:none!important;display:flex!important;align-items:center!important;justify-content:center!important;flex:none!important;width:44px!important;height:44px!important;padding:0!important;border:0!important;border-radius:50%!important;box-shadow:none!important;background:transparent!important;color:#19324f!important;font:400 29px/1 Arial,sans-serif!important;cursor:pointer!important}
html body .beger-history-preview-close:hover{background:#f1f5fa!important}
.beger-history-preview-stage{flex:1;min-height:0;overflow:auto;display:flex;justify-content:center;align-items:center;padding:12px;background:#f6f8fb}
.beger-history-preview-stage img{display:block;max-width:100%;max-height:calc(100dvh - 190px);height:auto;width:auto;object-fit:contain}
.beger-history-preview-footer{display:flex;justify-content:flex-end;padding:13px 20px;border-top:1px solid #e7eaf0}
html body .beger-history-preview-download{appearance:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:9px!important;min-height:48px!important;padding:11px 22px!important;border:1px solid #0b3f94!important;border-radius:11px!important;background:#0b3f94!important;color:#fff!important;font:600 15px/1.45 Prompt,'Noto Sans Thai',Tahoma,sans-serif!important;cursor:pointer!important;box-shadow:none!important}
.beger-history-preview-download svg{width:20px;height:20px;flex:none}
/* Marker modal: clean touch target X, featured primary shade full row, safe long names. */
html body .beger-pointer-dialog .beger-pointer-close{appearance:none!important;display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 44px!important;width:44px!important;height:44px!important;min-height:44px!important;border:0!important;border-radius:50%!important;padding:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;color:#233850!important;font:400 28px/1 Arial,sans-serif!important;cursor:pointer!important}
html body .beger-pointer-dialog .beger-pointer-close:hover{background:#f2f5fa!important}
html body .beger-pointer-dialog .beger-pointer-pickers{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;width:100%!important}
html body .beger-pointer-dialog .beger-pointer-swatch-button{display:flex!important;flex:initial!important;max-width:none!important;min-width:0!important;width:100%!important;min-height:64px!important;height:auto!important;align-items:center!important;white-space:normal!important;text-align:left!important;padding:10px 12px!important}
html body .beger-pointer-dialog .beger-pointer-swatch-button:first-child{grid-column:1/-1!important}
html body .beger-pointer-dialog .beger-pointer-swatch-text{min-width:0!important;flex:1 1 auto!important;width:auto!important;overflow:visible!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;line-height:1.5!important}
html body .beger-pointer-dialog .beger-pointer-code,html body .beger-pointer-dialog .beger-pointer-role{display:block!important;max-width:100%!important;min-width:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important;word-break:break-word!important}
html body .beger-pointer-dialog .beger-pointer-status{flex:0 0 auto!important}
/* Result toolbar hierarchy: color pin is secondary, Download remains the only primary. */
html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-container > .wb-ai-result-overlay .beger-color-pointer-button,
html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-container > .wb-ai-result-overlay .beger-color-pointer-toggle{appearance:none!important;min-height:46px!important;padding:10px 14px!important;background:#fff!important;color:#0b3f94!important;border:1px solid #b4c8e0!important;border-radius:11px!important;font:500 14px/1.45 Prompt,'Noto Sans Thai',Tahoma,sans-serif!important;box-shadow:none!important}
html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-container > .wb-ai-result-overlay .beger-color-pointer-button:hover,
html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-container > .wb-ai-result-overlay .beger-color-pointer-toggle:hover{background:#f3f7fd!important;border-color:#0b3f94!important}
/* Keep result details column content-sized on phones, not stretched to match tall image grid. */
@media(max-width:767px){
 html body .beger-history-section .beger-history-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 .beger-history-preview-backdrop{padding:8px}
 .beger-history-preview-dialog{max-height:calc(100dvh - 16px);border-radius:13px}
 .beger-history-preview-header{padding:9px 14px}
 .beger-history-preview-header h3{font-size:16px}
 .beger-history-preview-stage{padding:8px}
 .beger-history-preview-stage img{max-height:calc(100dvh - 160px)}
 .beger-history-preview-footer{padding:10px 14px}
 html body .beger-history-preview-download{width:100%!important}
 html body .beger-pointer-dialog .beger-pointer-swatch-button{gap:8px!important;padding:10px!important}
 html body .beger-pointer-dialog .beger-pointer-swatch{width:32px!important;height:36px!important}
 html body .wb-ai-prompt-widget.beger-design-v14 .beger-result-sidebar{height:auto!important;min-height:0!important;align-self:start!important;align-content:start!important}
 html body .wb-ai-prompt-widget.beger-design-v14 .beger-result-sidebar > .beger-result-details{height:auto!important;min-height:0!important}
 html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-container{min-height:0!important}
 html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-overlay > .wb-ai-result-download{flex-basis:100%!important;width:100%!important;background:#0b3f94!important;color:#fff!important}
}
@media(max-width:380px){html body .beger-pointer-dialog .beger-pointer-pickers{gap:7px!important}html body .beger-pointer-dialog .beger-pointer-swatch-button{padding:8px!important}html body .beger-pointer-dialog .beger-pointer-code{font-size:11px!important}}
/* One concise quota indicator beside the wizard step, never above the progress/image. */
html body .wb-ai-prompt-widget.beger-wizard-enabled .wb-ai-usage-badge{display:none!important}
html body .wb-ai-prompt-widget.beger-wizard-enabled .beger-mobile-upload-guide > .beger-wizard-quota{display:none!important}
html body .wb-ai-prompt-widget.beger-wizard-enabled .beger-wizard-counter-row{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:10px!important;width:100%!important;margin:0 0 12px!important;min-width:0!important;
}
html body .wb-ai-prompt-widget.beger-wizard-enabled .beger-wizard-counter-row > .beger-wizard-counter{
  flex:0 0 auto!important;margin:0!important;white-space:nowrap!important;
}
html body .wb-ai-prompt-widget.beger-wizard-enabled .beger-wizard-counter-row > .beger-wizard-quota{
  display:block!important;min-width:0!important;flex:0 1 auto!important;margin:0!important;
  padding:0!important;text-align:right!important;white-space:normal!important;
  font:500 13px/1.5 Prompt,'Noto Sans Thai',Tahoma,sans-serif!important;color:#66758a!important;
}
html body .wb-ai-prompt-widget.beger-wizard-enabled:not([data-wizard-step="3"]) .beger-wizard-counter-row > .beger-wizard-quota,
html body .wb-ai-prompt-widget.beger-wizard-enabled .beger-wizard-counter-row > .beger-wizard-quota[style*="display: none"]{display:none!important}
/* Prevent legacy form min-heights from stretching the result details below its content. */
@media(max-width:767px){
 html body .wb-ai-prompt-widget.beger-design-v14.beger-has-result .wb-ai-prompt-layout,
 html body .wb-ai-prompt-widget.beger-design-v14.beger-has-result .wb-ai-upload-panel,
 html body .wb-ai-prompt-widget.beger-design-v14.beger-has-result .beger-result-sidebar{
   height:auto!important;min-height:0!important;align-items:start!important;
 }
 html body .wb-ai-prompt-widget.beger-design-v14.beger-has-result .beger-paint-calculator{margin-bottom:0!important}
}
@media(max-width:767px){
 html body .wb-ai-prompt-widget.beger-design-v14 .wb-ai-result-container > .wb-ai-result-overlay > .wb-ai-result-download{
  grid-column:1/-1!important;width:100%!important;min-width:0!important;
  background:#0b3f94!important;color:#fff!important;border-color:#0b3f94!important;
 }
}
@media(hover:none){html body .beger-pointer-dialog .beger-pointer-close:hover{background:transparent!important}}
/* A two-color palette also uses available width; never leave a half-empty row. */
html body .beger-pointer-dialog .beger-pointer-pickers > .beger-pointer-swatch-button:nth-child(2):last-child{grid-column:1/-1!important}
