/* BUNHENG168 MIXED V5.5 — all browser styles in original cascade order. */

/* ==========================================================================
   SOURCE CSS: style.css
   ========================================================================== */
*{box-sizing:border-box}
body{margin:0;background:#f3f4f6;font-family:Arial,"Noto Sans Khmer",sans-serif;color:#111}
.app{max-width:1200px;margin:auto;padding:20px}
header h1{margin:0 0 6px} header p{margin:0 0 18px;color:#667085}
.toolbar{background:#fff;border:1px solid #ddd;border-radius:14px;padding:12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
button,.upload-btn,select{border:0;border-radius:9px;padding:10px 14px;background:#111827;color:#fff;font-weight:700;cursor:pointer}
button:disabled{opacity:.4;cursor:not-allowed}.light,select{background:#fff;color:#111;border:1px solid #ccc}
.upload-btn input{display:none}
.paste-zone{flex:1;min-width:280px;border:2px dashed #98a2b3;border-radius:10px;padding:8px 12px;text-align:center;outline:none}
.paste-zone small{display:block;color:#667085;margin-top:3px}
.layout{display:grid;grid-template-columns:1.05fr .95fr;gap:16px;align-items:start}
.panel{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:14px}
.preview-box{height:360px;border:1px dashed #bbb;border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fafafa}
.preview-box img{display:none;max-width:100%;max-height:100%;object-fit:contain}
.progress{display:flex;gap:8px;align-items:center;margin-top:10px}.hidden{display:none!important}
.track{height:8px;background:#eee;border-radius:99px;overflow:hidden;flex:1}.track div{height:100%;width:0;background:#111827}
.select-row{display:flex;gap:10px;align-items:center;margin:14px 0}
.field-group{border-top:1px solid #eee;padding:10px 0}.field-group label{font-weight:700;font-size:13px;display:block;margin-bottom:6px}
.num-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}.num-grid.one{grid-template-columns:1fr}.num-grid.three{grid-template-columns:repeat(3,1fr)}
.num-input{width:100%;padding:8px;border:1px solid #ccc;border-radius:7px;font-size:18px;font-weight:700;text-align:center}
.full{width:100%;margin-top:10px}.result-head{display:flex;justify-content:space-between;align-items:center}

.ticket{width:270px;margin:0 auto;border:2px solid #222;background:#fff;font-family:"Times New Roman","Khmer OS Battambang",serif}
.top-khmer{text-align:center;color:#b50000;font-size:17px;font-weight:800;border-bottom:1px solid #555;padding:3px 2px}
.date-line{display:grid;grid-template-columns:72px 1fr;border-bottom:1px solid #555}
.date-label{color:#007dbb;font-family:Arial,sans-serif;font-weight:800;font-size:16px;padding:3px 6px}
.date-value{color:#007dbb;font-family:Arial,sans-serif;font-weight:800;font-size:17px;text-align:center;padding:3px}
.time-line{text-align:center;color:#d10000;font-family:Arial,sans-serif;font-size:14px;font-weight:800;border-bottom:1px solid #555;padding:2px}
.r{display:grid;grid-template-columns:62px 1fr;border-bottom:1px solid #555;min-height:38px}
.left{border-right:1px solid #555;display:flex;justify-content:center;align-items:center;font-size:15px;font-weight:700}
.right{display:flex;justify-content:center;align-items:center;font-size:25px;font-weight:800;line-height:.9;padding:1px 5px}
.stacked{flex-direction:column}.big{font-size:31px;line-height:.82}.row-a{min-height:64px}.big-blue{font-family:Arial,sans-serif;color:#018ac6;font-size:47px;font-weight:900}
.tall7{min-height:150px}.tall7 .right{font-size:24px;line-height:.88}
.mini-row{display:grid;grid-template-columns:61px 1fr;border-bottom:1px solid #555;min-height:28px}
.mini-row:last-child{border-bottom:0}.mini-label{border-right:1px solid #555;text-align:center;font-family:Arial,sans-serif;font-weight:900;font-size:25px;line-height:27px}
.blue{color:#018ac6}.mini-value{text-align:center;font-size:28px;font-weight:900;line-height:27px;letter-spacing:1px}
.note{font-size:12px;color:#667085;text-align:center}

@media(max-width:850px){.layout{grid-template-columns:1fr}.ticket{width:270px}}

.mode-select{min-width:180px}
.night-fields{border-top:1px solid #eee;margin-top:12px;padding-top:12px}
.night-fields h3{margin:0 0 10px}
.night-fields label{display:block;font-size:13px;font-weight:800;margin:8px 0 5px}
.night-input-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.night-a-box{
  display:grid;
  grid-template-columns:62px 1fr;
  border-bottom:1px solid #555;
  min-height:92px;
}
.night-a-label{
  border-right:1px solid #555;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:Arial,sans-serif;
  color:#018ac6;
  font-size:50px;
  font-weight:900;
}
.night-a-values{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  grid-template-rows:auto auto;
  align-items:center;
  padding:8px 10px;
  row-gap:7px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}
.night-a-row{
  display:contents;
}
.night-a-row3 span{
  font-size:27px;
  text-align:center;
  line-height:1;
}
.night-a-row3 span:nth-child(1){grid-column:1;grid-row:1}
.night-a-row3 span:nth-child(2){grid-column:2;grid-row:1}
.night-a-row3 span:nth-child(3){grid-column:3;grid-row:1}
.night-a-row4 span{
  font-size:25px;
  text-align:center;
  line-height:1;
}
.night-a-row4 span:nth-child(1){grid-column:1;grid-row:2}
.night-a-row4 span:nth-child(2){grid-column:2;grid-row:2}
.night-a-row4 span:nth-child(3){grid-column:3;grid-row:2}
.night-a-row4 span:nth-child(4){grid-column:4;grid-row:2}
.night-a-row span{
  display:block;
  min-width:0;
  white-space:nowrap;
}

.night-grid-3{grid-template-columns:repeat(3,1fr)}
.night-grid-4{grid-template-columns:repeat(4,1fr)}
.night-list-inputs{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;max-height:360px;overflow:auto}
.night-list-input-row{display:grid;grid-template-columns:32px 1fr;gap:5px;align-items:center}
.night-list-input-row span{text-align:center;font-weight:800}

.night-output{border-bottom:1px solid #555}
.night-a-table{display:grid;grid-template-columns:42px 1fr;border-bottom:1px solid #555}
.night-a-letter{border-right:1px solid #555;color:#018ac6;font-family:Arial,sans-serif;font-size:46px;font-weight:900;display:flex;align-items:center;justify-content:center}
.night-a-pairs>div{display:grid;grid-template-columns:62px 1fr;min-height:28px;align-items:center;text-align:center;font-size:24px;line-height:1}
.night-a-pairs b{font-weight:900}
.night-number-list{width:100%}
.night-list-row{display:grid;grid-template-columns:32px 1fr;min-height:24px;border-bottom:1px solid #aaa}
.night-list-index{display:flex;align-items:center;justify-content:center;border-right:1px solid #777;font-size:15px}
.night-list-value{display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:900;line-height:1}

.night-hint{font-size:12px;color:#667085}
.night-exact-card{
  width:245px;
  margin:0 auto;
  background:#fff;
  border:1px solid #333;
  font-family:"Times New Roman","Noto Sans Khmer",serif;
}
.night-title{
  height:31px;display:flex;align-items:center;justify-content:center;
  color:#b00000;font-family:"Noto Sans Khmer",Arial,sans-serif;
  font-size:16px;font-weight:900;border-bottom:1px solid #444;
}
.night-datebar{
  height:32px;display:grid;grid-template-columns:1fr 1fr;
  align-items:center;text-align:center;border-bottom:1px solid #444;
  font-family:Arial,sans-serif;font-size:16px;font-weight:900;
}
.night-datebar span:first-child{color:#d00000;border-right:1px solid #aaa}
.night-datebar span:last-child{color:#087fb7}
.night-exact-a{
  display:grid;grid-template-columns:42px 1fr;
  border-bottom:1px solid #333;
}
.night-exact-letter{
  border-right:1px solid #333;display:flex;align-items:center;justify-content:center;
  color:#0788c4;font-family:Arial,sans-serif;font-size:39px;font-weight:900;
}
.night-exact-a-values>div{
  display:grid;grid-template-columns:1fr 1.45fr;
  min-height:31px;align-items:center;text-align:center;
  font-size:27px;font-weight:900;line-height:1;
}
.night-exact-bcd{
  display:grid;grid-template-columns:42px 64px 1fr;
  min-height:31px;border-bottom:1px solid #333;
  align-items:center;text-align:center;font-size:27px;font-weight:900;line-height:1;
}
.night-exact-bcd>div:first-child{
  color:#0788c4;font-family:Arial,sans-serif;border-right:1px solid #333;
}
.night-exact-bcd>div:nth-child(2){border-right:1px solid #333}
.night-exact-list-row{
  display:grid;grid-template-columns:42px 64px 1fr;
  min-height:24px;border-bottom:1px solid #aaa;
  align-items:center;text-align:center;line-height:1;
}
.night-exact-list-row:last-child{border-bottom:0}
.night-exact-list-row .idx{border-right:1px solid #aaa;font-size:15px}
.night-exact-list-row .blank{border-right:1px solid #aaa;height:100%}
.night-exact-list-row .val{font-size:22px;font-weight:900}

/* ===== V14 exact Night output layout ===== */
.night-exact-card{
  width:245px !important;
  margin:0 auto;
  background:#fff;
  border:1px solid #333;
  font-family:"Times New Roman","Noto Sans Khmer",serif;
}
.night-title{
  height:31px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#b00000;
  font-family:"Noto Sans Khmer",Arial,sans-serif;
  font-size:16px;
  font-weight:900;
  border-bottom:1px solid #444;
}
.night-datebar{
  height:32px;
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
  text-align:center;
  border-bottom:1px solid #444;
  font-family:Arial,sans-serif;
  font-size:16px;
  font-weight:900;
}
.night-datebar span:first-child{
  color:#d00000;
  border-right:1px solid #aaa;
}
.night-datebar span:last-child{
  color:#087fb7;
}
.night-grid-row{
  display:grid;
  grid-template-columns:42px 62px 1fr;
  align-items:center;
  min-height:30px;
  border-bottom:1px solid #666;
  text-align:center;
}
.night-col-label{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border-right:1px solid #777;
  font-family:Arial,sans-serif;
}
.night-col-mid{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border-right:1px solid #777;
  font-size:26px;
  font-weight:900;
  line-height:1;
}
.night-col-right{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  font-weight:900;
  line-height:1;
}
.night-a-row{
  min-height:31px;
}
.night-big-a{
  color:#0788c4;
  font-size:40px;
  font-weight:900;
}
.night-bcd-label{
  color:#0788c4;
  font-size:27px;
  font-weight:900;
}
.night-bcd-row{
  min-height:30px;
}
.night-exact-list{
  width:100%;
}
.night-exact-list-row{
  display:grid;
  grid-template-columns:42px 62px 1fr;
  min-height:24px;
  align-items:center;
  text-align:center;
  border-bottom:1px solid #aaa;
  line-height:1;
}
.night-exact-list-row:last-child{
  border-bottom:0;
}
.night-exact-list-row .idx{
  grid-column:2;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border-left:1px solid #777;
  border-right:1px solid #777;
  font-size:15px;
}
.night-exact-list-row .blank{
  display:none;
}
.night-exact-list-row .val{
  grid-column:3;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:900;
}

.sat-info{
  margin:8px 0 10px;
  padding:8px 10px;
  border:1px solid #d0d5dd;
  border-radius:8px;
  background:#f9fafb;
  font-size:12px;
  color:#475467;
}

#scheduleInfo{
  display:block;
  margin:8px 0 10px;
  font-weight:700;
}

.compact-abcdh-card{
  width:245px;margin:0 auto;background:#fff;border:1px solid #333;
  font-family:"Times New Roman",serif;
}
.compact-title{
  text-align:center;font-weight:900;font-size:18px;padding:7px;
  border-bottom:1px solid #333;color:#a00000;
}
.compact-row{
  display:grid;grid-template-columns:52px 1fr;min-height:42px;
  border-bottom:1px solid #555;align-items:center;text-align:center;
  font-size:28px;font-weight:900;
}
.compact-row:last-child{border-bottom:0}
.compact-row>div:first-child{
  height:100%;display:flex;align-items:center;justify-content:center;
  border-right:1px solid #555;color:#0788c4;font-family:Arial,sans-serif;
}

.compact-title{
  white-space:nowrap;
  font-family:"Noto Sans Khmer",Arial,sans-serif;
  font-size:15px !important;
  padding:7px 4px !important;
}

/* ===== V23 logo + selected-time title on every result ===== */
.result-brand-header{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:3px 5px;
  border-bottom:1px solid #444;
  background:#fff;
  box-sizing:border-box;
}
.result-logo{
  width:38px;
  height:38px;
  object-fit:contain;
  flex:0 0 auto;
}
.result-brand-header .ticket-title,
.result-brand-header .night-title,
.result-brand-header .compact-title{
  border:0 !important;
  padding:0 !important;
  min-height:0 !important;
  height:auto !important;
  display:block !important;
  color:#b00000;
  font-family:"Noto Sans Khmer",Arial,sans-serif;
  font-size:13px !important;
  font-weight:900;
  line-height:1.25;
  text-align:center;
  white-space:nowrap;
}
.compact-brand-header{
  border-bottom:1px solid #333;
}

/* ===== V24: same logo/header on every result time ===== */
.day-brand-header,
.night-brand-header,
.compact-brand-header{
  min-height:46px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  padding:4px 6px !important;
  background:#fff !important;
  border-bottom:1px solid #444 !important;
}
.day-brand-header .result-logo,
.night-brand-header .result-logo,
.compact-brand-header .result-logo{
  width:38px !important;
  height:38px !important;
  object-fit:contain !important;
  flex:0 0 38px !important;
}
.day-brand-header .top-khmer,
.night-brand-header .night-title,
.compact-brand-header .compact-title{
  border:0 !important;
  padding:0 !important;
  margin:0 !important;
  height:auto !important;
  min-height:0 !important;
  display:block !important;
  background:transparent !important;
  color:#b00000 !important;
  font-family:"Noto Sans Khmer",Arial,sans-serif !important;
  font-size:13px !important;
  font-weight:900 !important;
  line-height:1.25 !important;
  text-align:center !important;
  text-decoration:none !important;
  white-space:nowrap !important;
}
#dayTimeLine{
  text-align:center;
  color:#d10000;
  font-family:Arial,sans-serif;
  font-size:14px;
  font-weight:800;
  border-bottom:1px solid #555;
  padding:3px;
}

/* ===== V25 DATE row on every result format ===== */
.all-time-date-row{
  min-height:28px;
  display:grid;
  grid-template-columns:1fr 1.35fr;
  align-items:center;
  border-bottom:1px solid #555;
  background:#fff;
  font-family:Arial,sans-serif;
  font-size:16px;
  font-weight:900;
}
.all-time-date-row span:first-child{
  padding-left:7px;
  color:#087fb7;
  text-align:left;
}
.all-time-date-row span:last-child{
  color:#087fb7;
  text-align:center;
}

/* ===== V26 Cambodia date + unified header ===== */
.date-control{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.date-control label{
  font-weight:800;
  font-size:13px;
}
.date-control input[type="date"]{
  border:1px solid #d0d5dd;
  border-radius:9px;
  padding:9px 10px;
  font-weight:700;
  background:#fff;
}
.dynamic-result-date{
  cursor:text;
  outline:none;
}
.dynamic-result-date:focus{
  background:#fff8d8;
}

/* ===== V27: 4:30 DATE exactly matches compact-time DATE ===== */
.ticket .date-row,
.ticket .date-line,
.ticket .datebar,
.ticket .date-bar{
  min-height:28px !important;
  align-items:center !important;
  font-family:Arial,sans-serif !important;
  font-size:16px !important;
  font-weight:900 !important;
  line-height:1 !important;
}

.ticket .date-row *,
.ticket .date-line *,
.ticket .datebar *,
.ticket .date-bar *{
  font-family:Arial,sans-serif !important;
  font-size:16px !important;
  font-weight:900 !important;
  line-height:1 !important;
}

.ticket .dynamic-result-date,
.ticket .full-day-date-value,
.ticket #dateText,
.ticket #dateVal{
  color:#087fb7 !important;
  font-family:Arial,sans-serif !important;
  font-size:16px !important;
  font-weight:900 !important;
  line-height:1 !important;
  text-align:center !important;
}

/* DATE label also matches the 1:30 compact format */
.ticket .date-row > :first-child,
.ticket .date-line > :first-child,
.ticket .datebar > :first-child,
.ticket .date-bar > :first-child{
  color:#087fb7 !important;
  font-family:Arial,sans-serif !important;
  font-size:16px !important;
  font-weight:900 !important;
}

/* ===== V28: remove logos from every result ===== */
.result-logo{display:none !important}
.result-brand-header{
  min-height:32px !important;
  padding:4px 6px !important;
  gap:0 !important;
}
.result-brand-header .ticket-title,
.result-brand-header .night-title,
.result-brand-header .compact-title,
.result-brand-header .top-khmer{
  font-size:14px !important;
}

/* ===== Evening 6:50 / 7:30 / 8:30 style like reference picture ===== */
.evening-card{
  width:210px;
  margin:0 auto;
  background:#fff;
  border:1px solid #333;
  font-family:"Times New Roman","Noto Sans Khmer",serif;
}
.evening-title{
  color:#b00000;
  text-align:center;
  font-family:"Noto Sans Khmer",Arial,sans-serif;
  font-weight:900;
  font-size:15px;
  min-height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom:1px solid #444;
}
.evening-date-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  min-height:28px;
  align-items:center;
  text-align:center;
  border-bottom:1px solid #444;
  font-family:Arial,sans-serif;
  font-weight:900;
  font-size:15px;
}
.evening-date-row span:first-child{
  color:#d00000;
  border-right:1px solid #aaa;
}
.evening-date-row span:last-child{
  color:#087fb7;
}
.evening-a-block{
  display:grid;
  grid-template-columns:40px 1fr;
  border-bottom:1px solid #444;
}
.evening-letter{
  color:#0788c4;
  font-family:Arial,sans-serif;
  font-size:42px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  border-right:1px solid #444;
}
.evening-a-values > div{
  display:grid;
  grid-template-columns:58px 1fr;
  min-height:28px;
  align-items:center;
  text-align:center;
  font-size:25px;
  font-weight:900;
  line-height:1;
}
.evening-bcd{
  display:grid;
  grid-template-columns:40px 58px 1fr;
  min-height:29px;
  align-items:center;
  text-align:center;
  border-bottom:1px solid #444;
  font-size:25px;
  font-weight:900;
  line-height:1;
}
.evening-bcd:last-child{border-bottom:0}
.evening-bcd>div:first-child{
  color:#0788c4;
  font-family:Arial,sans-serif;
  border-right:1px solid #444;
}
.evening-bcd>div:nth-child(2){
  border-right:1px solid #444;
}

.abcdh-editor{margin:12px 0;padding:12px;border:1px solid #d0d5dd;border-radius:10px;background:#fff}
.editor-title{font-weight:800;margin-bottom:10px}
.editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.editor-grid label{font-size:12px;font-weight:700}
.editor-grid input{display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:9px;border:1px solid #bbb;border-radius:7px;font-size:18px;font-weight:800}
#applyABCDH{margin-top:10px;width:100%;padding:10px;font-weight:800}
@media(max-width:520px){.editor-grid{grid-template-columns:1fr}}

.abcdh-formula-note{
  font-size:11px;
  text-align:center;
  padding:5px 4px;
  border-bottom:1px solid #ddd;
  color:#475467;
  font-family:Arial,sans-serif;
}

/* ===== V33 clean ABCDH result ===== */
#compactABCDHCard .abcdh-formula-note{display:none !important}
#compactABCDHCard{
  overflow:hidden;
}

.manual-result-preview{margin:12px auto;max-width:310px}
.manual-result-preview table{width:100%;border-collapse:collapse;background:#fff}
.manual-result-preview th,.manual-result-preview td{border:1px solid #333;padding:7px;text-align:center}
.manual-result-preview th{font-size:22px;color:#0784bd;width:55px}
.manual-result-preview td{font-size:22px;font-weight:800}

.editor-subtitle{font-weight:800;font-size:12px;margin:8px 0 4px}
.editor-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.editor-grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.single-field{display:block;margin-top:10px;font-size:12px;font-weight:700}
.single-field input{display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:9px;border:1px solid #bbb;border-radius:7px;font-size:18px;font-weight:800}

/* ===== V40: ONLY 4:30 is changed; all other times remain V36 ===== */
#only430Card{
  width:245px;
  margin:0 auto;
}
#only430Card .compact-title{
  text-align:center;
  color:#b00000;
  font-family:"Noto Sans Khmer",Arial,sans-serif;
  font-weight:900;
  font-size:14px;
  padding:7px 4px;
  border-bottom:1px solid #333;
}
#only430Card .compact-row{
  display:grid;
  grid-template-columns:52px 1fr;
  min-height:42px;
  border-bottom:1px solid #555;
  align-items:center;
  text-align:center;
  font-size:28px;
  font-weight:900;
}
#only430Card .compact-row:last-child{border-bottom:0}
#only430Card .compact-row>div:first-child{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border-right:1px solid #555;
  color:#0788c4;
  font-family:Arial,sans-serif;
}


/* 1:30 PM exact full result card */
.time130-card{width:330px;margin:0 auto;background:#fff;border:2px solid #111;font-family:"Times New Roman",serif;color:#111}
.time130-kh{text-align:center;color:#8d0000;font-family:"Noto Sans Khmer",Arial,sans-serif;font-size:19px;font-weight:900;padding:5px 2px 2px;text-decoration:underline}
.time130-name{text-align:center;font-size:31px;font-weight:900;line-height:1.05;border-top:1px solid #111;padding-top:3px}
.time130-date{text-align:center;font-size:25px;font-weight:900;border-bottom:2px solid #111;padding:1px 2px 4px;white-space:nowrap}
.t130-row{display:grid;grid-template-columns:105px 1fr;border-bottom:2px solid #111;min-height:58px}
.t130-label{border-right:2px solid #111;display:flex;align-items:center;justify-content:center;text-align:center;font-size:27px;font-weight:900;line-height:.9;gap:8px}
.t130-label small{font-size:17px;font-weight:700}
.t130-val{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:42px;font-weight:900;line-height:.92}
.t130-big{font-size:56px;line-height:.9}
.t130-g6{min-height:145px}.t130-g4{min-height:315px}
.t130-mini{display:grid;grid-template-columns:105px 1fr;min-height:58px;border-bottom:1px dotted #444;align-items:center;text-align:center}
.t130-mini:last-child{border-bottom:0}.t130-mini b{height:100%;display:flex;align-items:center;justify-content:center;border-right:2px solid #111;font-size:42px}.t130-mini span{font-size:43px;font-weight:900;white-space:pre}

/* 1:30 PM: DATE header matches the 4:30 PM style */
.time130-date-row{
  grid-template-columns:105px 1fr;
  min-height:32px;
  border-bottom:2px solid #111;
  font-family:Arial,sans-serif;
  font-size:17px;
  font-weight:900;
}
.time130-date-row span:first-child{padding-left:8px;color:#007dbb;text-align:left;}
.time130-date-row span:last-child{color:#007dbb;text-align:center;}


/* 1:30 PM: Giải 8 + Giải 7 are both A, so show one A block like 4:30 */
.t130-a-row{min-height:116px;}
.t130-a-label{color:#0788c4;font-family:Arial,sans-serif;font-size:48px;font-weight:900;}
.t130-a-values{font-size:50px;line-height:1.02;gap:4px;}


/* ===== 1:30 PM easy editor ===== */
.t130-editor-title{
  margin:12px 0 4px;
  padding:9px 10px;
  border-radius:8px;
  background:#f3f4f6;
  font-weight:900;
  font-size:14px;
}
.t130-editor-group{
  display:grid;
  grid-template-columns:54px 1fr;
  gap:10px;
  align-items:start;
  padding:10px 0;
}
.t130-editor-group>label{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  margin:0;
  font-family:Arial,sans-serif;
  font-size:22px !important;
  font-weight:900 !important;
  color:#0788c4;
}
.t130-editor-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.t130-editor-grid.one{grid-template-columns:1fr}
.t130-editor-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.t130-editor-group:nth-of-type(5) .t130-editor-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.t130-editor-note{
  margin:8px 0 12px;
  padding:8px 10px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:8px;
  font-size:12px;
  color:#475467;
}
.time130-card .t130-g4{min-height:350px}

/* V45: daytime full-result A label uses the same style as DB */
.t130-a-label{
  color:#111;
  font-family:"Times New Roman",serif;
  font-size:42px;
  font-weight:900;
}


/* ===== Shared daytime result: A same color as DB ===== */
.time130-card .time130-a-label {
  color: #0788c4 !important;
}


/* Daytime A label — same blue as 4:30 A */
.time130-card .time130-a-label,
.time130-card .time130-a,
.time130-card .t130-a,
.time130-card .t130-a-label {
  color: #0788c4 !important;
}


/* A / DB / C / D / F / I — same blue color */
.time130-card .time130-a-label,
.time130-card .t130-mini b {
  color: #0788c4 !important;
}

/* Daytime full result: show all 11 values in section 4 */
.time130-card .t130-g4 {
  min-height: 440px !important;
}

/* Shared daytime result: enough height for all 11 section-4 values */
.time130-card .t130-g4 { min-height: 440px !important; }

/* Daytime result: section 4 has 9 values; final two values are section 3 */
.time130-card .t130-g4 { min-height: 360px !important; }
.time130-card .time130-g3 { min-height: 86px; }
.time130-card .time130-g3 .time130-label {
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
}

/* ===== Row 3: same box/layout behavior as row 5 ===== */
.time130-card .time130-g3 {
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 88px 1fr !important;
}
.time130-card .time130-g3 .time130-label {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 76px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
}
.time130-card .time130-g3 .time130-values {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 76px !important;
  height: auto !important;
  padding: 4px 8px !important;
}
.time130-card .time130-g3 .time130-values > div {
  width: 100%;
  text-align: center;
}


/* ===== CLEAN FIX: Group 3 is a normal standalone row, exactly like Group 5 ===== */
.time130-card .t130-row.t130-g3{
  display:grid !important;
  grid-template-columns:88px 1fr !important;
  min-height:64px !important;
  border-bottom:1px solid #333 !important;
}
.time130-card .t130-row.t130-g3 .t130-label{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-right:1px solid #333 !important;
  min-height:64px !important;
  padding:0 !important;
  margin:0 !important;
  position:static !important;
  font-size:22px !important;
  font-weight:700 !important;
  color:#111 !important;
}
.time130-card .t130-row.t130-g3 .t130-val{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:64px !important;
  padding:3px 8px !important;
  margin:0 !important;
  border:0 !important;
}
.time130-card .t130-row.t130-g3 .t130-val > div{
  display:block !important;
  width:100% !important;
  text-align:center !important;
  line-height:1.05 !important;
}


/* ===== FINAL FIX: row 3 aligns exactly with row 5 / DB ===== */
.time130-card .t130-row.t130-g3{
  display:grid !important;
  grid-template-columns:105px 1fr !important;
  min-height:76px !important;
  border-bottom:2px solid #111 !important;
}

.time130-card .t130-row.t130-g3 .t130-label{
  border-right:2px solid #111 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:76px !important;
  margin:0 !important;
  padding:0 !important;
  position:static !important;
  font-size:27px !important;
  font-weight:900 !important;
  line-height:.9 !important;
  color:#111 !important;
}

.time130-card .t130-row.t130-g3 .t130-val{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:76px !important;
  margin:0 !important;
  padding:4px 8px !important;
  border:0 !important;
  font-size:42px !important;
  font-weight:900 !important;
  line-height:.92 !important;
}

.time130-card .t130-row.t130-g3 .t130-val > div{
  width:100% !important;
  text-align:center !important;
  margin:0 !important;
  padding:0 !important;
}


/* =========================================================
   PRO UPGRADE UI
   ========================================================= */
.pro-toolbar{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:10px 12px;
  margin:-6px 0 16px;
}
.pro-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-items:center;
}
.pro-actions button{padding:8px 11px}
.zoom-text{min-width:48px;text-align:center;font-weight:800;font-size:13px}

.batch-queue{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid #eee;
}
.batch-item{
  border:1px solid #d0d5dd;
  border-radius:9px;
  padding:7px 9px;
  background:#f9fafb;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}
.batch-item.active{
  border-color:#111827;
  background:#eef2ff;
}

.quality-notice{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid #f59e0b;
  border-radius:9px;
  background:#fffbeb;
  font-size:13px;
  font-weight:700;
}
.num-input.ocr-check{
  outline:2px solid #f59e0b;
  background:#fffbeb;
}

.debug-panel{
  margin-top:10px;
  border:1px solid #d0d5dd;
  border-radius:10px;
  background:#0b1020;
  color:#dbeafe;
  overflow:hidden;
}
.debug-panel summary{
  cursor:pointer;
  padding:10px 12px;
  font-weight:800;
  background:#111827;
}
.debug-panel pre{
  margin:0;
  padding:12px;
  overflow:auto;
  max-height:420px;
  font:12px/1.5 Consolas,monospace;
  white-space:pre-wrap;
}

.pro-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.pro-modal-card{
  width:min(820px,96vw);
  max-height:86vh;
  overflow:auto;
  border-radius:14px;
  background:#fff;
  padding:14px;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
}
.pro-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid #eee;
  padding-bottom:10px;
  margin-bottom:10px;
}
.pro-modal-head h3{margin:0}
.history-item{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  padding:11px 4px;
  border-bottom:1px solid #eee;
}
.history-meta{font-weight:800}
.history-sub{font-size:12px;color:#667085;margin-top:3px}
.history-buttons{display:flex;gap:5px;align-items:center}
.history-buttons button{padding:7px 9px}

.result-zoomable{
  transform-origin:top center;
  transition:transform .15s ease;
}

@media(max-width:850px){
  .app{padding:10px}
  .toolbar{position:sticky;top:0;z-index:40;border-radius:0 0 12px 12px}
  .pro-toolbar{position:sticky;top:112px;z-index:35;border-radius:10px}
  .pro-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .pro-actions button{font-size:11px;padding:8px 4px}
  .zoom-text{display:flex;align-items:center;justify-content:center}
  .panel{padding:10px}
  .preview-box{height:290px}
  .num-input{font-size:20px;min-height:44px}
  .t130-editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media(max-width:520px){
  .pro-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mode-select{min-width:135px;flex:1}
  .paste-zone{min-width:100%}
  .date-control{width:100%}
  .date-control input{max-width:160px}
}

/* Better printing / screenshots */
@media print{
  body{background:#fff}
  header,.toolbar,.pro-toolbar,.panel:first-child,.result-head{display:none!important}
  .layout{display:block}
  .panel{border:0;padding:0}
}


/* ===== 1:30 PM: source-matching row structure ===== */
.time130-card .t130-g4-source{
  display:grid;
  grid-template-columns:105px 1fr;
  border-bottom:2px solid #111;
}
.time130-card .t130-g4-source .t130-g4-label{
  border-right:2px solid #111;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:27px;
  font-weight:900;
  color:#111;
}
.time130-card .t130-g4-groups{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.time130-card .t130-g4-subrow{
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom:1px solid #777;
  font-size:42px;
  font-weight:900;
  line-height:.95;
  text-align:center;
  padding:3px 8px;
}
.time130-card .t130-g4-subrow:last-of-type{
  border-bottom:0;
}
.time130-card .t130-g4-subrow > div{
  width:100%;
  text-align:center;
}

/* At 1:30 PM, we keep one left label "4" spanning all source sub-rows. */

/* V65: 1:30 PM numbers inside each source row must stack vertically. */
.time130-card .t130-g4-subrow{
  flex-direction:column;
  gap:0;
  height:auto;
  min-height:54px;
  padding:5px 8px;
}
.time130-card .t130-g4-subrow-3,
.time130-card .t130-g4-subrow-2{
  justify-content:center;
}
.time130-card .t130-g4-subrow > div{
  display:block;
  width:100%;
  line-height:1.02;
  white-space:nowrap;
}


/* ===== FINAL 1:30 ORIGINAL SOURCE LAYOUT ===== */
.time130-card #t130g4Source{
  display:grid !important;
  grid-template-columns:105px 1fr !important;
  border-bottom:2px solid #111 !important;
}
.time130-card #t130g4Source .t130-g4-label{
  border-right:2px solid #111 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:27px !important;
  font-weight:900 !important;
  color:#111 !important;
}
.time130-card #t130g4Source .t130-g4-groups{
  display:block !important;
  padding:0 !important;
  margin:0 !important;
}
.time130-card #t130g4Source .t130-g4-subrow{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  border-bottom:1px solid #777 !important;
  padding:3px 8px !important;
  margin:0 !important;
  min-height:0 !important;
  font-size:42px !important;
  font-weight:900 !important;
  line-height:.92 !important;
  text-align:center !important;
}
.time130-card #t130g4Source .t130-g4-subrow:last-of-type{
  border-bottom:0 !important;
}
.time130-card #t130g4Source .t130-g4-subrow > div{
  display:block !important;
  width:100% !important;
  text-align:center !important;
  margin:0 !important;
  padding:0 !important;
}
.time130-card #t130g4Source .t130-unused-slot{
  display:none !important;
}


/* ===== V66 CLEAN 1:30 PM RESULT ===== */
.time130-card #t130g4Source{
  overflow:hidden !important;
}
.time130-card #t130g4Source .t130-g4-groups{
  min-width:0 !important;
}
.time130-card #t130g4Source .t130-g4-subrow{
  box-sizing:border-box !important;
}


/* ===== V68 1:30 PM FINAL ROW 7 ===== */
.time130-card #t130g4Source .t130-g4-groups > .t130-g4-subrow:first-child{
  border-bottom:1px solid #777 !important;
}


/* ===== Shared daytime 7-group: restore missing 9th row ===== */
.time130-card #t130g49{
  width:100%;
  text-align:center;
  margin:0;
  padding:0;
  font-size:42px;
  font-weight:900;
  line-height:.92;
}


/* ===== PRO V2 upgrades ===== */
.pro-modal-wide{max-width:820px!important}
.history-tools{display:flex;gap:10px;align-items:center;margin:10px 0 14px}
.history-tools input{flex:1;min-width:0;padding:10px 12px;border:1px solid #d0d5dd;border-radius:10px;font-size:15px}
#historyCount{font-size:13px;font-weight:800;color:#667085;white-space:nowrap}
.import-label{display:inline-flex!important;align-items:center;justify-content:center;cursor:pointer;padding:10px 14px;border-radius:9px;font-weight:700}
.import-label input{display:none}
.history-item{gap:12px}
.history-buttons{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.history-buttons button{padding:7px 10px}
.settings-card{max-width:640px!important}
.settings-grid{display:grid;gap:10px;margin-top:12px}
.setting-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px;border:1px solid #e5e7eb;border-radius:12px;background:#fafafa;cursor:pointer}
.setting-row span{display:flex;flex-direction:column;gap:3px}
.setting-row small{color:#667085;line-height:1.35}
.setting-row input[type="checkbox"]{width:22px;height:22px;flex:0 0 auto}
.settings-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.ocr-result-check{outline:2px solid #ef4444!important;outline-offset:-2px;background:#fff1f2!important}
.ocr-result-ok{outline:none}
#qualityNotice.pro-warning{display:block!important;background:#fff4e5;border:1px solid #f59e0b;color:#92400e;padding:10px 12px;border-radius:10px}
.auto-working{animation:proPulse 1s ease-in-out infinite alternate}
@keyframes proPulse{from{opacity:.55}to{opacity:1}}

@media(max-width:650px){
  .app{padding:8px}
  header h1{font-size:20px}
  .toolbar,.pro-actions{gap:6px}
  button,.upload-btn,select{padding:9px 10px;font-size:13px}
  .paste-zone{min-width:100%;order:10}
  .mode-select{min-width:calc(50% - 5px);flex:1}
  .date-control{width:100%}
  .date-control input[type="date"]{flex:1;min-width:140px}
  .panel{padding:8px;border-radius:10px}
  .preview-box{height:260px}
  .result-head h2{font-size:17px}
  .pro-modal{padding:8px}
  .pro-modal-card{max-height:92vh;overflow:auto}
  .pro-modal-head{align-items:flex-start;gap:8px}
  .pro-modal-head>div{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
  .history-tools{flex-direction:column;align-items:stretch}
  .history-item{grid-template-columns:1fr!important}
  .history-buttons{justify-content:flex-start}
  .setting-row{align-items:flex-start}
}


/* ===== PRO V3 ===== */
.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.compare-grid section{min-width:0;border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fafafa}
.compare-grid h4{margin:0 0 8px}
.compare-grid pre{white-space:pre-wrap;word-break:break-word;max-height:360px;overflow:auto;margin:0;font-size:12px}
.confidence-summary{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:8px 0 12px;padding:10px;border:1px solid #e5e7eb;border-radius:10px}
.confidence-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:7px;margin-top:10px}
.confidence-chip{padding:8px;border:1px solid #e5e7eb;border-radius:9px;background:#fff;font-size:12px}
.confidence-chip.low{border-color:#ef4444;background:#fff1f2}
.confidence-chip.medium{border-color:#f59e0b;background:#fff7ed}
.confidence-chip.good{border-color:#22c55e;background:#f0fdf4}

.dashboard-card{max-width:980px!important}
.dashboard-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}
.dashboard-tools label{display:flex;gap:7px;align-items:center;font-weight:800}
.dashboard-tools input{padding:9px;border:1px solid #d0d5dd;border-radius:9px}
.dashboard-stats{padding:9px 11px;border-radius:9px;background:#f3f4f6;font-weight:800;margin-bottom:10px}
.dashboard-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px}
.dashboard-item{border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fff}
.dashboard-item h4{margin:0 0 7px}
.dashboard-item pre{white-space:pre-wrap;max-height:240px;overflow:auto;margin:0;font-size:12px}
.dashboard-item-actions{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}

.duplicate-card{max-width:480px!important}
#historyDateFilter{padding:10px;border:1px solid #d0d5dd;border-radius:10px}

body.pro-dark{background:#0f172a;color:#e5e7eb}
body.pro-dark .toolbar,
body.pro-dark .panel,
body.pro-dark .pro-toolbar,
body.pro-dark .pro-modal-card,
body.pro-dark .compare-grid section,
body.pro-dark .dashboard-item,
body.pro-dark .confidence-chip,
body.pro-dark .setting-row{background:#111827;color:#e5e7eb;border-color:#334155}
body.pro-dark .light,
body.pro-dark select,
body.pro-dark input,
body.pro-dark .paste-zone{background:#1f2937;color:#f9fafb;border-color:#475569}
body.pro-dark .note,
body.pro-dark small,
body.pro-dark header p,
body.pro-dark #historyCount{color:#cbd5e1}
body.pro-dark .dashboard-stats{background:#1e293b}
body.pro-dark .ticket,
body.pro-dark .night-exact-card,
body.pro-dark .compact-abcdh-card,
body.pro-dark .compact-abcd-card,
body.pro-dark #time130Card{background:#fff;color:#111}

@media(max-width:700px){
  .compare-grid{grid-template-columns:1fr}
  .dashboard-card{width:100%}
}

/* ==========================================================================
   SOURCE CSS: v4.css
   ========================================================================== */
/* Khmer Lottery Picture Converter PRO V4 enhancement layer */
.v4-title-badge{display:inline-block;font:800 11px/1 Arial,sans-serif;padding:5px 7px;border-radius:999px;background:#111827;color:#fff;vertical-align:middle;margin-left:6px}
.v4-quickbar{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:10px 12px;margin:-6px 0 16px;display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;box-shadow:0 4px 18px rgba(17,24,39,.05)}
.v4-brand{display:flex;flex-direction:column}.v4-brand b{font-size:14px}.v4-brand span{font-size:11px;color:#667085}.v4-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}.v4-actions button,.v4-import{padding:8px 10px;font-size:12px}.v4-import{display:inline-flex;align-items:center;cursor:pointer;border-radius:9px;font-weight:700}.v4-import input{display:none}
.v4-quality{font-size:12px;font-weight:800;padding:7px 9px;border-radius:9px;background:#f3f4f6;white-space:nowrap}.v4-quality.good{background:#ecfdf3}.v4-quality.warn{background:#fff7ed;color:#9a3412}
.v4-toast{position:fixed;right:18px;bottom:18px;z-index:99999;max-width:360px;padding:11px 14px;border-radius:11px;background:#111827;color:#fff;font-weight:800;box-shadow:0 12px 35px rgba(0,0,0,.25);opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s}.v4-toast.show{opacity:1;transform:none}.v4-toast[data-type="bad"]{background:#991b1b}
.v4-missing-times{border:1px solid #e5e7eb;background:#fafafa;border-radius:12px;padding:10px;margin:10px 0}.v4-missing-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:8px}.v4-missing-head small{color:#667085}.v4-time-chips{display:flex;flex-wrap:wrap;gap:6px}.v4-time-chips span{padding:6px 8px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid #ddd;background:#fff}.v4-time-chips .done{background:#ecfdf3;border-color:#bbf7d0}.v4-time-chips .missing{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
body.v4-sticky .layout>.panel:nth-child(2){position:sticky;top:10px}
body.v4-compact .v4-pro-toolbar .pro-actions>button:not(.v4-primary-tool),body.v4-compact .v4-pro-toolbar .pro-actions>#zoomText{display:none}
body.v4-compact.v4-show-tools .v4-pro-toolbar .pro-actions>button,body.v4-compact.v4-show-tools .v4-pro-toolbar .pro-actions>#zoomText{display:inline-flex}
body.pro-dark .v4-quickbar,body.pro-dark .v4-missing-times{background:#111827;border-color:#374151}body.pro-dark .v4-brand span,body.pro-dark .v4-missing-head small{color:#9ca3af}body.pro-dark .v4-quality{background:#1f2937}body.pro-dark .v4-time-chips span{background:#1f2937;border-color:#4b5563}
@media(max-width:850px){.app{padding:10px}.v4-quickbar{grid-template-columns:1fr}.v4-brand{text-align:center}.v4-actions{display:grid;grid-template-columns:repeat(3,1fr)}.v4-quality{text-align:center;white-space:normal}.toolbar{gap:7px}.paste-zone{min-width:100%}.mode-select{min-width:0;flex:1}.date-control{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:6px}.date-control label{grid-column:1/-1}.result-head{gap:8px}.result-head h2{font-size:18px}body.v4-sticky .layout>.panel:nth-child(2){position:static}}
@media(max-width:520px){.v4-actions{grid-template-columns:repeat(2,1fr)}.v4-actions>*{width:100%;justify-content:center}.pro-actions{display:grid!important;grid-template-columns:repeat(2,1fr);width:100%}.pro-actions button{width:100%}.ticket{max-width:100%}}

/* ==========================================================================
   SOURCE CSS: v5.css
   ========================================================================== */
/* Khmer Lottery Picture Converter PRO V5 enhancement layer */
.v5-draft-badge{font-size:11px;font-weight:800;padding:7px 9px;border-radius:9px;background:#eef2ff;color:#3730a3;white-space:nowrap}
.v4-quickbar{grid-template-columns:auto 1fr auto auto}.v4-actions .v5-main{border-color:#a5b4fc;background:#eef2ff;color:#312e81}
.v5-editable-result{cursor:text!important;outline:none;transition:box-shadow .15s,background .15s}.v5-editable-result:hover{background:#fffbeb!important;box-shadow:inset 0 0 0 1px #f59e0b}.v5-editable-result:focus{background:#fff7ed!important;box-shadow:inset 0 0 0 2px #f59e0b}
.v5-toast{position:fixed;right:18px;bottom:18px;z-index:100000;max-width:380px;padding:11px 14px;border-radius:11px;background:#111827;color:#fff;font-weight:800;box-shadow:0 12px 35px rgba(0,0,0,.25);opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s}.v5-toast.show{opacity:1;transform:none}.v5-toast[data-type="bad"]{background:#991b1b}
.v5-control-card{max-width:720px!important}.v5-control-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:8px 0 14px}.v5-control-tools label{display:flex;gap:8px;align-items:center;font-weight:800}.v5-control-tools input{padding:8px;border:1px solid #d1d5db;border-radius:8px}.v5-control-tools>b{font-size:13px;color:#475569}
.v5-control-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.v5-control-item{min-height:82px;background:#fff!important;color:#111827!important;border:1px solid #e5e7eb!important;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px!important;gap:3px}.v5-control-item span{font-size:19px}.v5-control-item b{font-size:13px}.v5-control-item small{font-size:10px}.v5-control-item.done{background:#ecfdf3!important;border-color:#86efac!important}.v5-control-item.done span{color:#15803d}.v5-control-item.missing{background:#fff7ed!important;border-color:#fdba74!important}.v5-control-item.missing span,.v5-control-item.missing small{color:#c2410c}.v5-control-footer{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
body.pro-dark .v5-draft-badge{background:#312e81;color:#e0e7ff}body.pro-dark .v4-actions .v5-main{background:#312e81;color:#eef2ff;border-color:#6366f1}body.pro-dark .v5-control-item{background:#1f2937!important;color:#f9fafb!important;border-color:#4b5563!important}body.pro-dark .v5-control-item.done{background:#052e16!important}body.pro-dark .v5-control-item.missing{background:#431407!important}.pro-dark .v5-control-tools>b{color:#cbd5e1}
@media(max-width:850px){.v4-quickbar{grid-template-columns:1fr}.v5-draft-badge{text-align:center}.v5-control-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.v5-control-grid{grid-template-columns:repeat(2,1fr)}.v5-control-tools{align-items:stretch;flex-direction:column}.v5-control-footer{display:grid;grid-template-columns:1fr 1fr}.v5-control-footer button{width:100%}}

/* Draft UI removed in clean build */
.v5-draft-badge{display:none!important}

/* ==========================================================================
   SOURCE CSS: ui-modern.css
   ========================================================================== */
/* ===== Khmer Lottery PRO V5 — Modern UI ===== */
:root{
  --ui-bg:#f5f7fb;--ui-card:#ffffff;--ui-text:#172033;--ui-muted:#667085;
  --ui-border:#e4e8f0;--ui-primary:#4f46e5;--ui-primary-dark:#4338ca;
  --ui-soft:#eef2ff;--ui-success:#15803d;--ui-warn:#b45309;
  --ui-radius:18px;--ui-shadow:0 10px 30px rgba(25,35,58,.08);
}
html{scroll-behavior:smooth}
body{background:linear-gradient(180deg,#f8faff 0,#f5f7fb 260px,#f5f7fb 100%);color:var(--ui-text)}
.app{max-width:1380px;padding:24px}

/* Header */
.app>header{position:relative;overflow:hidden;padding:24px 26px;margin-bottom:18px;border:1px solid #dfe4f3;border-radius:22px;background:linear-gradient(135deg,#ffffff 0%,#f2f4ff 100%);box-shadow:var(--ui-shadow)}
.app>header:after{content:"";position:absolute;width:180px;height:180px;border-radius:50%;right:-55px;top:-95px;background:rgba(79,70,229,.10)}
.app>header h1{position:relative;z-index:1;font-size:clamp(22px,3vw,34px);line-height:1.25;letter-spacing:-.3px;color:#172033}
.app>header p{position:relative;z-index:1;margin-top:8px!important;margin-bottom:0!important;font-size:14px;color:var(--ui-muted)}
.v4-title-badge{background:var(--ui-primary)!important;padding:6px 9px!important;box-shadow:0 4px 12px rgba(79,70,229,.22)}

/* Main control toolbar */
.toolbar{display:grid!important;grid-template-columns:auto minmax(250px,1fr) 170px 170px minmax(300px,auto);gap:10px!important;align-items:center!important;padding:14px!important;margin-bottom:14px!important;border:1px solid var(--ui-border)!important;border-radius:var(--ui-radius)!important;background:rgba(255,255,255,.94)!important;box-shadow:var(--ui-shadow)!important;backdrop-filter:blur(10px)}
.toolbar .upload-btn,.toolbar button{min-height:42px}
.upload-btn,#scanBtn{background:var(--ui-primary)!important;color:#fff!important;box-shadow:0 6px 14px rgba(79,70,229,.18)}
.upload-btn:hover,#scanBtn:hover{background:var(--ui-primary-dark)!important;transform:translateY(-1px)}
.paste-zone{min-width:0!important;min-height:58px;display:flex;flex-direction:column;justify-content:center;border:1.5px dashed #aeb7c8!important;background:#fafbff;border-radius:13px!important;transition:.18s}
.paste-zone:hover,.paste-zone:focus{border-color:var(--ui-primary)!important;background:var(--ui-soft);box-shadow:0 0 0 3px rgba(79,70,229,.08)}
.mode-select{min-width:0!important;width:100%;min-height:42px}
.date-control{display:grid!important;grid-template-columns:1fr auto;gap:6px!important;align-items:end;min-width:300px}
.date-control label{grid-column:1/-1;color:var(--ui-muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px}
.date-control input{height:42px;border:1px solid #d7dce6;border-radius:10px;padding:0 10px;background:#fff}
#todayCambodiaBtn{height:42px;margin:0!important}
#resetBtn{background:#fff!important}
#status{grid-column:1/-1;display:flex;align-items:center;min-height:34px;padding:8px 11px;border-radius:10px;background:#f7f8fc;color:#475467;font-size:12px;font-weight:800;border:1px solid #eceff5}

/* Quick bar */
.v4-quickbar{grid-template-columns:170px 1fr auto!important;padding:12px 14px!important;border-radius:var(--ui-radius)!important;border-color:var(--ui-border)!important;box-shadow:0 7px 22px rgba(25,35,58,.055)!important;margin:0 0 14px!important}
.v4-brand b{font-size:16px!important;color:#202939}.v4-brand span{margin-top:3px}.v4-actions{justify-content:flex-start!important}
.v4-actions button,.v4-import{min-height:38px;border:1px solid #dde2eb!important;background:#fff!important;color:#344054!important;border-radius:10px!important}
.v4-actions button:hover,.v4-import:hover{border-color:#bfc7d7!important;background:#f8f9fc!important;transform:translateY(-1px)}
.v4-actions .v5-main{background:var(--ui-soft)!important;color:#3730a3!important;border-color:#c7d2fe!important}
.v4-quality,.v5-draft-badge{border:1px solid #e4e7ec!important;border-radius:10px!important}

/* Advanced toolbar */
.pro-toolbar{padding:10px!important;margin-bottom:14px;border:1px solid var(--ui-border);border-radius:16px;background:#fff;box-shadow:0 5px 18px rgba(25,35,58,.04)}
.pro-actions{gap:7px!important}.pro-actions button{min-height:36px!important;padding:8px 10px!important;font-size:12px!important;border:1px solid #e0e4ec!important;border-radius:9px!important;background:#fff!important;color:#344054!important}
.pro-actions button:hover{background:#f8f9fc!important;border-color:#c4cad6!important}
.zoom-text{min-width:52px;text-align:center;padding:8px 4px;font-weight:900;color:#475467}

/* Main workspace */
.layout{grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr)!important;gap:18px!important;align-items:start!important}
.panel{border:1px solid var(--ui-border)!important;border-radius:20px!important;padding:18px!important;background:var(--ui-card)!important;box-shadow:var(--ui-shadow)!important}
.panel>h2,.result-head h2{margin:0!important;font-size:17px!important;color:#202939;letter-spacing:-.1px}
.result-head{padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid #eef0f4}
.result-head button{min-height:36px;background:#fff!important;color:#344054!important;border:1px solid #dfe3ea!important}
.preview-box{height:430px!important;margin-top:14px;border:1.5px dashed #c8cfdb!important;border-radius:16px!important;background:linear-gradient(135deg,#fbfcfe,#f6f8fc)!important}
.preview-box:empty:after{content:"រូបភាពនឹងបង្ហាញនៅទីនេះ";color:#98a2b3;font-size:13px}
.preview-box img{border-radius:10px}
.progress{padding:8px 0}.track{height:7px!important;background:#eef0f5!important}.track div{background:var(--ui-primary)!important}

/* Editors */
.abcdh-editor,.night-fields,.field-group{border-color:#edf0f5!important}
.abcdh-editor{margin-top:12px;padding:14px!important;border:1px solid #e7eaf0!important;border-radius:14px;background:#fafbfc}
.editor-title{font-size:14px!important;color:#344054}
.editor-grid{gap:9px!important}
.editor-grid label,.night-fields label{color:#667085!important;font-size:11px!important}
.num-input,.abcdh-editor input,.night-fields input{min-height:40px;border:1px solid #d9dee8!important;border-radius:10px!important;background:#fff!important;transition:.15s}
.num-input:focus,.abcdh-editor input:focus,.night-fields input:focus{outline:none;border-color:#818cf8!important;box-shadow:0 0 0 3px rgba(99,102,241,.11)}
.full,#applyABCDH,#applyEveningABCD,#apply430{min-height:42px;background:var(--ui-primary)!important;border-radius:11px!important}
.sat-info,.v4-missing-times{border-radius:12px!important;border-color:#e8ebf1!important;background:#fafbfc!important;color:#475467}

/* Result card stage */
.layout>.panel:nth-child(2){background:linear-gradient(180deg,#fff,#fbfcff)!important}
.layout>.panel:nth-child(2)>:not(.result-head){position:relative}
.ticket,.night-exact-card,.time130-card,.compact-result-card,.only430-card{box-shadow:0 13px 34px rgba(17,24,39,.14);border-color:#263043!important}
.v5-editable-result:hover{box-shadow:inset 0 0 0 1px #818cf8!important;background:#eef2ff!important}
.v5-editable-result:focus{box-shadow:inset 0 0 0 2px #6366f1!important;background:#eef2ff!important}

/* Dashboard / modals */
.pro-modal{background:rgba(15,23,42,.48)!important;backdrop-filter:blur(5px)}
.pro-modal-card{border:1px solid rgba(255,255,255,.5)!important;border-radius:20px!important;box-shadow:0 24px 70px rgba(15,23,42,.28)!important}
.pro-modal-head{padding-bottom:12px;border-bottom:1px solid #eef0f4}.pro-modal-head h3{margin:0;color:#202939}
.v5-control-item{border-radius:13px!important;box-shadow:0 4px 12px rgba(25,35,58,.04)}
.v5-control-item:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(25,35,58,.09)}
.v5-control-item.done{background:#f0fdf4!important}.v5-control-item.missing{background:#fffaf3!important}

/* Common controls */
button,.upload-btn,select,.v4-import{transition:transform .15s,box-shadow .15s,background .15s,border-color .15s}
button:active,.upload-btn:active,.v4-import:active{transform:translateY(0)!important}
select{border:1px solid #d9dee8!important;background-color:#fff!important;color:#344054!important}
button.light{background:#fff;color:#344054;border:1px solid #dfe3ea}

/* Dark mode */
body.pro-dark{--ui-bg:#0f172a;--ui-card:#151e2f;--ui-text:#f1f5f9;--ui-muted:#94a3b8;--ui-border:#2b374b;background:linear-gradient(180deg,#0b1220,#101827 260px,#101827)}
body.pro-dark .app>header{background:linear-gradient(135deg,#151e2f,#17213c);border-color:#2b374b}body.pro-dark .app>header h1,body.pro-dark .panel>h2,body.pro-dark .result-head h2,body.pro-dark .v4-brand b{color:#f1f5f9!important}
body.pro-dark .toolbar,body.pro-dark .panel,body.pro-dark .pro-toolbar,body.pro-dark .v4-quickbar,body.pro-dark .layout>.panel:nth-child(2){background:#151e2f!important;border-color:#2b374b!important}
body.pro-dark .paste-zone,body.pro-dark .preview-box,body.pro-dark .abcdh-editor,body.pro-dark .sat-info{background:#111a2a!important;border-color:#354158!important;color:#cbd5e1}
body.pro-dark #status{background:#111a2a;border-color:#2b374b;color:#cbd5e1}
body.pro-dark select,body.pro-dark input,body.pro-dark button.light,body.pro-dark .pro-actions button,body.pro-dark .v4-actions button,body.pro-dark .v4-import{background:#111a2a!important;color:#e5e7eb!important;border-color:#354158!important}
body.pro-dark .result-head,body.pro-dark .pro-modal-head{border-color:#2b374b}body.pro-dark .pro-modal-card{background:#151e2f!important;color:#e5e7eb}body.pro-dark .pro-modal-head h3{color:#f1f5f9}

/* Responsive */
@media(max-width:1120px){.toolbar{grid-template-columns:auto 1fr 1fr 1fr}.paste-zone{grid-column:span 3}.date-control{grid-column:span 2}.toolbar #scanBtn,.toolbar #resetBtn{align-self:end}.v4-quickbar{grid-template-columns:1fr!important}.v4-brand{text-align:left!important}.v4-actions{justify-content:flex-start!important}.v4-quality{text-align:left!important}}
@media(max-width:850px){.app{padding:12px!important}.app>header{padding:18px;margin-bottom:12px}.toolbar{display:grid!important;grid-template-columns:1fr 1fr!important;padding:12px!important}.toolbar .upload-btn{grid-column:1/-1;text-align:center}.paste-zone{grid-column:1/-1!important;min-height:72px}.mode-select{width:100%}.date-control{grid-column:1/-1!important;min-width:0!important}.toolbar #scanBtn,.toolbar #resetBtn{width:100%}#status{grid-column:1/-1}.layout{grid-template-columns:1fr!important}.preview-box{height:330px!important}.panel{padding:14px!important;border-radius:16px!important}.v4-actions{display:grid!important;grid-template-columns:repeat(2,1fr)!important}.v4-actions>*{width:100%;justify-content:center}.pro-actions{display:grid!important;grid-template-columns:repeat(3,1fr)!important}.pro-actions button{width:100%}body.v4-sticky .layout>.panel:nth-child(2){position:static!important}}
@media(max-width:520px){.app{padding:8px!important}.app>header{border-radius:16px;padding:15px}.app>header h1{font-size:22px}.toolbar{grid-template-columns:1fr!important}.mode-select,.toolbar #scanBtn,.toolbar #resetBtn{grid-column:1/-1}.date-control{grid-template-columns:1fr!important}.date-control label,.date-control input,#todayCambodiaBtn{grid-column:1/-1!important;width:100%}.v4-actions{grid-template-columns:1fr 1fr!important}.pro-actions{grid-template-columns:1fr 1fr!important}.preview-box{height:270px!important}.v5-control-grid{grid-template-columns:1fr 1fr!important}.panel{padding:11px!important}.ticket,.night-exact-card{max-width:100%!important}}

/* Clean toolbar: brand/draft/rotate controls removed */
.v4-quickbar{grid-template-columns:minmax(0,1fr) auto!important}
.v4-actions{justify-content:flex-start!important}

/* ==========================================================================
   SOURCE CSS: mobile-fix.css
   ========================================================================== */
/* Khmer Lottery PRO V5 — Phone Stability Fix */
html,body{max-width:100%;overflow-x:hidden}
body{-webkit-text-size-adjust:100%}
img,canvas{max-width:100%}

@media(max-width:850px){
  .app{width:100%;max-width:100%;overflow:visible}
  .toolbar,.pro-toolbar{position:static!important;top:auto!important;left:auto!important;right:auto!important;z-index:auto!important}
  .layout,.panel,.toolbar,.pro-toolbar,.v4-quickbar,.date-control,.paste-zone,.preview-box,.result-head{min-width:0!important;max-width:100%!important}
  .toolbar>*{min-width:0!important}
  .date-control input,.date-control button,.mode-select,select,button,.upload-btn{max-width:100%!important}
  .result-head{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
  .result-head h2{flex:1 1 160px;min-width:0}
  .result-head button{flex:0 0 auto}
  .result-zoomable{transform:none!important;margin-bottom:0!important}
  body.v4-sticky .layout>.panel:nth-child(2){position:static!important;top:auto!important}
  .pro-modal{padding:10px!important;overflow-y:auto!important;align-items:flex-start!important}
  .pro-modal-card{width:min(100%,760px)!important;max-width:100%!important;max-height:none!important;margin:10px auto!important;overflow:auto!important}
  .history-item{grid-template-columns:1fr!important}
  .history-buttons{flex-wrap:wrap!important}
  .dashboard-tools,.settings-actions{flex-wrap:wrap!important}
  .dashboard-tools>*{max-width:100%!important}
}

@media(max-width:520px){
  .app{padding:6px!important}
  .app>header{margin-left:0!important;margin-right:0!important}
  .toolbar{grid-template-columns:minmax(0,1fr)!important;padding:9px!important;border-radius:14px!important}
  .toolbar .upload-btn,.paste-zone,.mode-select,.date-control,#scanBtn,#resetBtn,#status{grid-column:1!important;width:100%!important}
  .date-control{grid-template-columns:minmax(0,1fr)!important}
  .date-control label,.date-control input,#todayCambodiaBtn{grid-column:1!important;width:100%!important;max-width:none!important}
  .v4-actions,.pro-actions,.v5-control-grid,.v5-control-footer{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  .v4-actions>*,.pro-actions>*,.v5-control-footer>*{min-width:0!important;width:100%!important;white-space:normal!important}
  .panel{width:100%!important;padding:9px!important}
  .preview-box{height:min(58vh,300px)!important}
  .editor-grid,.editor-grid-3,.editor-grid-4,.night-input-grid,.night-grid-3,.night-grid-4,.t130-editor-grid{grid-template-columns:1fr!important}
  .night-list-inputs{grid-template-columns:1fr!important;max-height:none!important}
  .ticket,.night-exact-card,.time130-card,.compact-result-card,.only430-card,.manual-result-preview{max-width:100%!important;margin-left:auto!important;margin-right:auto!important}
  .pro-modal{padding:5px!important}
  .pro-modal-card{width:100%!important;margin:5px auto!important;border-radius:14px!important;padding:12px!important}
  .pro-modal-head{display:flex!important;flex-wrap:wrap!important}
  .pro-modal-head h3{flex:1 1 180px;min-width:0;word-break:break-word}
  .compare-grid,.dashboard-grid{grid-template-columns:1fr!important}
}

@media(max-width:380px){
  .v4-actions,.pro-actions,.v5-control-grid,.v5-control-footer{grid-template-columns:1fr!important}
  .app>header h1{font-size:19px!important}
  .paste-zone{font-size:12px!important}
  button,.upload-btn,select{font-size:12px!important;padding-left:8px!important;padding-right:8px!important}
}


/* Auto Result phone modal guard */
body.auto-result-open{overflow:hidden!important;touch-action:none}
@media(max-width:650px){
  #autoResultModal{inset:0!important;width:100vw!important;height:100dvh!important}
  #autoResultModal *{box-sizing:border-box}
  #autoResultBody{min-width:0;max-width:100%}
}

/* ==========================================================================
   SOURCE CSS: clean-ui.css
   ========================================================================== */
/* =========================================================
   Khmer Lottery PRO V5 — Clean UI
   Final visual override only. OCR/conversion logic untouched.
   ========================================================= */

:root{
  --clean-bg:#f5f7fb;
  --clean-card:#ffffff;
  --clean-text:#172033;
  --clean-muted:#667085;
  --clean-border:#e3e8f1;
  --clean-primary:#4f46e5;
  --clean-primary-hover:#4338ca;
  --clean-soft:#eef2ff;
  --clean-radius:16px;
  --clean-shadow:0 8px 26px rgba(26,38,68,.07);
}

html,body{background:var(--clean-bg)!important}
body{font-family:Arial,"Noto Sans Khmer",sans-serif!important;color:var(--clean-text)!important}
.app{max-width:1360px!important;padding:18px!important}

/* Header */
.app>header{
  padding:20px 22px!important;
  margin:0 0 14px!important;
  border:1px solid var(--clean-border)!important;
  border-radius:18px!important;
  background:#fff!important;
  box-shadow:var(--clean-shadow)!important;
}
.app>header:after{display:none!important}
.app>header h1{
  margin:0!important;
  font-size:clamp(22px,2.4vw,31px)!important;
  line-height:1.3!important;
  color:#111827!important;
}
.app>header p{
  margin:6px 0 0!important;
  color:var(--clean-muted)!important;
  font-size:13px!important;
}

/* Main controls: predictable two-row desktop layout */
.toolbar{
  display:grid!important;
  grid-template-columns:170px minmax(270px,1fr) 145px 145px minmax(330px,auto)!important;
  grid-template-areas:
    "upload paste day time date"
    "scan reset status status status"!important;
  gap:10px!important;
  padding:14px!important;
  margin:0 0 10px!important;
  align-items:center!important;
  border:1px solid var(--clean-border)!important;
  border-radius:var(--clean-radius)!important;
  background:#fff!important;
  box-shadow:var(--clean-shadow)!important;
}
.toolbar .upload-btn{grid-area:upload}
#pasteZone{grid-area:paste}
#daySelect{grid-area:day}
#timeSelect{grid-area:time}
.date-control{grid-area:date}
#scanBtn{grid-area:scan}
#resetBtn{grid-area:reset}
#status{grid-area:status}

.toolbar .upload-btn,
.toolbar button,
.toolbar select,
.date-control input{
  min-height:42px!important;
  border-radius:10px!important;
}
.upload-btn,#scanBtn{
  background:var(--clean-primary)!important;
  color:#fff!important;
  border:1px solid var(--clean-primary)!important;
  box-shadow:none!important;
}
.upload-btn:hover,#scanBtn:not(:disabled):hover{background:var(--clean-primary-hover)!important}
#resetBtn,.light{
  background:#fff!important;
  color:#344054!important;
  border:1px solid #d8dee9!important;
}
.mode-select{
  width:100%!important;
  min-width:0!important;
  padding:0 34px 0 12px!important;
}
.paste-zone{
  min-width:0!important;
  min-height:58px!important;
  padding:8px 14px!important;
  border:1.5px dashed #c7cfdd!important;
  border-radius:12px!important;
  background:#fafbfe!important;
}
.paste-zone b{font-size:13px!important}
.paste-zone small{font-size:11px!important;color:#7b8495!important}
.date-control{
  min-width:0!important;
  display:grid!important;
  grid-template-columns:minmax(150px,1fr) auto!important;
  gap:7px!important;
  align-items:end!important;
}
.date-control label{
  grid-column:1/-1!important;
  font-size:10px!important;
  letter-spacing:.35px!important;
  color:#7b8495!important;
}
.date-control input{
  width:100%!important;
  border:1px solid #d8dee9!important;
  background:#fff!important;
}
#todayCambodiaBtn{white-space:nowrap!important}
#status{
  min-height:42px!important;
  display:flex!important;
  align-items:center!important;
  padding:0 13px!important;
  border:1px solid #e6eaf0!important;
  border-radius:10px!important;
  background:#f8fafc!important;
  color:#475467!important;
  font-size:12px!important;
  font-weight:700!important;
}

/* Primary quick actions */
.v4-quickbar{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
  padding:10px!important;
  margin:0 0 10px!important;
  border:1px solid var(--clean-border)!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 4px 16px rgba(26,38,68,.045)!important;
}
.v4-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:7px!important;
  justify-content:flex-start!important;
}
.v4-actions button,.v4-import{
  min-height:36px!important;
  padding:7px 11px!important;
  border-radius:9px!important;
  font-size:12px!important;
  font-weight:700!important;
  background:#fff!important;
  color:#344054!important;
  border:1px solid #dce2eb!important;
  box-shadow:none!important;
}
.v4-actions .v5-main{
  background:var(--clean-soft)!important;
  color:#3730a3!important;
  border-color:#c7d2fe!important;
}
.v4-actions button:hover,.v4-import:hover{
  background:#f8fafc!important;
  border-color:#c5cedb!important;
  transform:none!important;
}
.v4-quality{
  min-width:145px!important;
  padding:8px 10px!important;
  border-radius:9px!important;
  font-size:11px!important;
  text-align:center!important;
  background:#f8fafc!important;
  border:1px solid #e7ebf1!important;
  color:#667085!important;
}

/* Advanced tools are tucked behind the Tools button.
   Existing #v4More already toggles body.v4-show-tools. */
.pro-toolbar{
  display:none!important;
  padding:10px!important;
  margin:0 0 10px!important;
  border:1px solid var(--clean-border)!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 4px 16px rgba(26,38,68,.045)!important;
}
body.v4-show-tools .pro-toolbar{display:block!important}
.pro-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:7px!important;
}
.pro-actions button{
  width:auto!important;
  min-height:34px!important;
  padding:7px 10px!important;
  border-radius:8px!important;
  font-size:11px!important;
  background:#fff!important;
  color:#475467!important;
  border:1px solid #dfe4eb!important;
}
.zoom-text{
  min-width:48px!important;
  padding:7px 4px!important;
  font-size:12px!important;
}

/* Workspace */
.layout{
  display:grid!important;
  grid-template-columns:minmax(0,1.08fr) minmax(370px,.92fr)!important;
  gap:14px!important;
  align-items:start!important;
}
.panel{
  padding:15px!important;
  border:1px solid var(--clean-border)!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:var(--clean-shadow)!important;
}
.panel>h2,.result-head h2{
  font-size:16px!important;
  color:#202939!important;
}
.result-head{
  min-height:42px!important;
  padding:0 0 10px!important;
  margin:0 0 12px!important;
  border-bottom:1px solid #edf0f4!important;
}
.preview-box{
  height:390px!important;
  margin-top:12px!important;
  border:1.5px dashed #ccd3df!important;
  border-radius:13px!important;
  background:#f9fafc!important;
}
.ticket,.night-exact-card,.time130-card,.compact-result-card,.only430-card,.manual-result-preview{
  box-shadow:0 8px 22px rgba(17,24,39,.10)!important;
}

/* Inputs/editors */
.num-input,
.editor-grid input,
.editor-grid-3 input,
.editor-grid-4 input,
.night-input-grid input,
.night-list-inputs input,
.t130-editor-grid input{
  border:1px solid #d8dee9!important;
  border-radius:9px!important;
  background:#fff!important;
}
.abcdh-editor,.night-fields,.time130-editor,.sat-info,.v4-missing-times{
  border:1px solid #e5e9f0!important;
  border-radius:12px!important;
  background:#fafbfc!important;
}

/* Cleaner modals */
.pro-modal{background:rgba(15,23,42,.42)!important;backdrop-filter:blur(3px)!important}
.pro-modal-card{
  border-radius:17px!important;
  border:1px solid #e5e9f0!important;
  box-shadow:0 22px 60px rgba(15,23,42,.22)!important;
}
.pro-modal-head{border-bottom:1px solid #edf0f4!important}

/* Phone/tablet */
@media(max-width:1080px){
  .toolbar{
    grid-template-columns:150px 1fr 1fr!important;
    grid-template-areas:
      "upload paste paste"
      "day time date"
      "scan reset status"!important;
  }
  .date-control{grid-template-columns:1fr auto!important}
  .layout{grid-template-columns:1fr!important}
  .preview-box{height:340px!important}
}

@media(max-width:720px){
  .app{padding:8px!important}
  .app>header{padding:15px!important;border-radius:14px!important}
  .toolbar{
    grid-template-columns:1fr 1fr!important;
    grid-template-areas:
      "upload upload"
      "paste paste"
      "day time"
      "date date"
      "scan reset"
      "status status"!important;
    padding:10px!important;
  }
  .date-control{grid-template-columns:1fr auto!important}
  .v4-quickbar{grid-template-columns:1fr!important}
  .v4-quality{text-align:left!important;min-width:0!important}
  .v4-actions{display:grid!important;grid-template-columns:1fr 1fr!important}
  .v4-actions button,.v4-import{width:100%!important;justify-content:center!important;text-align:center!important}
  .pro-actions{display:grid!important;grid-template-columns:1fr 1fr!important}
  .pro-actions button{width:100%!important}
  .preview-box{height:290px!important}
  .panel{padding:11px!important;border-radius:14px!important}
}

@media(max-width:420px){
  .toolbar{
    grid-template-columns:1fr!important;
    grid-template-areas:
      "upload"
      "paste"
      "day"
      "time"
      "date"
      "scan"
      "reset"
      "status"!important;
  }
  .date-control{grid-template-columns:1fr!important}
  .date-control label,.date-control input,#todayCambodiaBtn{grid-column:1!important;width:100%!important}
  .v4-actions,.pro-actions{grid-template-columns:1fr 1fr!important}
  .preview-box{height:250px!important}
}

/* ==========================================================================
   SOURCE CSS: auto-result.css
   ========================================================================== */
/* Auto Lottery Result add-on — responsive phone fix */
.auto-result-modal-card{
  max-width:1120px!important;
  width:min(96vw,1120px)!important;
  box-sizing:border-box;
}
.auto-result-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  margin-bottom:12px
}
.auto-result-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
  font-size:12px;
  color:#475467
}
.auto-pill{
  padding:6px 9px;
  border:1px solid #e4e7ec;
  border-radius:999px;
  background:#f8fafc;
  font-weight:800;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.auto-result-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px
}
.auto-api-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin:10px 0
}
.auto-api-box input{
  min-height:40px;
  width:100%;
  min-width:0;
  box-sizing:border-box;
  border:1px solid #d8dee9;
  border-radius:10px;
  padding:0 11px
}
.auto-result-status{
  margin:10px 0;
  padding:10px 12px;
  border:1px solid #e6eaf0;
  border-radius:10px;
  background:#f8fafc;
  font-weight:800;
  font-size:12px;
  line-height:1.45;
  color:#475467;
  overflow-wrap:anywhere
}
.auto-result-status.ok{background:#ecfdf3;border-color:#bbf7d0;color:#166534}
.auto-result-status.bad{background:#fff1f2;border-color:#fecdd3;color:#9f1239}

.auto-result-scroll{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff
}
.auto-result-table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
  font-family:Arial,"Noto Sans Khmer",sans-serif
}
.auto-result-table th,.auto-result-table td{
  border:1px solid #d1d5db;
  padding:7px 8px;
  text-align:center;
  vertical-align:middle
}
.auto-result-table thead th{
  position:sticky;
  top:0;
  background:#f8fafc;
  z-index:2
}
.auto-result-table th:first-child,
.auto-result-table td:first-child{
  position:sticky;
  left:0;
  z-index:1;
  background:#fafafa
}
.auto-result-table thead th:first-child{z-index:3;background:#f8fafc}
.auto-result-table .prize{font-weight:900;white-space:nowrap;background:#fafafa}
.auto-result-table .g8{font-size:28px;font-weight:900;color:#9f1239}
.auto-result-table .g7{font-size:20px;font-weight:900;color:#1d4ed8}
.auto-result-table .special{font-size:25px;font-weight:900;color:#991b1b}
.auto-result-table .nums{white-space:pre-line;font-weight:800;line-height:1.45}
.auto-result-empty{padding:28px;text-align:center;color:#667085}

.auto-schedule{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:10px 0 12px
}
.auto-schedule button{
  padding:7px 9px!important;
  font-size:11px!important;
  background:#fff!important;
  color:#344054!important;
  border:1px solid #d8dee9!important;
  white-space:nowrap
}
.auto-schedule button.active{
  background:#eef2ff!important;
  color:#3730a3!important;
  border-color:#a5b4fc!important
}
.auto-source-note{
  font-size:11px;
  line-height:1.45;
  color:#667085;
  margin:8px 0
}

/* Tablet */
@media(max-width:850px){
  #autoResultModal.pro-modal{
    padding:8px!important;
    align-items:flex-start!important;
    overflow:hidden!important;
  }

  .auto-result-modal-card{
    width:100%!important;
    max-width:100%!important;
    height:calc(100dvh - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
    margin:0 auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }

  #autoResultModal .pro-modal-head{
    position:sticky;
    top:0;
    z-index:20;
    background:#fff;
    margin:-1px -1px 10px;
    padding:2px 2px 10px;
    border-bottom:1px solid #edf0f5;
  }

  .auto-result-top{grid-template-columns:1fr}
  .auto-result-actions{justify-content:stretch}
  .auto-api-box{grid-template-columns:1fr}
  .auto-api-box button{width:100%}
}

/* Phone */
@media(max-width:650px){
  #autoResultModal.pro-modal{padding:0!important}

  .auto-result-modal-card{
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    border-radius:0!important;
    padding:12px!important;
  }

  #autoResultModal .pro-modal-head{
    min-height:48px;
    margin:-12px -12px 10px!important;
    padding:9px 12px!important;
    border-radius:0!important;
  }

  #autoResultModal .pro-modal-head h3{
    font-size:16px!important;
    line-height:1.25;
    margin:0!important;
  }

  #closeAutoResultBtn{
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    padding:0!important;
    flex:0 0 42px!important;
    font-size:18px!important;
  }

  .auto-result-top{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:9px
  }

  .auto-result-meta{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
  }
  .auto-result-meta .auto-pill{
    width:100%;
    box-sizing:border-box;
    text-align:center;
    padding:6px 7px;
    font-size:10px;
  }
  .auto-result-meta .auto-pill:last-child{
    grid-column:1/-1;
  }

  .auto-result-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }
  .auto-result-actions button{
    width:100%!important;
    min-width:0!important;
    min-height:42px;
    padding:8px 6px!important;
    font-size:11px!important;
    line-height:1.25;
    white-space:normal!important;
  }

  .auto-schedule{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:5px;
    margin:8px 0 10px;
  }
  .auto-schedule button{
    width:100%!important;
    min-width:0!important;
    padding:7px 2px!important;
    font-size:9px!important;
    border-radius:8px!important;
  }

  .auto-api-box{gap:6px}
  .auto-api-box input{
    min-height:42px;
    font-size:12px;
  }
  .auto-api-box button{
    min-height:42px;
    font-size:12px!important;
  }

  #autoResultModal label{
    max-width:100%;
    line-height:1.35;
  }

  .auto-result-status{
    font-size:11px;
    padding:9px 10px;
    margin:8px 0;
  }

  .auto-source-note{font-size:10px}

  .auto-result-scroll{
    border-radius:9px;
    margin-bottom:max(8px,env(safe-area-inset-bottom));
  }

  .auto-result-table{
    min-width:600px;
    font-size:11px;
  }
  .auto-result-table th,.auto-result-table td{
    padding:6px 5px;
  }
  .auto-result-table th:first-child,
  .auto-result-table td:first-child{
    min-width:58px;
  }
  .auto-result-table .g8{font-size:22px}
  .auto-result-table .g7{font-size:17px}
  .auto-result-table .special{font-size:20px}
  .auto-result-table .nums{line-height:1.35}
}

/* Small phone */
@media(max-width:420px){
  .auto-result-modal-card{padding:9px!important}

  #autoResultModal .pro-modal-head{
    margin:-9px -9px 9px!important;
    padding:7px 9px!important;
  }

  .auto-result-meta{grid-template-columns:1fr 1fr}
  .auto-result-actions{grid-template-columns:1fr 1fr}

  .auto-schedule{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .auto-schedule button{
    font-size:10px!important;
    min-height:36px;
  }

  .auto-result-table{min-width:560px}
}

/* Very narrow phones */
@media(max-width:340px){
  .auto-result-actions{grid-template-columns:1fr}
  .auto-result-meta{grid-template-columns:1fr}
  .auto-result-meta .auto-pill:last-child{grid-column:auto}
}


/* LIVE inside Bunheng168 - no external website */
.live-lottery-btn{
  background:#b91c1c!important;color:#fff!important;border-color:#991b1b!important;
  white-space:nowrap;min-height:38px;font-weight:900!important;
}
.live-lottery-btn:hover{filter:brightness(.96)}
.live-lottery-btn.is-live{
  background:#15803d!important;border-color:#166534!important;
  box-shadow:0 0 0 4px rgba(34,197,94,.14)!important;
}
.live-inline-banner{
  display:flex;align-items:center;gap:9px;padding:9px 12px;margin:8px 0;
  border-radius:10px;background:linear-gradient(180deg,#d91c1c,#b80f0f);color:#fff;
  border:1px solid #9f1239;box-shadow:inset 0 1px rgba(255,255,255,.25);
  font-size:12px;font-weight:800;
}
.live-inline-banner.hidden{display:none!important}
.live-inline-banner strong{font-size:13px;letter-spacing:.1px}
.live-inline-banner #liveInlineInfo{margin-left:auto;opacity:.95;font-size:11px;text-align:right}
.live-dot{width:9px;height:9px;border-radius:50%;background:#fff;box-shadow:0 0 0 0 rgba(255,255,255,.7);animation:livePulse 1.25s infinite;flex:0 0 auto}
@keyframes livePulse{0%{box-shadow:0 0 0 0 rgba(255,255,255,.65)}70%{box-shadow:0 0 0 7px rgba(255,255,255,0)}100%{box-shadow:0 0 0 0 rgba(255,255,255,0)}}
#autoResultModal .auto-result-table thead th{background:#eef3fb;color:#0b4fc4;font-weight:900}
#autoResultModal .auto-result-table .g8{color:#b91c1c;font-weight:950}
#autoResultModal .auto-result-table .special{color:#b91c1c;font-weight:950;font-size:24px;letter-spacing:2px}
@media(max-width:650px){
  .live-lottery-btn{width:100%!important}
  .live-inline-banner{align-items:flex-start;flex-wrap:wrap;padding:8px 10px}
  .live-inline-banner #liveInlineInfo{width:100%;margin-left:18px;text-align:left;font-size:10px}
}

/* Compact image export: 3 columns only, every number in its own bordered row */
.auto-compact-export-wrap{
  position:fixed;
  left:-10000px;
  top:0;
  z-index:-1;
  background:#fff;
  padding:0;
  margin:0;
  width:max-content;
}
.auto-compact-export-table{
  border-collapse:collapse;
  border-spacing:0;
  table-layout:fixed;
  background:#fff;
  font-family:Arial,"Noto Sans Khmer",sans-serif;
  font-variant-numeric:tabular-nums;
}
.auto-compact-export-table td{
  width:126px;
  min-width:126px;
  height:31px;
  box-sizing:border-box;
  border:1px solid #8f8f8f;
  padding:1px 8px;
  background:#fff;
  color:#111827;
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
  font-size:20px;
  line-height:1.05;
  font-weight:800;
}
.auto-compact-export-table tr.g8 td{
  color:#980000;
  font-size:38px;
  line-height:1;
  font-weight:900;
  height:48px;
}
.auto-compact-export-table tr.g7 td{
  color:#0000d8;
  font-size:23px;
  line-height:1;
  font-weight:900;
  height:31px;
}
.auto-compact-export-table tr.special td{
  color:#980000;
  font-size:29px;
  line-height:1;
  font-weight:900;
  height:40px;
}


/* Night/Mien Bac export used every day at 6:30 PM, 7:30 PM and 8:30 PM. */
.auto-north-export-table{
  border-collapse:collapse;
  border-spacing:0;
  table-layout:fixed;
  width:472px;
  background:#fff;
  font-family:Arial,"Noto Sans Khmer",sans-serif;
  font-variant-numeric:tabular-nums;
}
.auto-north-export-table td{
  box-sizing:border-box;
  border:1px solid #8f8f8f;
  height:31px;
  padding:1px 5px;
  background:#fff;
  color:#111827;
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
  font-size:20px;
  line-height:1.05;
  font-weight:800;
}
.auto-north-export-table tr.special td{
  color:#980000;
  font-size:31px;
  line-height:1;
  height:43px;
  font-weight:900;
}
.auto-north-export-table tr.g1 td{
  color:#111827;
  font-size:24px;
  height:33px;
  font-weight:900;
}
.auto-north-export-table tr.g2 td,
.auto-north-export-table tr.g3 td,
.auto-north-export-table tr.g5 td{
  font-size:18px;
}
.auto-north-export-table tr.g4 td{
  font-size:18px;
}
.auto-north-export-table tr.g6 td{
  font-size:18px;
}
.auto-north-export-table tr.g7 td{
  color:#980000;
  font-size:24px;
  height:35px;
  font-weight:900;
}

/* V-NORTH APP COMPAT: exact compact Miền Bắc geometry for 6:30/7:30/8:30. */
.auto-north-export-wrap{
  width:376px !important;
  height:290px !important;
  overflow:hidden !important;
}
.auto-north-export-table{
  width:376px !important;
  height:290px !important;
  border-collapse:collapse !important;
  border-spacing:0 !important;
  table-layout:fixed !important;
  background:#fff !important;
  font-family:Arial,sans-serif !important;
}
.auto-north-export-table td{
  border:1px solid #929292 !important;
  padding:0 4px !important;
  color:#111827 !important;
  text-align:center !important;
  vertical-align:middle !important;
  white-space:nowrap !important;
  font-weight:800 !important;
  line-height:1.02 !important;
  box-sizing:border-box !important;
}
.auto-north-export-table tr.special td{height:40px !important;font-size:29px !important;color:#980000 !important;font-weight:900 !important;}
.auto-north-export-table tr.g1 td{height:33px !important;font-size:21px !important;font-weight:900 !important;}
.auto-north-export-table tr.g2 td{height:25px !important;font-size:14px !important;}
.auto-north-export-table tr.g3 td{height:42px !important;font-size:14px !important;}
.auto-north-export-table tr.g4 td{height:43px !important;font-size:14px !important;}
.auto-north-export-table tr.g5 td{height:42px !important;font-size:14px !important;}
.auto-north-export-table tr.g6 td{height:25px !important;font-size:14px !important;}
.auto-north-export-table tr.g7 td{height:31px !important;font-size:22px !important;color:#980000 !important;font-weight:900 !important;}
.auto-north-export-table .north-stack-line{height:19px;line-height:19px;display:block;}

/* ==========================================================================
   SOURCE CSS: phone-ui.css
   ========================================================================== */
/* PHONE UI V2 — final override, loaded LAST */
*{box-sizing:border-box}

@media (max-width:768px){
  html,body{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }

  body{
    margin:0!important;
    -webkit-text-size-adjust:100%!important;
  }

  .app{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:8px!important;
    overflow-x:hidden!important;
  }

  .app>header{
    width:100%!important;
    max-width:100%!important;
    margin:0 0 10px!important;
    padding:16px!important;
  }

  .app>header h1{
    margin:0!important;
    font-size:23px!important;
    line-height:1.35!important;
    overflow-wrap:anywhere;
  }

  .app>header p{
    font-size:13px!important;
    line-height:1.5!important;
  }

  /* IMPORTANT: stop desktop grid from leaving empty right side */
  .toolbar{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    gap:9px!important;
    padding:10px!important;
    margin:0 0 10px!important;
  }

  .toolbar > *,
  .toolbar .upload-btn,
  #pasteZone,
  #daySelect,
  #timeSelect,
  .date-control,
  #scanBtn,
  #resetBtn,
  #status{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    grid-column:auto!important;
    grid-area:auto!important;
  }

  .toolbar .upload-btn{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:50px!important;
    padding:10px 12px!important;
  }

  #pasteZone{
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    min-height:96px!important;
    padding:14px!important;
    text-align:center!important;
  }

  #pasteZone b{
    font-size:15px!important;
    line-height:1.35!important;
  }

  #pasteZone small{
    display:block!important;
    margin-top:7px!important;
    font-size:12px!important;
    line-height:1.55!important;
    white-space:normal!important;
  }

  .mode-select,
  #daySelect,
  #timeSelect{
    display:block;
    min-height:46px!important;
    padding-left:12px!important;
    font-size:15px!important;
  }

  .date-control{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:7px!important;
  }

  .date-control label,
  .date-control input,
  #todayCambodiaBtn{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  .date-control input{
    min-height:48px!important;
    font-size:16px!important;
    text-align:center!important;
  }

  #todayCambodiaBtn,
  #scanBtn,
  #resetBtn{
    min-height:48px!important;
    white-space:normal!important;
  }

  #status{
    min-height:48px!important;
    padding:11px 12px!important;
    line-height:1.35!important;
    overflow-wrap:anywhere!important;
  }

  .pro-toolbar{
    width:100%!important;
    max-width:100%!important;
    padding:10px!important;
  }

  .pro-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }

  .pro-actions > *{
    min-width:0!important;
    max-width:100%!important;
  }

  .pro-actions button{
    width:100%!important;
    min-height:44px!important;
    padding:8px 6px!important;
    font-size:12px!important;
    white-space:normal!important;
    line-height:1.25!important;
  }

  .layout,
  .panel{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  .layout{
    display:block!important;
  }

  .panel{
    padding:10px!important;
    margin-bottom:10px!important;
  }

  .preview-box{
    width:100%!important;
    max-width:100%!important;
    height:min(55vh,290px)!important;
  }

  img,canvas{
    max-width:100%!important;
    height:auto;
  }
}

@media (max-width:430px){
  .app{padding:6px!important}

  .app>header{
    padding:14px!important;
    border-radius:14px!important;
  }

  .app>header h1{
    font-size:20px!important;
  }

  .toolbar{
    padding:9px!important;
    border-radius:14px!important;
  }

  .pro-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media (max-width:340px){
  .pro-actions{
    grid-template-columns:1fr!important;
  }
}


/* ===== PHONE UI V3 ===== */
@media (max-width:768px){
  /* Keep the desired visual order */
  .toolbar .upload-btn{order:1!important}
  #pasteZone{order:2!important}
  #daySelect{order:3!important}
  #timeSelect{order:4!important}
  .date-control{order:5!important}
  #scanBtn{order:6!important}
  #resetBtn{order:7!important}
  #status{order:8!important}

  /* iPhone date input overflow fix */
  .date-control{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
  }

  .date-control input[type="date"],
  #manualDateInput{
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    inline-size:100%!important;
    min-width:0!important;
    min-inline-size:0!important;
    max-width:100%!important;
    max-inline-size:100%!important;
    margin:0!important;
    padding-left:10px!important;
    padding-right:10px!important;
  }

  #manualDateInput::-webkit-date-and-time-value{
    min-width:0!important;
    text-align:center!important;
  }

  #manualDateInput::-webkit-datetime-edit{
    min-width:0!important;
    padding:0!important;
  }

  #pasteZone{
    min-height:92px!important;
    margin:0!important;
  }

  .toolbar{overflow:hidden!important}
}

@media (max-width:430px){
  #manualDateInput{font-size:16px!important}
}

/* ==========================================================================
   SOURCE CSS: day-sequence-19.css
   ========================================================================== */
/* =========================================================
   DAY SEQUENCE 1..19 ADD-ON
   Visual-only layer. Existing OCR/conversion code is untouched.
   Applies to:
   8:30 AM, 9:30 AM, 10:30 AM, 11:30 AM,
   1:30 PM, 2:30 PM, 4:30 PM.
   Night 6:30/7:30/8:30 PM remains unchanged.
   ========================================================= */

.seq19-list{
  width:100%;
  display:none;
  border-top:1px solid #555;
  font-family:"Times New Roman","Khmer OS Battambang",serif;
  background:#fff;
}

body.seq19-day-active #resultCard .seq19-list,
body.seq19-daytime-active #time130Card .seq19-list{
  display:block;
}

body.seq19-day-active #resultCard > .r:not(.row-a){
  display:none!important;
}

body.seq19-daytime-active #time130Card .t130-g6,
body.seq19-daytime-active #time130Card .t130-g4-source,
body.seq19-daytime-active #time130Card #t130g3Row{
  display:none!important;
}

.seq19-row{
  display:grid;
  grid-template-columns:50px minmax(0,1fr);
  min-height:28px;
  border-bottom:1px solid #777;
}

.seq19-row:last-child{
  border-bottom:0;
}

.seq19-index{
  display:flex;
  align-items:center;
  justify-content:center;
  border-right:1px solid #777;
  font-size:14px;
  font-weight:700;
  line-height:1;
  color:#111;
}

.seq19-value{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:3px 7px;
  font-size:15px;
  font-weight:700;
  line-height:1.2;
  text-align:center;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  outline:none;
}

.seq19-value[contenteditable="true"]:focus{
  background:#fff7ed;
  box-shadow:inset 0 0 0 2px #f59e0b;
}

.seq19-empty{
  color:#444;
}

@media(max-width:520px){
  .seq19-row{
    grid-template-columns:48px minmax(0,1fr);
    min-height:27px;
  }
  .seq19-index{font-size:13px}
  .seq19-value{font-size:14px;padding:3px 5px}
}


/* V2 cleanup: empty prize rows are fully removed. */
.seq19-row[hidden]{display:none!important}

/* Cleaner compact result table. */
.seq19-row{
  grid-template-columns:42px minmax(0,1fr);
  min-height:24px;
}
.seq19-index{
  font-family:Arial,"Noto Sans Khmer",sans-serif;
  font-size:12px;
  font-weight:800;
  background:#fff;
}
.seq19-value{
  min-height:24px;
  padding:2px 8px;
  font-size:13px;
  line-height:1.2;
}
@media(max-width:520px){
  .seq19-row{grid-template-columns:40px minmax(0,1fr);min-height:23px}
  .seq19-index{font-size:11px}
  .seq19-value{min-height:23px;font-size:12px;padding:2px 6px}
}


/* =========================================================
   V3 — ALL REQUESTED DAY TIMES FINAL UI
   ========================================================= */

.seq19-v3{
  width:100%;
  margin:0;
  padding:0;
  background:#fff;
  border-top:1px solid #555;
}

.seq19-v3 .seq19-row{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  min-height:24px;
  margin:0;
  padding:0;
  border-bottom:1px solid #777;
  background:#fff;
}

.seq19-v3 .seq19-row[hidden]{
  display:none!important;
}

.seq19-v3 .seq19-index{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:1px 3px;
  border-right:1px solid #777;
  font-family:Arial,"Noto Sans Khmer",sans-serif;
  font-size:12px;
  line-height:1;
  font-weight:800;
  color:#111;
  background:#fff;
}

.seq19-v3 .seq19-value{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:24px;
  padding:2px 7px;
  font-family:"Times New Roman","Khmer OS Battambang",serif;
  font-size:13px;
  line-height:1.15;
  font-weight:700;
  text-align:center;
  color:#111;
  background:#fff;
  outline:none;
  overflow-wrap:anywhere;
}

.seq19-v3 .seq19-value:focus{
  background:#fff7ed;
  box-shadow:inset 0 0 0 2px #f59e0b;
}

/* Hide ONLY the old prize-number blocks when the new list is active.
   A and the old B/C/D/F/I/N area stay untouched. */
body.seq19-day-active #resultCard > .r:not(.row-a){
  display:none!important;
}

body.seq19-daytime-active #time130Card .t130-g6,
body.seq19-daytime-active #time130Card .t130-g4-source,
body.seq19-daytime-active #time130Card #t130g3Row{
  display:none!important;
}

@media(max-width:520px){
  .seq19-v3 .seq19-row{
    grid-template-columns:38px minmax(0,1fr);
    min-height:23px;
  }

  .seq19-v3 .seq19-index{
    min-height:23px;
    font-size:11px;
  }

  .seq19-v3 .seq19-value{
    min-height:23px;
    padding:2px 5px;
    font-size:12px;
  }
}


/* =========================================================
   V4 — ALIGN NUMBER COLUMN WITH A ROW
   The divider of rows 1,2,3... now lines up exactly with
   the A-row divider for every requested daytime Result.
   ========================================================= */

/* 4:30 PM uses the original ticket grid: 62px | result */
body.seq19-day-active #resultCard .seq19-v3 .seq19-row{
  grid-template-columns:62px minmax(0,1fr)!important;
}

/* 8:30 / 9:30 / 10:30 / 11:30 / 1:30 / 2:30
   use the shared daytime card grid: 105px | result */
body.seq19-daytime-active #time130Card .seq19-v3 .seq19-row{
  grid-template-columns:105px minmax(0,1fr)!important;
}

/* Match the exact divider thickness used by each A row. */
body.seq19-day-active #resultCard .seq19-v3 .seq19-index{
  border-right:1px solid #555!important;
}

body.seq19-daytime-active #time130Card .seq19-v3 .seq19-index{
  border-right:2px solid #111!important;
}

/* Keep the rows compact; empty rows remain removed. */
.seq19-v3 .seq19-row[hidden]{
  display:none!important;
}

@media(max-width:520px){
  /* Preserve alignment even on phones instead of shrinking the number column. */
  body.seq19-day-active #resultCard .seq19-v3 .seq19-row{
    grid-template-columns:62px minmax(0,1fr)!important;
  }

  body.seq19-daytime-active #time130Card .seq19-v3 .seq19-row{
    grid-template-columns:105px minmax(0,1fr)!important;
  }
}

/* ==========================================================================
   SOURCE CSS: premium-ui.css
   ========================================================================== */
/* =========================================================
   BUNHENG168 PREMIUM UI 2026
   Visual/UX layer only. Existing OCR, conversion and result logic untouched.
   Loaded last so it safely overrides older theme layers.
   ========================================================= */
:root{
  --p-bg:#f4f7fb;
  --p-surface:#ffffff;
  --p-surface-2:#f8fafc;
  --p-text:#0f172a;
  --p-muted:#64748b;
  --p-border:#e2e8f0;
  --p-primary:#4f46e5;
  --p-primary-2:#6366f1;
  --p-primary-soft:#eef2ff;
  --p-success:#16a34a;
  --p-danger:#dc2626;
  --p-warning:#d97706;
  --p-radius:18px;
  --p-radius-sm:12px;
  --p-shadow:0 12px 36px rgba(15,23,42,.07);
  --p-shadow-hover:0 16px 44px rgba(15,23,42,.11);
}

*{box-sizing:border-box}
html{background:var(--p-bg);scroll-behavior:smooth}
body{
  margin:0!important;
  color:var(--p-text)!important;
  background:
    radial-gradient(circle at 15% -10%,rgba(99,102,241,.11),transparent 34%),
    radial-gradient(circle at 100% 0,rgba(59,130,246,.07),transparent 28%),
    var(--p-bg)!important;
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,"Noto Sans Khmer",sans-serif!important;
  -webkit-font-smoothing:antialiased;
}

.app{max-width:1440px!important;margin:0 auto!important;padding:20px!important}

/* Hero header */
.app>header{
  position:relative!important;
  overflow:hidden!important;
  margin:0 0 14px!important;
  padding:24px 26px!important;
  border:1px solid rgba(255,255,255,.65)!important;
  border-radius:24px!important;
  background:linear-gradient(135deg,#111827 0%,#312e81 58%,#4f46e5 100%)!important;
  box-shadow:0 18px 45px rgba(49,46,129,.22)!important;
}
.app>header:before{
  content:"";position:absolute;right:-55px;top:-85px;width:230px;height:230px;border-radius:50%;
  background:rgba(255,255,255,.10);filter:blur(1px)
}
.app>header:after{
  content:"PREMIUM"!important;display:block!important;position:absolute!important;right:24px!important;bottom:20px!important;
  width:auto!important;height:auto!important;border-radius:999px!important;padding:7px 11px!important;
  background:rgba(255,255,255,.12)!important;border:1px solid rgba(255,255,255,.18)!important;
  color:#fff!important;font-size:10px!important;font-weight:900!important;letter-spacing:1.5px!important;
}
.app>header h1{position:relative;z-index:2;margin:0!important;color:#fff!important;font-size:clamp(24px,3vw,35px)!important;line-height:1.25!important;letter-spacing:-.4px!important}
.app>header p{position:relative;z-index:2;margin:7px 0 0!important;color:#c7d2fe!important;font-size:13px!important;line-height:1.55!important;max-width:720px}

/* Shared premium cards */
.toolbar,.pro-toolbar,.panel,.v4-quickbar,
.pro-modal-card,.auto-result-modal-card,.v4-missing-times{
  border:1px solid var(--p-border)!important;
  background:rgba(255,255,255,.96)!important;
  box-shadow:var(--p-shadow)!important;
}
.toolbar,.pro-toolbar,.panel,.v4-quickbar{border-radius:var(--p-radius)!important}

/* Main controls */
.toolbar{
  display:grid!important;
  grid-template-columns:170px minmax(250px,1fr) 145px 145px minmax(300px,auto)!important;
  grid-template-areas:"upload paste day time date" "scan reset status status status"!important;
  gap:10px!important;padding:14px!important;margin-bottom:12px!important;align-items:center!important;
}
.toolbar .upload-btn{grid-area:upload}.toolbar #pasteZone{grid-area:paste}.toolbar #daySelect{grid-area:day}.toolbar #timeSelect{grid-area:time}.toolbar .date-control{grid-area:date}.toolbar #scanBtn{grid-area:scan}.toolbar #resetBtn{grid-area:reset}.toolbar #status{grid-area:status}

button,.upload-btn,select,input,textarea{font:inherit}
button,.upload-btn,.mode-select,.date-control input{
  min-height:44px!important;border-radius:12px!important;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background .15s ease!important;
}
button,.upload-btn{font-weight:800!important}
button:not(:disabled):hover,.upload-btn:hover{transform:translateY(-1px)}
button:not(:disabled):active,.upload-btn:active{transform:translateY(0)}

.upload-btn,#scanBtn,.v4-primary-tool{
  border:1px solid var(--p-primary)!important;
  background:linear-gradient(135deg,var(--p-primary),var(--p-primary-2))!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(79,70,229,.20)!important;
}
.light,#resetBtn,.pro-actions button,.v4-actions button{
  background:#fff!important;color:#334155!important;border:1px solid #dbe2ea!important;box-shadow:none!important;
}
.light:hover,#resetBtn:hover,.pro-actions button:hover,.v4-actions button:hover{border-color:#c7d2fe!important;background:#f8faff!important}

.mode-select,.date-control input,.num-input,.night-input,.t130-input{
  color:#0f172a!important;background:#fff!important;border:1px solid #dbe2ea!important;box-shadow:0 1px 2px rgba(15,23,42,.02)!important;
}
.mode-select:focus,.date-control input:focus,.num-input:focus,.night-input:focus,.t130-input:focus{
  outline:none!important;border-color:#818cf8!important;box-shadow:0 0 0 4px rgba(99,102,241,.11)!important;
}

.paste-zone{
  min-width:0!important;min-height:60px!important;padding:10px 14px!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  border:1.5px dashed #a5b4fc!important;border-radius:14px!important;background:#f8faff!important;color:#3730a3!important;
}
.paste-zone:hover,.paste-zone:focus{background:#eef2ff!important;border-color:#6366f1!important;box-shadow:0 0 0 4px rgba(99,102,241,.08)!important}
.paste-zone small{color:#7c83a1!important}

#status{min-height:42px;padding:10px 12px!important;border-radius:12px!important;background:#f8fafc!important;border:1px solid #edf0f4!important;color:#475569!important;display:flex!important;align-items:center!important;overflow-wrap:anywhere}

/* Secondary tool strip */
.pro-toolbar,.v4-quickbar{padding:10px 12px!important;margin-bottom:12px!important}
.pro-actions,.v4-actions{gap:7px!important}
.pro-actions button,.v4-actions button{min-height:38px!important;padding:8px 11px!important;font-size:12px!important}
#v5SmartRecheck,#v5Control{background:var(--p-primary-soft)!important;border-color:#c7d2fe!important;color:#3730a3!important}
#v5Png{background:#f0fdf4!important;border-color:#bbf7d0!important;color:#166534!important}

/* Workspace */
.layout{grid-template-columns:minmax(0,.92fr) minmax(390px,1.08fr)!important;gap:14px!important;align-items:start!important}
.panel{padding:16px!important}
.panel:hover{box-shadow:var(--p-shadow-hover)!important}
.panel h2,.result-head h2{color:#111827!important;letter-spacing:-.2px!important}
.result-head{padding-bottom:10px!important;margin-bottom:10px!important;border-bottom:1px solid #edf0f4!important;gap:10px!important}

.preview-box{
  height:390px!important;border:1.5px dashed #cbd5e1!important;border-radius:16px!important;background:linear-gradient(180deg,#fbfdff,#f8fafc)!important;
}
.preview-box img{border-radius:10px!important}

/* Result ticket: preserve print/result geometry, refine outer presentation */
.ticket,.night-exact-card,.time130-card,.compact-result-card,.only430-card,.manual-result-preview{
  box-shadow:0 10px 28px rgba(15,23,42,.10)!important;
}
.result-zoomable{padding:8px 0 14px!important}
.v5-editable-result:hover{background:#fff7ed!important}
.v5-editable-result:focus{box-shadow:inset 0 0 0 2px #f59e0b!important}

/* Editors / form groups */
.field-group,.editor-card,.night-editor,.t130-editor,.manual-editor{
  border-color:#e8edf3!important;
}
.field-group label{color:#334155!important}
.num-input{font-size:17px!important}

/* Progress */
.track{height:9px!important;background:#eef2f7!important}
.track div{background:linear-gradient(90deg,#4f46e5,#818cf8)!important}

/* Modals */
.pro-modal{background:rgba(15,23,42,.55)!important;backdrop-filter:blur(7px)!important;padding:18px!important}
.pro-modal-card,.auto-result-modal-card{border-radius:22px!important;padding:18px!important;box-shadow:0 25px 70px rgba(15,23,42,.28)!important}
.pro-modal-head{padding-bottom:12px!important;margin-bottom:12px!important;border-bottom:1px solid #edf0f4!important}
.pro-modal-head h3{margin:0!important;color:#0f172a!important}

/* Auto Result */
.auto-result-status{border-radius:12px!important;background:#f8fafc!important;border-color:#e2e8f0!important}
.auto-result-scroll{border-radius:14px!important;border-color:#e2e8f0!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)!important}
.auto-result-table thead th{background:#f8fafc!important;color:#334155!important}
.auto-pill{background:#f8fafc!important;border-color:#e2e8f0!important;color:#475569!important}
.auto-schedule button.active{background:var(--p-primary)!important;color:#fff!important;border-color:var(--p-primary)!important}

/* Control center */
.v5-control-item{border-radius:14px!important;box-shadow:0 2px 8px rgba(15,23,42,.04)!important}
.v5-control-item.done{background:#f0fdf4!important;border-color:#bbf7d0!important}
.v5-control-item.missing{background:#fffaf0!important;border-color:#fed7aa!important}

/* Scrollbars */
*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
*::-webkit-scrollbar{width:8px;height:8px}
*::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
*::-webkit-scrollbar-track{background:transparent}

/* Tablet */
@media(max-width:1050px){
  .toolbar{grid-template-columns:1fr 1fr!important;grid-template-areas:"upload paste" "day time" "date date" "scan reset" "status status"!important}
  .date-control{min-width:0!important}
  .layout{grid-template-columns:1fr!important}
  .preview-box{height:min(48vh,390px)!important}
}

/* Phone: app-like stacked UI */
@media(max-width:768px){
  body{background:#f6f8fc!important}
  .app{width:100%!important;max-width:100%!important;padding:8px!important;overflow-x:hidden!important}
  .app>header{border-radius:18px!important;padding:19px 17px 18px!important;margin-bottom:9px!important;box-shadow:0 12px 28px rgba(49,46,129,.20)!important}
  .app>header:after{right:14px!important;bottom:12px!important;font-size:8px!important;padding:5px 8px!important}
  .app>header h1{font-size:22px!important;padding-right:0!important;max-width:88%!important}
  .app>header p{font-size:12px!important;max-width:82%!important}

  .toolbar{display:flex!important;flex-direction:column!important;width:100%!important;gap:8px!important;padding:10px!important;margin-bottom:9px!important;border-radius:16px!important}
  .toolbar>*{width:100%!important;max-width:100%!important;min-width:0!important;grid-area:auto!important}
  .toolbar .upload-btn,#scanBtn,#resetBtn{min-height:48px!important}
  .paste-zone{min-height:82px!important;padding:12px!important}
  .date-control{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;width:100%!important}
  .date-control>*{width:100%!important;max-width:100%!important;grid-column:1!important}
  #status{font-size:12px!important;line-height:1.45!important}

  .pro-toolbar,.v4-quickbar{border-radius:16px!important;padding:9px!important;margin-bottom:9px!important}
  .pro-actions,.v4-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:7px!important}
  .pro-actions>* ,.v4-actions>*{width:100%!important;min-width:0!important;min-height:43px!important;justify-content:center!important;white-space:normal!important;line-height:1.25!important}

  .layout{display:block!important}
  .panel{width:100%!important;padding:10px!important;border-radius:16px!important;margin-bottom:9px!important;box-shadow:0 7px 22px rgba(15,23,42,.06)!important}
  .preview-box{height:min(48vh,310px)!important;border-radius:14px!important}
  .result-head{display:flex!important;align-items:center!important;flex-wrap:wrap!important}
  .result-head h2{flex:1 1 150px!important;font-size:18px!important}

  .result-zoomable{width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;padding:5px 0 12px!important}
  .ticket,.night-exact-card,.time130-card,.compact-result-card,.only430-card,.manual-result-preview{max-width:100%!important;margin-left:auto!important;margin-right:auto!important;box-shadow:0 8px 20px rgba(15,23,42,.08)!important}

  .editor-grid,.editor-grid-3,.editor-grid-4,.night-input-grid,.night-grid-3,.night-grid-4,.t130-editor-grid{grid-template-columns:1fr!important}
  .num-input,.night-input,.t130-input{min-height:44px!important;font-size:16px!important}

  .pro-modal{padding:0!important;align-items:flex-end!important}
  .pro-modal-card,.auto-result-modal-card{width:100%!important;max-width:100%!important;max-height:94vh!important;margin:0!important;border-radius:22px 22px 0 0!important;padding:14px!important;overflow:auto!important}
  .pro-modal-head{position:sticky!important;top:-14px!important;z-index:20!important;background:#fff!important;padding:14px 0 10px!important}
  .auto-result-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  .auto-result-actions button{width:100%!important}
  .auto-api-box{grid-template-columns:1fr!important}
  .auto-api-box button{width:100%!important}
  .auto-result-table{min-width:680px!important}

  .v5-control-grid{grid-template-columns:1fr 1fr!important}
  .v5-control-item{min-height:76px!important}
}

@media(max-width:390px){
  .app{padding:6px!important}
  .app>header h1{font-size:20px!important}
  .app>header p{font-size:11px!important}
  .pro-actions,.v4-actions{grid-template-columns:1fr!important}
  .v5-control-grid{grid-template-columns:1fr 1fr!important}
  .toolbar,.panel{border-radius:14px!important}
}

/* Respect dark-mode class where the old app enables it */
body.pro-dark{--p-bg:#0b1220;--p-surface:#111827;--p-surface-2:#182235;--p-text:#f8fafc;--p-muted:#94a3b8;--p-border:#2b3649;background:#0b1220!important;color:#f8fafc!important}
body.pro-dark .toolbar,body.pro-dark .pro-toolbar,body.pro-dark .panel,body.pro-dark .v4-quickbar,body.pro-dark .pro-modal-card{background:#111827!important;border-color:#2b3649!important}
body.pro-dark .mode-select,body.pro-dark input,body.pro-dark textarea,body.pro-dark .light{background:#182235!important;color:#f8fafc!important;border-color:#334155!important}

/* ==========================================================================
   SOURCE CSS: premium-khmer.css
   ========================================================================== */
/* Bunheng168 Premium Khmer UI — final visual layer */
:root{
  --kh-primary:#5b5bd6;
  --kh-primary-2:#7775e8;
  --kh-ink:#192033;
  --kh-muted:#6b7280;
  --kh-border:#dfe4ec;
  --kh-soft:#f7f8fc;
  --kh-card:#ffffff;
  --kh-radius:16px;
}

body{font-family:"Noto Sans Khmer",Arial,sans-serif!important}

/* Date control: premium app-style */
.date-control{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"label label" "date today"!important;
  gap:7px 8px!important;
  align-items:center!important;
  min-width:0!important;
  padding:0!important;
  background:transparent!important;
}
.date-control label{
  grid-area:label!important;
  margin:0!important;
  font-size:11px!important;
  line-height:1.2!important;
  font-weight:800!important;
  color:var(--kh-muted)!important;
  letter-spacing:0!important;
  text-transform:none!important;
}
#manualDateInput{
  grid-area:date!important;
  width:100%!important;
  min-width:0!important;
  height:46px!important;
  padding:0 12px!important;
  border:1px solid var(--kh-border)!important;
  border-radius:13px!important;
  background:#fff!important;
  color:var(--kh-ink)!important;
  font-size:15px!important;
  font-weight:800!important;
  box-shadow:0 1px 2px rgba(16,24,40,.03)!important;
  outline:none!important;
}
#manualDateInput:focus{
  border-color:#aaa9ef!important;
  box-shadow:0 0 0 4px rgba(91,91,214,.10)!important;
}
#todayCambodiaBtn{
  grid-area:today!important;
  height:46px!important;
  min-width:138px!important;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid #d9def0!important;
  border-radius:13px!important;
  background:#fff!important;
  color:#27304a!important;
  font-size:13px!important;
  font-weight:800!important;
  white-space:nowrap!important;
  box-shadow:0 1px 2px rgba(16,24,40,.03)!important;
}
#todayCambodiaBtn:hover{background:#f8f8ff!important;border-color:#bbbaf0!important;color:#4c4cc3!important}

/* Main action buttons */
#scanBtn,.upload-btn{
  background:linear-gradient(135deg,var(--kh-primary),var(--kh-primary-2))!important;
  border-color:transparent!important;
  box-shadow:0 7px 18px rgba(91,91,214,.18)!important;
}
#resetBtn{background:#fff!important;border:1px solid var(--kh-border)!important;color:#344054!important}

/* Better Khmer text rhythm */
button,.upload-btn,select,input,label,.paste-zone{font-family:"Noto Sans Khmer",Arial,sans-serif!important}
button{letter-spacing:0!important}

/* Phone: date becomes clean full-width card */
@media(max-width:768px){
  .date-control{
    grid-template-columns:minmax(0,1fr) 124px!important;
    grid-template-areas:"label label" "date today"!important;
    width:100%!important;
    padding:0!important;
  }
  #manualDateInput,#todayCambodiaBtn{height:48px!important;border-radius:14px!important}
  #todayCambodiaBtn{min-width:0!important;width:124px!important;padding:0 10px!important;font-size:12.5px!important}
}

@media(max-width:430px){
  .date-control{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"label" "date" "today"!important;
    gap:7px!important;
  }
  #todayCambodiaBtn{width:100%!important;min-width:0!important}
}

/* Khmer premium modal headers */
.pro-modal-head h3{line-height:1.45!important}
.settings-grid small{line-height:1.55!important}

/* ===== Premium Khmer V2: compact controls + custom Khmer calendar ===== */
.kh-native-date-hidden{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;padding:0!important;border:0!important}
.date-control{grid-template-columns:minmax(0,1fr) 108px!important;gap:6px!important}
.kh-date-display{grid-area:date!important;width:100%!important;height:40px!important;display:grid!important;grid-template-columns:auto 1fr auto!important;gap:8px!important;align-items:center!important;padding:0 11px!important;border:1px solid #dfe4ec!important;border-radius:11px!important;background:#fff!important;color:#1f2937!important;box-shadow:none!important;text-align:left!important;font-size:13px!important;font-weight:800!important}
.kh-date-display:hover{border-color:#b9b8ef!important;background:#fbfbff!important}
.kh-date-icon{font-size:11px;color:#6262d9}.kh-date-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kh-date-arrow{font-size:12px;color:#8a94a6}
#todayCambodiaBtn{height:40px!important;min-width:108px!important;padding:0 9px!important;border-radius:11px!important;font-size:11.5px!important}
.toolbar{gap:7px!important;padding:10px!important}.toolbar .upload-btn,.toolbar button,.toolbar select{min-height:40px!important}.paste-zone{min-height:52px!important}.mode-select{height:40px!important;min-height:40px!important}

.kh-calendar{position:fixed;z-index:200000;display:none;background:#fff;border:1px solid #e4e7ec;border-radius:16px;padding:10px;box-shadow:0 20px 55px rgba(16,24,40,.18);font-family:"Noto Sans Khmer",Arial,sans-serif;user-select:none}
.kh-calendar.show{display:block;animation:khCalIn .14s ease-out}
@keyframes khCalIn{from{opacity:0;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:none}}
.kh-cal-head{display:grid;grid-template-columns:34px 1fr 34px;align-items:center;gap:6px;margin-bottom:7px}.kh-cal-head>div{text-align:center;line-height:1.2}.kh-cal-head b{display:block;font-size:14px;color:#20283b}.kh-cal-head span{display:block;margin-top:2px;font-size:11px;color:#8a94a6}.kh-cal-nav{width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;border:1px solid #e5e7eb!important;border-radius:10px!important;background:#f8fafc!important;color:#353f56!important;font-size:22px!important;line-height:1!important;box-shadow:none!important}
.kh-cal-week,.kh-cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}.kh-cal-week{margin-bottom:3px}.kh-cal-week span{text-align:center;padding:4px 0;font-size:10px;font-weight:800;color:#98a2b3}
.kh-cal-day{height:32px!important;min-height:32px!important;padding:0!important;border:0!important;border-radius:9px!important;background:transparent!important;color:#344054!important;font:700 11px/1 Arial,"Noto Sans Khmer",sans-serif!important;box-shadow:none!important}.kh-cal-day:hover{background:#f0f1ff!important;color:#4e4ec8!important}.kh-cal-day.outside{color:#c4c9d3!important}.kh-cal-day.today{box-shadow:inset 0 0 0 1px #aaa9ef!important}.kh-cal-day.selected{background:linear-gradient(135deg,#5858d6,#7775e8)!important;color:#fff!important;box-shadow:0 4px 10px rgba(91,91,214,.22)!important}
.kh-cal-foot{display:flex;justify-content:space-between;gap:7px;margin-top:8px;padding-top:8px;border-top:1px solid #eef0f4}.kh-cal-foot button{height:32px!important;min-height:32px!important;padding:0 11px!important;border-radius:9px!important;background:#f6f7fb!important;color:#4b5565!important;border:1px solid #e5e7eb!important;font-size:11px!important;box-shadow:none!important}

@media(max-width:768px){.toolbar{padding:8px!important;gap:7px!important}.date-control{grid-template-columns:minmax(0,1fr) 96px!important}.kh-date-display,#todayCambodiaBtn{height:39px!important;border-radius:10px!important}#todayCambodiaBtn{width:96px!important;min-width:96px!important;font-size:11px!important}.app>header{padding:14px 16px!important}.app>header h1{font-size:20px!important}.panel{padding:10px!important}.pro-toolbar{padding:8px!important}.pro-actions button,.v4-actions button{min-height:36px!important;padding:6px 9px!important;font-size:11px!important}}
@media(max-width:430px){.date-control{grid-template-columns:minmax(0,1fr) 90px!important;grid-template-areas:"label label" "date today"!important}.kh-date-display{height:38px!important;font-size:12px!important}#todayCambodiaBtn{width:90px!important;min-width:90px!important;height:38px!important;padding:0 5px!important;font-size:10.5px!important}.kh-calendar{padding:8px;border-radius:14px}.kh-cal-day{height:31px!important;min-height:31px!important}}

/* ===== Premium Khmer V4: date width follows Khmer date text ===== */
.date-control{
  grid-template-columns:max-content 108px!important;
  justify-content:start!important;
  align-items:end!important;
}
.kh-date-display{
  width:max-content!important;
  min-width:0!important;
  max-width:100%!important;
  grid-template-columns:auto auto auto!important;
  justify-content:start!important;
  padding-left:11px!important;
  padding-right:9px!important;
}
.kh-date-text{
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}
@media(max-width:768px){
  .date-control{
    grid-template-columns:max-content 96px!important;
    justify-content:start!important;
  }
  .kh-date-display{width:max-content!important;max-width:calc(100vw - 145px)!important}
}
@media(max-width:430px){
  .date-control{
    grid-template-columns:max-content 90px!important;
    grid-template-areas:"label label" "date today"!important;
    justify-content:start!important;
  }
  .kh-date-display{width:max-content!important;max-width:calc(100vw - 132px)!important}
}

/* ==========================================================================
   SOURCE CSS: result-row-fix.css
   ========================================================================== */
/* =========================================================
   RESULT ROW FULL-LINE FIX V7
   Keeps every label/result divider stretched to the full row height.
   Visual-only: no OCR/conversion/result formula changes.
   ========================================================= */

/* Shared daytime card: 8:30, 9:30, 10:30, 11:30, 1:30, 2:30 */
.time130-card .t130-mini{
  display:grid!important;
  grid-template-columns:105px minmax(0,1fr)!important;
  align-items:stretch!important;
  min-height:58px!important;
  box-sizing:border-box!important;
}
.time130-card .t130-mini > b{
  height:auto!important;
  min-height:58px!important;
  align-self:stretch!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  border-right:2px solid #111!important;
  margin:0!important;
  padding:0!important;
}
.time130-card .t130-mini > span{
  min-height:58px!important;
  align-self:stretch!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  margin:0!important;
}

/* Make row separators reach from the left outer edge to the right outer edge. */
.time130-card .t130-mini:not(:last-child){
  border-bottom:1px solid #777!important;
}
.time130-card .t130-mini:last-child{
  border-bottom:0!important;
}

/* Main A/source rows also always stretch their divider fully. */
.time130-card .t130-row,
.time130-card #t130g4Source{
  align-items:stretch!important;
}
.time130-card .t130-row > .t130-label,
.time130-card #t130g4Source > .t130-g4-label{
  align-self:stretch!important;
  height:auto!important;
  box-sizing:border-box!important;
}

/* 4:30 PM standard result card. */
#resultCard .r{
  align-items:stretch!important;
}
#resultCard .r > .left{
  align-self:stretch!important;
  height:auto!important;
  box-sizing:border-box!important;
}
#resultCard .mini-row{
  align-items:stretch!important;
}
#resultCard .mini-row > .mini-label{
  align-self:stretch!important;
  height:auto!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}

/* New numbered 1..19 daytime rows. */
.seq19-v3 .seq19-row{
  align-items:stretch!important;
}
.seq19-v3 .seq19-index,
.seq19-v3 .seq19-value{
  align-self:stretch!important;
  box-sizing:border-box!important;
}

/* Compact/special result cards. */
.compact-result-card .compact-row,
.only430-card .compact-row{
  align-items:stretch!important;
}
.compact-result-card .compact-row > div:first-child,
.only430-card .compact-row > div:first-child{
  align-self:stretch!important;
  height:auto!important;
  box-sizing:border-box!important;
}

@media(max-width:520px){
  .time130-card .t130-mini,
  .time130-card .t130-mini > b,
  .time130-card .t130-mini > span{
    min-height:54px!important;
  }
}

/* ==========================================================================
   SOURCE CSS: result-clone.css
   ========================================================================== */
/* =========================================================
   RESULT CLONE 1..4 — V8
   Visual/export layer only. Existing OCR/formula logic untouched.
   ========================================================= */
.clone-result-tools{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 4px;
  padding:9px 10px;
  border:1px solid #e1e7f0;
  border-radius:12px;
  background:#f8fafc;
}
.clone-result-tools .clone-label{
  font-size:12px;
  font-weight:900;
  color:#344054;
  margin-right:2px;
}
.clone-count-group{display:flex;gap:5px;align-items:center}
.clone-count-btn{
  min-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 10px!important;
  border-radius:9px!important;
  border:1px solid #d7deea!important;
  background:#fff!important;
  color:#344054!important;
  font-size:13px!important;
  font-weight:900!important;
  box-shadow:none!important;
}
.clone-count-btn.active{
  background:#4f46e5!important;
  border-color:#4f46e5!important;
  color:#fff!important;
}
.clone-export-spacer{flex:1}
.clone-export-btn{
  min-height:34px!important;
  height:34px!important;
  padding:0 11px!important;
  border-radius:9px!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap;
}
#shareResultBtn{
  min-height:38px!important;
  padding:8px 13px!important;
  border:1px solid #bfe8d7!important;
  background:#eaf9f3!important;
  color:#087653!important;
  box-shadow:none!important;
  font-weight:900!important;
  white-space:nowrap;
}
#shareResultBtn:hover{background:#ddf6ec!important;border-color:#93d7bd!important;box-shadow:0 8px 18px rgba(8,118,83,.11)!important}
#shareResultBtn:disabled{opacity:.65!important;cursor:wait!important;transform:none!important}

.clone-result-section{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e6eaf1;
}
.clone-result-section[hidden]{display:none!important}
.clone-result-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.clone-result-section-head b{font-size:13px;color:#1f2937}
.clone-result-section-head small{font-size:11px;color:#667085}
.clone-result-scroll{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  padding:10px;
  border:1px solid #e2e8f0;
  border-radius:14px;
  background:#fff;
  -webkit-overflow-scrolling:touch;
}
.clone-result-canvas{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  gap:8px;
  width:max-content;
  min-width:100%;
  margin:0 auto;
  background:#fff;
}
.clone-result-copy{
  flex:0 0 auto;
  position:relative;
  overflow:visible;
}
.clone-result-copy .clone-copy-card{
  margin:0!important;
  transform-origin:top left;
}
.clone-result-copy .clone-copy-card [contenteditable="true"]{
  cursor:default!important;
  outline:none!important;
}
.clone-result-copy-number{
  position:absolute;
  z-index:20;
  top:5px;
  right:5px;
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(17,24,39,.78);
  color:#fff;
  font:800 10px/1 Arial,sans-serif;
  pointer-events:none;
}

/* Export mode has no scroll border/padding and keeps a clean white canvas. */
.clone-result-canvas.clone-exporting{
  min-width:0!important;
  width:max-content!important;
  padding:12px!important;
  gap:6px!important;
  background:#fff!important;
}
.clone-result-canvas.clone-exporting .clone-result-copy-number{display:none!important}

@media(max-width:768px){
  .clone-result-tools{gap:6px;padding:8px}
  .clone-result-tools .clone-label{width:100%;margin-bottom:1px}
  .clone-export-spacer{display:none}
  .clone-export-btn{flex:1 1 120px}
  .clone-result-scroll{padding:7px}
  .clone-result-canvas{justify-content:flex-start;gap:6px}
}

@media(max-width:420px){
  .clone-count-btn{min-width:32px!important;padding:0 9px!important}
  .clone-result-section-head{align-items:flex-start;flex-direction:column;gap:2px}
  #shareResultBtn,#downloadBtn{flex:1 1 calc(50% - 4px)!important;font-size:11px!important;padding:7px 8px!important}
}

/* =========================================================
   V9 — CLONE FULL ROW / FULL DIVIDER FIX
   Make every label/value divider touch the row edges exactly.
   Visual-only; result/OCR formulas are unchanged.
   ========================================================= */
.clone-copy-card .r,
.clone-copy-card .mini-row,
.clone-copy-card .compact-row,
.clone-copy-card .seq19-row,
.clone-copy-card .t130-row,
.clone-copy-card .t130-mini{
  align-items:stretch!important;
  box-sizing:border-box!important;
}

.clone-copy-card .left,
.clone-copy-card .mini-label,
.clone-copy-card .compact-row > div:first-child,
.clone-copy-card .seq19-index,
.clone-copy-card .t130-label,
.clone-copy-card .t130-mini > b{
  align-self:stretch!important;
  height:auto!important;
  min-height:100%!important;
  box-sizing:border-box!important;
  margin:0!important;
}

/* The old mini rows sometimes leave a tiny 1px gap at the bottom after
   clone scaling. Draw the divider as a full-height edge on the cell. */
.clone-copy-card .mini-row{
  position:relative!important;
  grid-template-columns:61px minmax(0,1fr)!important;
}
.clone-copy-card .mini-row > .mini-label{
  border-right:0!important;
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
}
.clone-copy-card .mini-row > .mini-label::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  right:-1px;
  width:1px;
  background:#555;
  pointer-events:none;
}

/* Same treatment for numbered 1..19 rows and compact B/C/D/F/I/N rows. */
.clone-copy-card .seq19-row{
  position:relative!important;
}
.clone-copy-card .seq19-index{
  border-right:0!important;
  position:relative!important;
}
.clone-copy-card .seq19-index::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  right:-1px;
  width:1px;
  background:#777;
  pointer-events:none;
}
.clone-copy-card .compact-row{
  position:relative!important;
}
.clone-copy-card .compact-row > div:first-child{
  border-right:0!important;
  position:relative!important;
}
.clone-copy-card .compact-row > div:first-child::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  right:-1px;
  width:1px;
  background:#555;
  pointer-events:none;
}

/* Ensure the very last row meets the card's outside border with no white gap. */
.clone-copy-card .mini-row:last-child,
.clone-copy-card .compact-row:last-child,
.clone-copy-card .seq19-row:last-child{
  margin-bottom:0!important;
}

/* =========================================================
   V10 — READABLE ROW NUMBERS + FULL-SIZE EXPORT
   Keep 1,2,3...19 clear on screen and especially in PNG/JPG.
   ========================================================= */

/* Stronger row indexes in the original + cloned result cards. */
.seq19-v3 .seq19-index,
.clone-copy-card .seq19-v3 .seq19-index{
  font-size:15px!important;
  font-weight:900!important;
  line-height:1!important;
  letter-spacing:0!important;
}

/* Give the numbered rows a little more height so the index stays readable. */
.seq19-v3 .seq19-row,
.clone-copy-card .seq19-v3 .seq19-row{
  min-height:27px!important;
}
.seq19-v3 .seq19-index,
.seq19-v3 .seq19-value,
.clone-copy-card .seq19-v3 .seq19-index,
.clone-copy-card .seq19-v3 .seq19-value{
  min-height:27px!important;
}

/* Result values also get a small readability bump without changing formulas. */
.seq19-v3 .seq19-value,
.clone-copy-card .seq19-v3 .seq19-value{
  font-size:15px!important;
  font-weight:800!important;
}

/* IMPORTANT: preview may scale 4 copies to fit the screen, but exports should
   use the cards at their natural 1:1 size. This makes 1..19 clearly readable. */
.clone-result-canvas.clone-exporting .clone-result-copy{
  width:auto!important;
  height:auto!important;
}
.clone-result-canvas.clone-exporting .clone-copy-card{
  transform:none!important;
  transform-origin:top left!important;
}
.clone-result-canvas.clone-exporting{
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:10px!important;
}

@media(max-width:520px){
  .seq19-v3 .seq19-index,
  .clone-copy-card .seq19-v3 .seq19-index{
    font-size:14px!important;
  }
  .seq19-v3 .seq19-value,
  .clone-copy-card .seq19-v3 .seq19-value{
    font-size:14px!important;
  }
}

/* ==========================================================================
   SOURCE CSS: logo-brand.css
   ========================================================================== */
/* BUNHENG168 brand logo V12 */
.bh168-brand-logo{width:74px;height:74px;object-fit:contain;flex:0 0 auto;filter:drop-shadow(0 6px 12px rgba(0,0,0,.18));}
.bh168-brand-wrap{display:flex;align-items:center;gap:14px;min-width:0;}
.bh168-brand-text{min-width:0;}
@media(max-width:700px){.bh168-brand-logo{width:54px;height:54px}.bh168-brand-wrap{gap:9px}}
@media(max-width:420px){.bh168-brand-logo{width:46px;height:46px}}

/* ==========================================================================
   SOURCE CSS: live-website.css
   ========================================================================== */
.live-main-btn{background:linear-gradient(135deg,#d71920,#a90008)!important;color:#fff!important;border-color:#a90008!important;box-shadow:0 5px 16px rgba(183,0,9,.2)!important;font-weight:900!important}
.live-main-btn:hover{transform:translateY(-1px);filter:brightness(1.04)}
.website-live-modal{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.58);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;padding:14px}
.website-live-modal.hidden{display:none!important}
.website-live-card{width:min(1180px,97vw);height:min(92vh,920px);background:#fff;border-radius:18px;box-shadow:0 28px 80px rgba(2,6,23,.35);overflow:hidden;display:flex;flex-direction:column;border:1px solid rgba(148,163,184,.35)}
.website-live-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid #e5e7eb;background:#fff}
.website-live-head h3{margin:0;display:flex;align-items:center;gap:9px;font-size:17px;color:#111827}
.website-live-head small{display:block;margin-top:3px;color:#64748b;font-size:11px;font-weight:700}
.website-live-head-actions{display:flex;gap:7px}.website-live-head-actions button{min-height:36px}
.live-pulse-dot{width:10px;height:10px;border-radius:999px;background:#ef233c;box-shadow:0 0 0 0 rgba(239,35,60,.7);animation:webLivePulse 1.25s infinite}
@keyframes webLivePulse{70%{box-shadow:0 0 0 8px rgba(239,35,60,0)}100%{box-shadow:0 0 0 0 rgba(239,35,60,0)}}
.website-live-sourcebar{min-height:36px;display:flex;align-items:center;gap:12px;padding:7px 14px;background:linear-gradient(180deg,#d92323,#b90000);color:#fff;font-size:12px;font-weight:900}
.website-live-sourcebar b{margin-left:auto}.website-live-sourcebar #websiteLiveClock{font-variant-numeric:tabular-nums;opacity:.9}
.website-live-frame-wrap{flex:1;min-height:0;background:#f8fafc;position:relative}.website-live-frame-wrap iframe{width:100%;height:100%;border:0;background:#fff;display:block}
.website-live-foot{padding:7px 12px;border-top:1px solid #e5e7eb;background:#f8fafc;color:#64748b;font-size:10px;font-weight:700;text-align:center}
body.website-live-open{overflow:hidden}
@media(max-width:700px){.website-live-modal{padding:0}.website-live-card{width:100vw;height:100dvh;max-height:none;border-radius:0;border:0}.website-live-head{padding:9px 10px}.website-live-head h3{font-size:15px}.website-live-head small{font-size:9px}.website-live-sourcebar{padding:6px 9px;gap:7px;font-size:10px}.website-live-head-actions button{padding:7px 9px!important;min-width:auto!important}.website-live-foot{font-size:9px;padding:5px 8px}.live-main-btn{font-size:12px!important}}

/* V4 source switcher */
.website-live-tabs{display:flex;gap:8px;align-items:center;padding:8px 12px;background:#f8fafc;border-bottom:1px solid #e5e7eb;overflow-x:auto;scrollbar-width:thin}
.website-live-tabs button{flex:0 0 auto;border:1px solid #cbd5e1!important;background:#fff!important;color:#334155!important;border-radius:10px!important;padding:8px 12px!important;font-weight:900!important;min-height:36px!important;box-shadow:none!important}
.website-live-tabs button.active{background:#111827!important;color:#fff!important;border-color:#111827!important}
.website-live-tabs button:hover{transform:none!important;filter:none!important;background:#eef2ff!important;color:#111827!important}
.website-live-tabs button.active:hover{background:#111827!important;color:#fff!important}
.live-source-help{padding:6px 12px;background:#fff7ed;color:#9a3412;border-bottom:1px solid #fed7aa;font-size:10px;font-weight:700}
@media(max-width:700px){.website-live-tabs{padding:7px 8px;gap:6px}.website-live-tabs button{font-size:10px!important;padding:7px 9px!important}.live-source-help{font-size:9px;padding:5px 8px}}

.live-local-help{display:flex;min-height:420px;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:32px;color:#24324a;background:#fff}.live-local-icon{font-size:48px}.live-local-help h3{margin:10px 0 6px}.live-local-help p{max-width:620px;line-height:1.7;color:#64748b}.live-local-help button{margin-top:14px;border:0;border-radius:12px;background:#111827;color:#fff;font-weight:800;padding:12px 18px;cursor:pointer}

/* V10 - table-only LIVE, phone first */
.website-live-status{padding:6px 12px;background:#fff7ed;color:#9a3412;border-bottom:1px solid #fed7aa;font-size:10px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.website-live-status.ok{background:#ecfdf5;color:#047857;border-color:#a7f3d0}.website-live-status.error{background:#fef2f2;color:#b91c1c;border-color:#fecaca}.website-live-status.loading{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
.website-live-frame-wrap{overflow:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.website-live-result{min-height:100%;background:#fff;padding:8px;box-sizing:border-box}.live-result-shell{width:100%;max-width:900px;margin:0 auto;background:#fff;overflow:hidden}.live-result-shell table{border-collapse:collapse!important;width:100%!important;max-width:none!important;margin:0!important;background:#fff!important;table-layout:auto!important}.live-result-shell td,.live-result-shell th{box-sizing:border-box}.live-result-shell img{max-width:100%!important;height:auto!important}.live-result-shell a{color:inherit;text-decoration:none;pointer-events:none}.live-result-shell script,.live-result-shell iframe,.live-result-shell form,.live-result-shell input,.live-result-shell select,.live-result-shell button{display:none!important}.live-loading,.live-error{min-height:300px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;text-align:center;color:#475569}.live-loading span{width:30px;height:30px;border:4px solid #e2e8f0;border-top-color:#2563eb;border-radius:50%;animation:liveSpin .8s linear infinite}@keyframes liveSpin{to{transform:rotate(360deg)}}.live-error small{color:#64748b}
@media(max-width:700px){.website-live-head{flex:0 0 auto}.website-live-head>div:first-child{min-width:0}.website-live-head small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:55vw}.website-live-tabs{scrollbar-width:none}.website-live-tabs::-webkit-scrollbar{display:none}.website-live-sourcebar{flex:0 0 auto}.website-live-sourcebar b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.website-live-status{font-size:9px;padding:5px 8px}.website-live-result{padding:3px}.live-result-shell{min-width:0!important;width:100%!important}.live-result-shell table{font-size:12px!important;line-height:1.18!important}.live-result-shell td,.live-result-shell th{padding:3px 2px!important}.website-live-foot{display:none}.website-live-frame-wrap{background:#fff}.live-loading,.live-error{min-height:55vh}.website-live-head-actions button{font-size:12px!important}.website-live-tabs button{min-height:34px!important}}
@media(max-width:390px){.website-live-head h3{font-size:14px}.website-live-head small{max-width:48vw}.website-live-tabs button{font-size:9px!important;padding:7px 8px!important}.website-live-sourcebar{font-size:9px}.live-result-shell table{font-size:11px!important}.live-result-shell td,.live-result-shell th{padding:2px 1px!important}}

/* V12 normalized MinhNgoc-style LIVE board */
.website-live-result{padding:0!important;background:#eef2f7!important}
.mn-live-board{width:100%;max-width:980px;margin:0 auto;background:#fff;border:1px solid #9ca3af;box-shadow:0 1px 2px rgba(0,0,0,.08);font-family:Arial,"Helvetica Neue",sans-serif;color:#111}
.mn-live-title{min-height:38px;display:flex;align-items:center;gap:8px;padding:0 10px;background:linear-gradient(#d61d1d,#a90000);color:#fff;border-bottom:1px solid #7f0000;font-size:16px;font-weight:900}
.mn-live-title span{font-size:19px}.mn-live-title b{flex:1}.mn-live-title small{font-size:10px;font-weight:900;opacity:.95}
.mn-live-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;background:#fff}
.mn-live-table{border-collapse:collapse;width:100%;min-width:620px;table-layout:fixed;background:#fff}
.mn-live-table th,.mn-live-table td{border:1px solid #a7a7a7;text-align:center;vertical-align:middle;padding:4px 3px}
.mn-live-table thead th{background:#f4f4f4;color:#003ec7;font-weight:900}
.mn-live-table .date-col{width:112px;color:#003ec7}.mn-live-table .date-col small{display:block;color:#990000;margin-top:4px;font-size:13px}
.mn-live-table .live-province b{display:block;color:#003ec7;font-size:14px}.mn-live-table .live-province small{display:block;color:#555;font-size:10px;margin-top:4px;font-weight:600}
.mn-live-table .prize-name{width:112px;background:#fafafa;font-size:12px;font-weight:500;white-space:nowrap}
.mn-live-table .prize-values{background:#fff;font-size:18px;font-weight:900;line-height:1.12;letter-spacing:.2px}
.mn-live-table .prize-values span{display:block;min-height:20px}.mn-live-table .prize-values.g8{font-size:31px;color:#a00000}.mn-live-table .prize-values.special{font-size:25px;color:#a00000}
.mn-live-table .waiting{color:#9ca3af!important;letter-spacing:3px;animation:liveWaiting 1.1s ease-in-out infinite alternate}
@keyframes liveWaiting{from{opacity:.35}to{opacity:.9}}
.mn-live-tools{display:flex;align-items:center;gap:0;border-top:1px solid #999;overflow-x:auto;white-space:nowrap;background:#fff;font-size:11px}
.mn-live-tools>span{padding:7px 9px;border-right:1px solid #c9c9c9}.mn-live-tools>span.active{color:#b40000}
.digit-pills{display:flex;gap:7px;align-items:center;padding:4px 8px}.digit-pills i{font-style:normal;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:linear-gradient(#d7d7d7,#868686);color:#fff;font-weight:900;font-size:11px;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.mn-live-meta{display:flex;justify-content:space-between;gap:10px;padding:7px 9px;background:#f8fafc;border-top:1px solid #d1d5db;color:#64748b;font-size:10px;font-weight:700}
@media(max-width:700px){
  .website-live-frame-wrap{background:#eef2f7!important}
  .website-live-result{min-height:100%;overflow:auto!important}
  .mn-live-board{border-left:0;border-right:0;box-shadow:none;max-width:none}
  .mn-live-title{min-height:34px;padding:0 7px;font-size:12px;position:sticky;top:0;z-index:3}
  .mn-live-table{min-width:0!important;width:100%!important;table-layout:fixed!important}
  .mn-live-table .date-col,.mn-live-table .prize-name{width:68px!important}
  .mn-live-table th,.mn-live-table td{padding:3px 1px!important}
  .mn-live-table .date-col{font-size:10px}.mn-live-table .date-col small{font-size:9px;margin-top:2px}
  .mn-live-table .live-province b{font-size:11px;line-height:1.1;overflow-wrap:anywhere}.mn-live-table .live-province small{font-size:8px;margin-top:2px}
  .mn-live-table .prize-name{font-size:9px;white-space:normal;line-height:1.05}
  .mn-live-table .prize-values{font-size:14px;line-height:1.05}.mn-live-table .prize-values span{min-height:15px}
  .mn-live-table .prize-values.g8{font-size:23px}.mn-live-table .prize-values.special{font-size:18px}
  .mn-live-tools{font-size:9px}.mn-live-tools>span{padding:6px 5px}.digit-pills{gap:4px;padding:3px 5px}.digit-pills i{width:17px;height:17px;font-size:9px}
  .mn-live-meta{font-size:8px;padding:5px 6px;position:sticky;bottom:0;z-index:2}
}
@media(max-width:380px){
  .mn-live-table .date-col,.mn-live-table .prize-name{width:58px!important}
  .mn-live-table .live-province b{font-size:10px}.mn-live-table .prize-values{font-size:13px}.mn-live-table .prize-values.g8{font-size:21px}.mn-live-table .prize-values.special{font-size:16px}
}


/* V13: stable lottery-live rendering */
.mn-live-table .live-new-value{animation:liveValuePop .9s ease both}
@keyframes liveValuePop{0%{transform:scale(.78);background:#fff3a6}55%{transform:scale(1.08);background:#fff3a6}100%{transform:scale(1);background:transparent}}
.mn-live-table .prize-values span{border-radius:4px}
@media(max-width:700px){
  .website-live-card{height:100dvh!important}
  .website-live-frame-wrap{min-height:0!important;overflow:auto!important}
  .mn-live-title{font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mn-live-table{font-variant-numeric:tabular-nums}
  .mn-live-table .prize-values{word-break:keep-all}
  .mn-live-table .prize-values span{white-space:nowrap}
  .mn-live-tools{position:sticky;bottom:0;z-index:4;border-bottom:1px solid #d1d5db}
  .mn-live-meta{position:static!important}
}

/* V14 multi-region LIVE: Miền Nam / Miền Trung / Miền Bắc */
.north-live-head{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:7px 9px;border-bottom:1px solid #aaa;background:#fff;font-size:11px}.north-live-head span{text-align:center;color:#444}.north-live-head strong{color:#8b1a1a}.north-live-table{min-width:0!important}.north-live-table .prize-name{width:95px}.north-live-table .north-values{padding:5px 8px!important;font-size:22px;font-weight:900;line-height:1.25}.north-live-table .north-values span{display:inline-flex;align-items:center;justify-content:center;min-width:94px;margin:1px 8px}.north-live-table .north-db{font-size:28px;color:#9d0000}.north-live-table .north-g1{font-size:27px}.north-live-table .north-g7 span{min-width:60px}.north-live-table .waiting{min-width:70px;color:#aeb4bc!important}
@media(max-width:700px){.north-live-head{grid-template-columns:auto 1fr auto;font-size:9px;padding:5px 6px;gap:4px}.north-live-head span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.north-live-table .prize-name{width:62px!important}.north-live-table .north-values{font-size:18px!important;padding:4px 2px!important}.north-live-table .north-values span{min-width:27%;margin:1px 2px}.north-live-table .north-db{font-size:24px!important}.north-live-table .north-g1{font-size:23px!important}.north-live-table .north-g2 span{min-width:42%}.north-live-table .north-g3 span,.north-live-table .north-g5 span{min-width:29%}.north-live-table .north-g4 span,.north-live-table .north-g7 span{min-width:21%}.north-live-table .north-g6 span{min-width:28%}.north-live-table .waiting{min-width:27%!important}}

/* V15 - official LIVE embed. The source's own JS performs the live number updates. */
.website-live-result{height:100%!important;min-height:0!important;padding:0!important;background:#fff!important;overflow:hidden!important}
.official-live-frame{display:block;width:100%!important;height:100%!important;min-height:100%!important;border:0!important;background:#fff!important}
.website-live-frame-wrap{overflow:hidden!important;background:#fff!important}
@media(max-width:700px){
  .website-live-result,.official-live-frame{width:100%!important;height:100%!important}
  .website-live-status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* V16 — source schedule reminder (display only, never auto-switches source) */
.website-live-tabs button{display:flex!important;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;line-height:1.1}
.website-live-tabs button>span{white-space:nowrap}
.website-live-tabs button>small{font-size:8px;font-weight:800;opacity:.72;white-space:nowrap}
.website-live-tabs button.reminder-next:not(.active){border-color:#f59e0b!important;box-shadow:0 0 0 2px rgba(245,158,11,.12)!important}
.website-live-tabs button.reminder-live{background:#dc2626!important;color:#fff!important;border-color:#b91c1c!important;animation:liveReminderPulse 1.3s ease-in-out infinite}
.website-live-tabs button.reminder-live:hover{background:#dc2626!important;color:#fff!important}
.website-live-reminder{padding:7px 12px;background:#fff7ed;color:#9a3412;border-bottom:1px solid #fed7aa;font-size:10px;font-weight:900;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.website-live-reminder.live-now{background:#dc2626;color:#fff;border-color:#b91c1c}
@keyframes liveReminderPulse{50%{box-shadow:0 0 0 4px rgba(220,38,38,.16)}}
@media(max-width:700px){
  .website-live-tabs button{padding:6px 8px!important;min-height:43px!important}
  .website-live-tabs button>small{font-size:7px}
  .website-live-reminder{font-size:9px;padding:5px 8px}
}

.khmer-live-btn{background:linear-gradient(135deg,#243b8f,#4f46e5)!important;color:#fff!important;border-color:#3346a8!important;box-shadow:0 5px 16px rgba(49,70,168,.18)!important;font-weight:900!important}
.khmer-live-btn:hover{transform:translateY(-1px);filter:brightness(1.04)}

/* Khmer LIVE source tab */
.website-live-tabs [data-live-source="khmer"]{border-color:#c7d2fe}
.website-live-tabs [data-live-source="khmer"].active{background:linear-gradient(135deg,#243b8f,#4f46e5)!important;color:#fff!important;border-color:#3346a8!important}
@media(max-width:700px){.website-live-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}}


/* V20 — Khmer LIVE parsed result + picture converter */
.kh-live-layout{min-height:100%;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.85fr);gap:22px;padding:22px;background:#fff;box-sizing:border-box;align-items:start}
.kh-live-left{display:flex;justify-content:center;align-items:flex-start;padding-top:6px}
.kh-live-capture{width:min(650px,100%);background:#fff;border:3px solid #111;color:#000;font-family:"Times New Roman","Noto Sans Khmer",serif;box-sizing:border-box}
.kh-live-title{text-align:center;font-family:"Noto Sans Khmer",Arial,sans-serif;font-size:25px;font-weight:900;padding:19px 8px;border-bottom:2px solid #111}
.kh-live-date-row{display:grid;grid-template-columns:120px 1fr;align-items:center;border-bottom:2px solid #111;min-height:80px}
.kh-live-date-row span{font-family:"Noto Sans Khmer",Arial,sans-serif;font-size:23px;font-weight:900;line-height:1.1;padding-left:16px}.kh-live-date-row b{text-align:center;font:900 31px/1 Arial,sans-serif}
.kh-live-table{border-collapse:collapse;width:100%;table-layout:fixed}.kh-live-table th,.kh-live-table td{border-bottom:2px solid #111;text-align:center;height:104px;padding:0}.kh-live-table tr:last-child th,.kh-live-table tr:last-child td{border-bottom:0}
.kh-live-table th{width:116px;border-right:2px dotted #111;font:900 72px/1 "Times New Roman",serif}.kh-live-table td{font:500 78px/1 "Times New Roman",serif}.kh-live-table td:nth-child(2){width:34%}
.kh-live-controls{display:flex;flex-direction:column;gap:14px;padding-top:6px}.kh-live-controls label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:900;color:#334155}.kh-live-controls select,.kh-live-source-pill{height:58px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;padding:0 15px;font-size:17px;font-weight:800;box-sizing:border-box}.kh-live-source-pill{display:flex;align-items:center;gap:8px}.kh-live-source-pill b{margin-left:auto;background:#16a34a;color:#fff;border-radius:6px;padding:4px 8px;font-size:11px}
.kh-live-controls button{min-height:58px!important;border-radius:12px!important;font-size:14px!important;font-weight:900!important}.kh-live-controls .kh-primary{background:linear-gradient(135deg,#4338ca,#5b45df)!important;color:#fff!important;border-color:#4338ca!important}.kh-live-controls .kh-download{background:#16a34a!important;color:#fff!important;border-color:#15803d!important}
@media(max-width:800px){.kh-live-layout{grid-template-columns:1fr;gap:14px;padding:10px}.kh-live-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px}.kh-live-controls label{grid-column:span 1}.kh-live-controls button{min-height:46px!important}.kh-live-title{font-size:17px;padding:12px 5px}.kh-live-date-row{grid-template-columns:82px 1fr;min-height:56px}.kh-live-date-row span{font-size:15px;padding-left:8px}.kh-live-date-row b{font-size:22px}.kh-live-table th{width:78px;font-size:48px}.kh-live-table td{font-size:51px}.kh-live-table th,.kh-live-table td{height:72px}.website-live-result{overflow:auto!important}}
@media(max-width:480px){.kh-live-layout{padding:5px}.kh-live-controls{grid-template-columns:1fr 1fr}.kh-live-controls select,.kh-live-source-pill{height:46px;font-size:13px}.kh-live-controls button{font-size:11px!important;min-height:42px!important}.kh-live-title{font-size:14px}.kh-live-date-row{grid-template-columns:64px 1fr;min-height:46px}.kh-live-date-row span{font-size:12px}.kh-live-date-row b{font-size:18px}.kh-live-table th{width:60px;font-size:39px}.kh-live-table td{font-size:41px}.kh-live-table th,.kh-live-table td{height:61px}}

/* ==========================================================================
   SOURCE CSS: khmer-live.css
   ========================================================================== */
.khmer-live-modal{position:fixed;inset:0;z-index:210000;background:rgba(15,23,42,.72);display:flex;align-items:center;justify-content:center;padding:18px;box-sizing:border-box}
.khmer-live-modal.hidden{display:none}.khmer-live-card{width:min(1180px,100%);max-height:94vh;overflow:auto;background:#fff;border-radius:20px;box-shadow:0 28px 80px rgba(0,0,0,.28)}
.khmer-live-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 20px;background:linear-gradient(135deg,#c90808,#e21313);color:#fff;border-radius:20px 20px 0 0;position:sticky;top:0;z-index:3}
.khmer-live-head h3{margin:0;font-size:22px}.khmer-live-head small{display:block;margin-top:4px;opacity:.92}.khmer-live-head-actions{display:flex;gap:8px}.khmer-live-head-actions button{min-width:auto!important;height:42px!important;background:#fff!important;color:#182230!important;border:0!important;border-radius:11px!important;padding:0 15px!important;font-weight:900!important}.kh-live-badge,.kh-source-pill b{display:inline-block;background:#16a34a;color:#fff;border-radius:7px;padding:3px 8px;font-size:12px}
.khmer-live-status{padding:9px 18px;border-bottom:1px solid #eee;font-size:12px;font-weight:800;color:#475467}.khmer-live-status.ok{color:#067647;background:#ecfdf3}.khmer-live-status.bad{color:#b42318;background:#fef3f2}
.khmer-live-body{padding:20px;min-height:430px}.kh-separate-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);gap:28px;align-items:start}.kh-separate-preview{display:flex;justify-content:center}.kh-result-card{width:min(650px,100%);border:3px solid #111;background:#fff;color:#000;font-family:"Times New Roman","Noto Sans Khmer",serif;box-sizing:border-box}.kh-result-title{text-align:center;font-family:"Noto Sans Khmer",Arial,sans-serif;font-weight:900;font-size:25px;padding:18px 8px;border-bottom:2px solid #111}.kh-result-date{display:grid;grid-template-columns:120px 1fr;align-items:center;border-bottom:2px solid #111;min-height:80px}.kh-result-date span{font:900 22px/1.08 "Noto Sans Khmer",Arial,sans-serif;padding-left:14px}.kh-result-date b{text-align:center;font:900 31px/1 Arial,sans-serif}.kh-result-card table{width:100%;border-collapse:collapse}.kh-result-card th,.kh-result-card td{border-bottom:2px solid #111;height:102px}.kh-result-card tr:last-child th,.kh-result-card tr:last-child td{border-bottom:0}.kh-result-card th{width:115px;border-right:2px dotted #333;font-size:70px}.kh-result-card td{text-align:center;font-size:80px;line-height:1}.kh-separate-controls{display:grid;gap:14px}.kh-separate-controls label{display:grid;gap:7px;font-weight:900}.kh-separate-controls select,.kh-source-pill{width:100%;height:58px;border:1px solid #d0d5dd;border-radius:12px;background:#fff;padding:0 16px;box-sizing:border-box;font-size:17px;font-weight:800}.kh-source-pill{display:flex;align-items:center;justify-content:space-between}.kh-separate-controls button{height:60px!important;border-radius:12px!important;font-weight:900!important;font-size:16px!important}.kh-separate-controls .kh-red{background:#d80c0c!important;color:#fff!important;border-color:#d80c0c!important}.kh-separate-controls .kh-green{background:#16a34a!important;color:#fff!important;border-color:#16a34a!important}.khmer-live-loading,.khmer-live-empty,.khmer-live-error{min-height:390px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;color:#475467}.khmer-live-loading span{width:34px;height:34px;border:4px solid #eee;border-top-color:#d80c0c;border-radius:50%;animation:kspin .8s linear infinite}.khmer-live-error b{font-size:20px;color:#b42318}.khmer-live-error small{max-width:640px}.khmer-live-error button{background:#101828!important;color:#fff!important}@keyframes kspin{to{transform:rotate(360deg)}}
@media(max-width:760px){.khmer-live-modal{padding:7px}.khmer-live-card{max-height:98vh;border-radius:14px}.khmer-live-head{padding:13px;border-radius:14px 14px 0 0}.khmer-live-head h3{font-size:16px}.khmer-live-head small{font-size:10px}.khmer-live-head-actions button{height:36px!important;padding:0 10px!important}.khmer-live-body{padding:10px}.kh-separate-layout{grid-template-columns:1fr;gap:14px}.kh-result-title{font-size:17px;padding:12px 5px}.kh-result-date{grid-template-columns:86px 1fr;min-height:58px}.kh-result-date span{font-size:15px;padding-left:8px}.kh-result-date b{font-size:23px}.kh-result-card th,.kh-result-card td{height:74px}.kh-result-card th{width:82px;font-size:48px}.kh-result-card td{font-size:55px}.kh-separate-controls{grid-template-columns:1fr 1fr;gap:9px}.kh-separate-controls label{grid-column:span 2}.kh-separate-controls button{height:48px!important;font-size:13px!important}}

/* ==========================================================================
   SOURCE CSS: v6-sync.css
   ========================================================================== */
/* Bunheng168 V6: keep all action buttons at the top, compact and responsive. */
#proToolbar{margin-top:0!important;margin-bottom:10px!important}
#proToolbar .pro-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important;align-items:center!important}
#proToolbar .pro-actions>button{width:auto!important;min-width:0!important;flex:0 0 auto!important}
#proToolbar #zoomText{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:44px!important}
.toolbar{margin-top:0!important}
@media (max-width:850px){
  #proToolbar .pro-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  #proToolbar .pro-actions>button,#proToolbar .pro-actions>#zoomText{width:100%!important;min-width:0!important;white-space:normal!important}
}
@media (max-width:620px){
  #proToolbar .pro-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media (max-width:430px){
  #proToolbar .pro-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ==========================================================================
   SOURCE CSS: v8-clean-toolbar.css
   ========================================================================== */
/* Bunheng168 V8 — clean, always-visible essential toolbar */
#proToolbar{display:block!important;visibility:visible!important;opacity:1!important;margin:12px 0!important}
#proToolbar .pro-actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important;padding:10px!important}
#proToolbar .pro-actions>button{display:inline-flex!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;min-height:38px!important;width:auto!important;white-space:nowrap!important}
#autoResultBtn,#websiteLiveBtn,#debugBtn{display:inline-flex!important}
#batchQueue:empty,#qualityNotice.hidden,#debugPanel.hidden{display:none!important}
@media(max-width:700px){
  #proToolbar .pro-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
  #proToolbar .pro-actions>button{width:100%!important;min-width:0!important;white-space:normal!important;font-size:12px!important;padding:8px 6px!important}
}
@media(max-width:440px){#proToolbar .pro-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* ==========================================================================
   SOURCE CSS: v9-fix.css
   ========================================================================== */
/* V9 — equal date controls + live readability */
.date-control{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;width:100%!important;justify-content:stretch!important;gap:10px!important}
.kh-date-display,#todayCambodiaBtn{width:100%!important;max-width:none!important;min-width:0!important;height:46px!important;border-radius:13px!important;font-size:13px!important}
.kh-date-display{grid-template-columns:auto 1fr auto!important;justify-content:stretch!important}
#todayCambodiaBtn{padding:0 12px!important}
@media(max-width:768px){.date-control{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}.kh-date-display,#todayCambodiaBtn{height:48px!important;font-size:12px!important}}
@media(max-width:430px){.date-control{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-areas:"label label" "date today"!important}.kh-date-display,#todayCambodiaBtn{height:44px!important}.kh-date-display{max-width:none!important}}
.website-live-frame-wrap,.website-live-frame-wrap iframe{background:#fff!important}

/* ==========================================================================
   SOURCE CSS: install-app.css
   ========================================================================== */
#brandInstallBtn{position:relative!important;padding:0!important;appearance:none;cursor:pointer!important;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease!important}
#brandInstallBtn img{pointer-events:none}
#brandInstallBtn:after{content:"↓";position:absolute;right:-5px;bottom:-5px;width:24px;height:24px;display:grid;place-items:center;border:3px solid #fff;border-radius:50%;background:linear-gradient(135deg,#ff7c48,#ef4855);color:#fff;font:900 14px/1 Arial,sans-serif;box-shadow:0 6px 14px rgba(239,72,85,.25)}
#brandInstallBtn:hover{transform:translateY(-3px) scale(1.03)!important;border-color:#ffbb91!important;box-shadow:0 16px 32px rgba(219,87,44,.20)!important}
#brandInstallBtn:focus-visible{outline:3px solid rgba(55,124,246,.28)!important;outline-offset:4px!important}
#brandInstallBtn.is-installed:after{content:"✓";background:linear-gradient(135deg,#22b982,#119568);box-shadow:0 6px 14px rgba(17,149,104,.23)}
.install-help-modal{position:fixed;inset:0;z-index:10050;background:rgba(15,23,42,.58);display:flex;align-items:center;justify-content:center;padding:16px}
.install-help-modal.hidden{display:none!important}
.install-help-card{width:min(430px,100%);background:#fff;border-radius:18px;padding:18px;box-shadow:0 24px 70px rgba(0,0,0,.28);color:#111827}
.install-help-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.install-help-head h3{margin:0;font-size:18px}.install-help-close{border:0;background:#eef2f7;border-radius:9px;padding:8px 11px;font-size:18px;cursor:pointer}.install-help-card p{margin:8px 0;line-height:1.55}.install-help-steps{margin:12px 0 0;padding-left:22px;line-height:1.75}.install-help-icon{font-size:32px;text-align:center;margin:2px 0 8px}
@media(max-width:640px){#brandInstallBtn:after{width:20px;height:20px;right:-4px;bottom:-4px;font-size:12px;border-width:2px}.install-help-card{border-radius:15px}}

/* ==========================================================================
   SOURCE CSS: fresh-ui-2026.css
   ========================================================================== */
/* BUNHENG168 Fresh Light UI 2026
   Final visual layer only: OCR and result-card geometry remain untouched. */
:root{
  --fresh-bg:#f7f8fc;
  --fresh-surface:#ffffff;
  --fresh-surface-soft:#fff9f3;
  --fresh-ink:#20263a;
  --fresh-muted:#6f778d;
  --fresh-line:#e8eaf1;
  --fresh-orange:#ff7a45;
  --fresh-coral:#f04452;
  --fresh-red:#df2935;
  --fresh-green:#18a873;
  --fresh-blue:#377cf6;
  --fresh-purple:#7a5af8;
  --fresh-shadow:0 14px 40px rgba(37,44,76,.08);
  --fresh-shadow-small:0 7px 20px rgba(37,44,76,.07);
}

html{background:var(--fresh-bg)!important;scroll-behavior:smooth}
body,body.pro-dark{
  margin:0!important;
  background:
    radial-gradient(circle at 7% 4%,rgba(255,211,165,.30),transparent 28rem),
    radial-gradient(circle at 95% 10%,rgba(184,216,255,.26),transparent 30rem),
    var(--fresh-bg)!important;
  color:var(--fresh-ink)!important;
  font-family:Arial,"Noto Sans Khmer",sans-serif!important;
  min-height:100vh;
}

.app{width:min(1440px,calc(100% - 34px))!important;max-width:1440px!important;margin:0 auto!important;padding:22px 0 56px!important}

/* Fresh hero: deliberately light, replacing the old dark purple header. */
.app>header.fresh-hero{
  position:relative!important;
  isolation:isolate;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:28px!important;
  min-height:124px!important;
  margin:0 0 16px!important;
  padding:22px 24px!important;
  overflow:hidden!important;
  border:1px solid rgba(255,122,69,.22)!important;
  border-radius:28px!important;
  background:linear-gradient(112deg,#fff 0%,#fffaf5 52%,#fff2e7 100%)!important;
  box-shadow:0 18px 50px rgba(164,88,42,.10)!important;
  color:var(--fresh-ink)!important;
}
.app>header.fresh-hero:before{
  content:""!important;display:block!important;position:absolute!important;z-index:-1!important;
  width:250px!important;height:250px!important;right:-85px!important;top:-118px!important;
  border-radius:50%!important;background:rgba(255,122,69,.13)!important;
  box-shadow:-62px 106px 0 rgba(255,201,137,.10)!important;
}
.app>header.fresh-hero:after{
  content:""!important;display:block!important;position:absolute!important;z-index:-1!important;
  width:135px!important;height:135px!important;left:43%!important;bottom:-103px!important;
  border-radius:50%!important;background:rgba(55,124,246,.08)!important;border:0!important;padding:0!important;
}
.fresh-brand{display:flex;align-items:center;gap:18px;min-width:0;position:relative;z-index:2}
.fresh-logo-shell{
  width:88px;height:88px;flex:0 0 88px;display:grid;place-items:center;border-radius:25px;
  background:#fff;box-shadow:0 12px 28px rgba(219,87,44,.13);border:1px solid #ffe0ca;
}
.fresh-logo-shell .bh168-brand-logo{width:72px!important;height:72px!important;object-fit:contain!important;filter:none!important}
.fresh-brand-copy{min-width:0}
.fresh-eyebrow{display:flex;align-items:center;gap:7px;margin-bottom:5px;color:var(--fresh-coral);font-size:10px;font-weight:900;letter-spacing:1.4px}
.fresh-eyebrow i{width:8px;height:8px;border-radius:50%;background:var(--fresh-coral);box-shadow:0 0 0 5px rgba(240,68,82,.10)}
.app>header.fresh-hero h1{
  margin:0!important;padding:0!important;max-width:none!important;color:var(--fresh-ink)!important;
  font:900 clamp(25px,3vw,38px)/1.05 Arial,"Noto Sans Khmer",sans-serif!important;
  letter-spacing:-1px!important;
  background:linear-gradient(100deg,#ef4d40,#ff8a3d)!important;background-clip:text!important;-webkit-background-clip:text!important;-webkit-text-fill-color:transparent!important;
}
.app>header.fresh-hero p{margin:7px 0 0!important;max-width:520px!important;color:var(--fresh-muted)!important;font-size:13px!important;font-weight:700!important;line-height:1.55!important}

.fresh-live-overview{display:grid;grid-template-columns:repeat(3,minmax(134px,1fr));gap:10px;position:relative;z-index:2}
.fresh-stat-card,.fresh-live-overview button.fresh-stat-card{
  display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important;min-height:67px!important;
  padding:10px 13px!important;border:1px solid var(--fresh-line)!important;border-radius:18px!important;
  background:rgba(255,255,255,.88)!important;color:var(--fresh-ink)!important;box-shadow:var(--fresh-shadow-small)!important;
  text-align:left!important;cursor:default!important;transform:none!important;
}
.fresh-live-overview button.fresh-stat-card{cursor:pointer!important}
.fresh-live-overview button.fresh-stat-card:hover{border-color:#ffcaa9!important;background:#fff7ef!important;transform:translateY(-2px)!important}
.fresh-stat-icon{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;border-radius:12px;background:#fff0e5;color:var(--fresh-orange);font-size:17px}
.fresh-stat-card:nth-child(2) .fresh-stat-icon{background:#eafaf4;color:var(--fresh-green)}
.fresh-clock-card .fresh-stat-icon{background:#edf4ff;color:var(--fresh-blue)}
.fresh-stat-card>span:last-child{display:block;min-width:0}
.fresh-stat-card small{display:block;margin-bottom:4px;color:#8b91a3;font-size:9px;font-weight:900;letter-spacing:.2px;white-space:nowrap}
.fresh-stat-card b{display:block;color:#30364a;font-size:13px;font-weight:900;white-space:nowrap;font-variant-numeric:tabular-nums}
.fresh-next-card{min-width:196px!important}
.fresh-next-card b{color:#d94843!important}
.fresh-live-dot{font-size:13px!important;animation:freshPulse 1.5s ease-in-out infinite}
@keyframes freshPulse{50%{box-shadow:0 0 0 7px rgba(24,168,115,.11)}}

/* Toolbar cards */
.pro-toolbar,.toolbar,.panel,.v4-quickbar,
body.pro-dark .pro-toolbar,body.pro-dark .toolbar,body.pro-dark .panel,body.pro-dark .v4-quickbar{
  background:rgba(255,255,255,.94)!important;border:1px solid var(--fresh-line)!important;
  box-shadow:var(--fresh-shadow)!important;color:var(--fresh-ink)!important;
}
.pro-toolbar{margin:0 0 12px!important;padding:12px!important;border-radius:21px!important}
.pro-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important}
.pro-actions button{
  min-height:48px!important;padding:9px 12px!important;border:1px solid #eceef4!important;border-radius:15px!important;
  background:#fff!important;color:#4d556b!important;box-shadow:none!important;font-size:12px!important;transition:.18s ease!important;
}
.pro-actions button:hover{transform:translateY(-2px)!important;box-shadow:0 9px 20px rgba(43,51,83,.08)!important;border-color:#dfe2ec!important}
#autoResultBtn{background:#fff6ec!important;border-color:#ffdcc0!important;color:#bd4b19!important}
#websiteLiveBtn{background:#fff0f1!important;border-color:#ffcdd1!important;color:#c52a35!important}
#khmerLiveBtn{background:#eef5ff!important;border-color:#cfe1ff!important;color:#2563c7!important}
#debugBtn{background:#f5f0ff!important;border-color:#dfd2ff!important;color:#7042bd!important}
#debugBtn:hover{background:#eee6ff!important;border-color:#cbb8ff!important;box-shadow:0 9px 20px rgba(112,66,189,.12)!important}

.toolbar{
  margin:0 0 14px!important;padding:16px!important;border-radius:21px!important;
  display:grid!important;grid-template-columns:1.15fr 1.25fr .72fr .72fr 1.45fr .8fr .8fr!important;gap:10px!important;align-items:stretch!important;
}
.upload-btn,.paste-zone,.mode-select,.date-control,#scanBtn,#resetBtn,#status{min-height:48px!important;border-radius:14px!important;box-sizing:border-box!important}
.upload-btn{display:flex!important;align-items:center!important;justify-content:center!important;background:linear-gradient(135deg,#ff8050,#f04d4f)!important;color:#fff!important;border:0!important;box-shadow:0 9px 18px rgba(240,77,79,.18)!important}
.paste-zone{display:flex!important;align-items:center!important;justify-content:center!important;padding:8px 12px!important;background:#fffaf6!important;color:#a34b25!important;border:1.5px dashed #ffc6a6!important}
.mode-select,.date-control input,body.pro-dark .mode-select,body.pro-dark input{background:#fff!important;color:#343a4e!important;border:1px solid #e1e4ec!important;box-shadow:none!important}
.date-control{border:0!important;background:#fafbfe!important;padding:7px!important;gap:7px!important}
.date-control label{color:#858b9d!important}
#scanBtn{background:linear-gradient(135deg,#ff7c48,#ef4855)!important;color:#fff!important;border:0!important;box-shadow:0 9px 18px rgba(239,72,85,.17)!important}
#resetBtn{background:#f5f7fb!important;color:#626a80!important;border:1px solid #e5e8f0!important}
#status{grid-column:1/-1!important;background:#f8fafc!important;border:1px solid #edf0f5!important;color:#70788d!important;min-height:38px!important;padding:8px 12px!important}

.layout{gap:16px!important;align-items:start!important}
.panel{padding:18px!important;border-radius:24px!important}
.panel h2,.result-head h2{margin:0 0 13px!important;color:#272d40!important;font-size:17px!important}
.panel h2:before,.result-head h2:before{content:"";display:inline-block;width:5px;height:19px;margin-right:8px;vertical-align:-4px;border-radius:10px;background:linear-gradient(#ff8551,#ef4455)}
.preview-box{border:1.5px dashed #d9dde8!important;border-radius:18px!important;background:linear-gradient(180deg,#fff,#fafbfe)!important}
.abcdh-editor,.night-fields,.field-group{border-color:#eceef4!important;background:#fcfcfe!important;border-radius:16px!important}
.editor-title{color:#31384c!important}

/* Buttons and controls outside the precise result-card DOM. */
.app button:not(.fresh-stat-card):not(.kh-cal-day):not(.kh-cal-nav),
.pro-modal button,.website-live-modal button,.khmer-live-modal button{
  border-radius:13px!important;transition:transform .16s ease,box-shadow .16s ease,background .16s ease!important;
}
.app button:not(:disabled):hover,.pro-modal button:not(:disabled):hover,.khmer-live-modal button:not(:disabled):hover{transform:translateY(-1px)}
.light,body.pro-dark .light{background:#fff!important;color:#555e75!important;border:1px solid #e1e5ed!important}

/* Modals */
.pro-modal,.website-live-modal,.khmer-live-modal{background:rgba(51,56,76,.35)!important;backdrop-filter:blur(10px)!important}
.pro-modal-card,.website-live-card,.khmer-live-card,
body.pro-dark .pro-modal-card{background:#fff!important;color:var(--fresh-ink)!important;border:1px solid rgba(255,255,255,.75)!important;border-radius:25px!important;box-shadow:0 30px 90px rgba(31,36,58,.22)!important}
.pro-modal-head{background:#fff!important;border-bottom:1px solid var(--fresh-line)!important;color:var(--fresh-ink)!important}
.pro-modal-head h3{color:#282e42!important}
.khmer-live-head{
  background:linear-gradient(112deg,#fff8f3,#fff 60%,#fff1e5)!important;color:var(--fresh-ink)!important;
  border-bottom:1px solid #ffe2cf!important;border-radius:25px 25px 0 0!important;
}
.khmer-live-head h3{color:#cc3943!important}.khmer-live-head small{color:#80879a!important}
.kh-live-badge{background:#e9fbf4!important;color:#09805a!important;border:1px solid #c5f0df!important}
.khmer-live-head-actions button{background:#fff!important;color:#555d72!important;border:1px solid #e4e7ee!important}
.khmer-live-status{padding:10px 18px!important;background:#fff!important;color:#6e768b!important}
.khmer-live-status.ok{background:#effbf6!important;color:#087754!important}.khmer-live-status.bad{background:#fff2f2!important;color:#bc2936!important}
.khmer-live-pulsebar{display:flex;align-items:center;gap:13px;padding:9px 18px;background:#fafbfe;border-bottom:1px solid #eceef3;color:#777f93;font-size:10px;font-weight:900}
.khmer-live-pulsebar span:first-child{display:flex;align-items:center;gap:6px;color:#16845f}.khmer-live-pulsebar i{width:7px;height:7px;border-radius:50%;background:#19ae78;animation:freshPulse 1.5s infinite}
.khmer-live-pulsebar b{margin-left:auto;color:#e15342;font-variant-numeric:tabular-nums}
.khmer-live-body{background:linear-gradient(180deg,#fff,#fdfdff)!important}
.kh-separate-controls{padding:16px;border:1px solid #eceef4;border-radius:20px;background:#fafbfe}
.kh-separate-controls select,.kh-source-pill{border-color:#e0e4ed!important;border-radius:14px!important}
.kh-separate-controls .kh-red{background:linear-gradient(135deg,#ff7547,#ed4654)!important;border:0!important;box-shadow:0 9px 20px rgba(237,70,84,.18)!important}
.kh-separate-controls .kh-green{background:linear-gradient(135deg,#22b982,#119568)!important;border:0!important;box-shadow:0 9px 20px rgba(17,149,104,.15)!important}
.kh-share-btn{background:#eef5ff!important;color:#2868c8!important;border:1px solid #cee0ff!important}
.kh-history-btn{background:#fff5e9!important;color:#ac571e!important;border:1px solid #ffddba!important}
.kh-history-panel{grid-column:1/-1;border:1px solid #e9ecf3;border-radius:18px;background:#fff;padding:14px}
.kh-history-panel.hidden{display:none}.kh-history-panel h4{margin:0 0 10px;color:#353b50;font-size:14px}.kh-history-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;max-height:240px;overflow:auto}
.kh-history-item{display:grid;gap:4px;padding:10px!important;background:#fafbfe!important;color:#4d556b!important;border:1px solid #e8eaf1!important;text-align:left!important;box-shadow:none!important}
.kh-history-item b{color:#e25343;font-size:12px}.kh-history-item span{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kh-history-empty{padding:22px;text-align:center;color:#8c93a4;font-size:12px}

.website-live-tabs button.active{background:#fff1eb!important;color:#d54c36!important;border-color:#ffcbb8!important}
.website-live-tabs button.active:hover{background:#fff1eb!important;color:#d54c36!important}
.website-live-sourcebar{background:linear-gradient(90deg,#ff7350,#ef4455)!important;border:0!important}

.auto-result-actions button:first-child{background:linear-gradient(135deg,#ff7547,#ed4654)!important;border:0!important;color:#fff!important}
.auto-schedule button.active{background:#fff0e8!important;color:#d24b38!important;border-color:#ffc8b4!important}
.auto-api-box{background:#fafbfe!important;border-color:#e8eaf1!important;border-radius:16px!important}

/* Result container gets polish, while the exported card itself remains exact. */
.result-stage,.result-workspace,.result-preview{background:#f9fafc!important;border-radius:18px!important}
.ticket,.night-exact-card,.compact-abcdh-card,.compact-abcd-card,#time130Card,.kh-result-card{box-shadow:0 14px 35px rgba(31,36,58,.13)}

/* V5.1 consistency: replace the last legacy purple controls. */
#updateBtn,#applyABCDH,#applyEveningABCD,#apply430{
  width:100%!important;min-height:48px!important;margin-top:12px!important;padding:10px 16px!important;
  border:0!important;border-radius:14px!important;
  background:linear-gradient(135deg,#ff7c48,#ef4855)!important;color:#fff!important;
  box-shadow:0 9px 20px rgba(239,72,85,.18)!important;
  font-size:13px!important;font-weight:900!important;
}
#updateBtn:hover,#applyABCDH:hover,#applyEveningABCD:hover,#apply430:hover{filter:brightness(1.03)!important;box-shadow:0 12px 24px rgba(239,72,85,.22)!important}
.clone-count-group{gap:6px!important;padding:4px!important;border:1px solid #e6e9f0!important;border-radius:14px!important;background:#f8fafc!important}
.clone-count-btn{
  min-width:34px!important;height:34px!important;padding:0 9px!important;border:1px solid #dde2ec!important;
  border-radius:11px!important;background:#fff!important;color:#596176!important;box-shadow:none!important;font-weight:900!important;
}
.clone-count-btn:hover{background:#fff5ee!important;color:#d6533d!important;border-color:#ffcdb8!important}
.clone-count-btn.active{
  background:linear-gradient(135deg,#ff7c48,#ef4855)!important;color:#fff!important;border-color:transparent!important;
  box-shadow:0 7px 15px rgba(239,72,85,.22)!important;
}
.clone-export-btn{background:#fff!important;color:#596176!important;border:1px solid #e0e4ed!important;box-shadow:none!important}
.clone-export-btn:hover{background:#fff7f1!important;color:#c94c38!important;border-color:#ffd0bd!important}

@media(max-width:1120px){
  .app>header.fresh-hero{align-items:flex-start!important;flex-direction:column!important}
  .fresh-live-overview{width:100%}
  .toolbar{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  #status{grid-column:1/-1!important}
}

@media(max-width:768px){
  .app{width:calc(100% - 16px)!important;padding:8px 0 30px!important}
  .app>header.fresh-hero{min-height:0!important;padding:15px!important;gap:14px!important;border-radius:22px!important;margin-bottom:9px!important}
  .fresh-brand{gap:11px}.fresh-logo-shell{width:62px;height:62px;flex-basis:62px;border-radius:18px}.fresh-logo-shell .bh168-brand-logo{width:52px!important;height:52px!important}
  .fresh-eyebrow{font-size:8px!important;margin-bottom:3px}.app>header.fresh-hero h1{font-size:24px!important;letter-spacing:-.5px!important}.app>header.fresh-hero p{font-size:10px!important;margin-top:5px!important}
  .fresh-live-overview{grid-template-columns:1.18fr .82fr!important;gap:7px}.fresh-clock-card{display:none!important}.fresh-stat-card,.fresh-live-overview button.fresh-stat-card{min-height:58px!important;padding:8px 10px!important;border-radius:15px!important}.fresh-next-card{min-width:0!important}.fresh-stat-icon{width:32px;height:32px;flex-basis:32px}.fresh-stat-card b{font-size:11px}.fresh-stat-card small{font-size:8px}
  .pro-toolbar{padding:8px!important;border-radius:17px!important}.pro-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}.pro-actions button{min-height:42px!important;font-size:10px!important;padding:7px!important}
  .toolbar{display:flex!important;flex-direction:column!important;padding:9px!important;border-radius:17px!important}.upload-btn,.paste-zone,.mode-select,.date-control,#scanBtn,#resetBtn{width:100%!important;min-height:45px!important}
  .layout{display:block!important}.panel{padding:10px!important;border-radius:18px!important;margin-bottom:10px!important}
  .pro-modal-card,.website-live-card,.khmer-live-card{border-radius:18px!important}.khmer-live-head{border-radius:18px 18px 0 0!important}
  .khmer-live-pulsebar{padding:7px 10px;gap:7px}.khmer-live-pulsebar #khmerWorkerState{display:none}.khmer-live-pulsebar b{font-size:9px}
  .kh-separate-controls{padding:10px;border-radius:15px}.kh-history-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:390px){
  .fresh-logo-shell{width:54px;height:54px;flex-basis:54px}.fresh-logo-shell .bh168-brand-logo{width:46px!important;height:46px!important}
  .app>header.fresh-hero h1{font-size:21px!important}.app>header.fresh-hero p{font-size:9px!important}
  .fresh-stat-card b{font-size:10px}.pro-actions button{font-size:9px!important}
}

@media print{
  body{background:#fff!important}.app{width:100%!important}.fresh-hero,.pro-toolbar,.toolbar{display:none!important}
}

.fresh-toast{position:fixed;z-index:300000;left:50%;bottom:24px;max-width:min(90vw,480px);padding:12px 17px;border-radius:14px;background:#20263a;color:#fff;font-size:12px;font-weight:900;box-shadow:0 15px 40px rgba(32,38,58,.24);opacity:0;pointer-events:none;transform:translate(-50%,18px);transition:.22s ease}.fresh-toast.show{opacity:1;transform:translate(-50%,0)}.fresh-toast.warn{background:#b54708}
