#topup-open{
  position:absolute;
  z-index:85;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 10px;
  border:1.5px solid #d4aa54;
  border-radius:999px;
  background:linear-gradient(180deg,#1a2f42f5 0%,#0b1926f7 100%);
  color:#f7d784;
  font:700 11.5px/1 Tahoma,'Noto Sans Thai',sans-serif;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.45);
  letter-spacing:.02em;
  white-space:nowrap;
  transition:transform .12s,filter .12s,border-color .12s;
}
#topup-open:hover{filter:brightness(1.14);border-color:#ffe08a;transform:translateY(-1px)}
#topup-open.mobile{padding:5px 12px;border-radius:999px;font-size:11.5px}
#topup-open[hidden]{display:none!important}
#footer-topup-btn{
  background:linear-gradient(180deg,#f5d27a 0%,#c7912c 100%);
  color:#251806;
  border:1px solid #a67822;
  border-radius:8px;
  padding:10px 16px;
  font:700 13px Tahoma,'Noto Sans Thai',sans-serif;
  cursor:pointer;
  white-space:nowrap;
}
#footer-topup-btn:hover{filter:brightness(1.06)}

.ro-topup-layer{
  position:fixed;
  inset:0;
  z-index:10040;
  display:grid;
  place-items:center;
  padding:clamp(8px,2vw,20px);
  background:rgba(8,18,28,.72);
  font-family:Tahoma,'Noto Sans Thai',sans-serif;
  color:#263c4d;
  box-sizing:border-box;
  isolation:isolate;
}
.ro-topup-layer *{box-sizing:border-box}
.ro-topup-dialog{
  width:min(860px,100%);
  max-height:calc(100dvh - 16px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:#fffdf7;
  border:1px solid #dfc486;
  border-radius:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.55);
}
.ro-topup-header{
  position:relative;
  flex:none;
  padding:16px 52px 14px 24px;
  background:linear-gradient(180deg,#fff7df 0%,#f4e4bd 100%);
  border-bottom:1px solid #e1cb97;
}
.ro-topup-eyebrow{font-size:11px;font-weight:700;letter-spacing:.14em;color:#8e6b29;text-transform:uppercase}
.ro-topup-header h1{margin:3px 0 0;font-size:24px;line-height:1.25;color:#21425c}
.ro-topup-header p{margin:4px 0 0;font-size:12.5px;color:#516878}
.ro-topup-close{
  position:absolute;
  right:14px;
  top:14px;
  width:36px;
  height:36px;
  border:1px solid #bfa772;
  border-radius:50%;
  background:#fff;
  color:#314d63;
  font-size:24px;
  line-height:1;
  cursor:pointer;
}
.ro-topup-close:hover{background:#f7efd8}
.ro-topup-main{
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:16px 24px 12px;
  min-height:0;
}
.ro-topup-account{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:12px;
  border-bottom:1px solid #ebe1c9;
  font-size:13px;
}
.ro-topup-account strong{color:#8c631c;font-size:16px}
.ro-topup-tabs{display:flex;gap:8px;flex-wrap:wrap}
.ro-topup-tab{
  border:1px solid #c9d4de;
  border-radius:8px;
  background:#f5f8fb;
  color:#2b475d;
  padding:7px 13px;
  font:700 12.5px Tahoma,'Noto Sans Thai',sans-serif;
  cursor:pointer;
}
.ro-topup-tab.is-active{
  background:#23445f;
  border-color:#23445f;
  color:#fff;
}
.ro-topup-badge{
  display:inline-block;
  margin-left:5px;
  padding:1px 6px;
  border-radius:999px;
  background:#e08a24;
  color:#fff;
  font-size:11px;
}
.ro-topup-section{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 0 10px;
}
.ro-topup-section h2{margin:0;font-size:17px;color:#21425c}
.ro-topup-section span{font-size:12px;color:#6c7d8a}
.ro-topup-packages{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.ro-topup-package{
  position:relative;
  min-height:96px;
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border:1px solid #d7dde2;
  border-radius:12px;
  background:#fffefb;
  color:#274760;
  cursor:pointer;
  font:inherit;
  transition:border-color .14s,background .14s,box-shadow .14s;
}
.ro-topup-package:hover{border-color:#c29a48;background:#fffaf0}
.ro-topup-package:last-child{
  grid-column:1/-1;
  min-height:74px;
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  justify-items:center;
  align-items:center;
  background:#faf3e2;
}
.ro-topup-package:last-child .ro-topup-unit{display:none}
.ro-topup-package.is-selected{
  border:2px solid #b5842e;
  background:#fff4d6;
  box-shadow:0 0 0 3px rgba(212,169,85,.22);
}
.ro-topup-baht{font-size:13.5px;font-weight:700}
.ro-topup-points{font-size:24px;font-weight:700;line-height:1.15;color:#1b3b54}
.ro-topup-unit{font-size:10px;letter-spacing:.12em;color:#738694}
.ro-topup-bonus{font-size:11.5px;color:#9d6b1e;font-weight:700}
.ro-topup-checkout{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0 4px;
}
.ro-topup-checkout p{margin:0;font-size:12.5px;color:#667885}
.ro-topup-primary{
  border:1px solid #9c7228;
  border-radius:9px;
  background:linear-gradient(180deg,#d4a74f 0%,#ad7c27 100%);
  color:#fff;
  min-height:42px;
  padding:10px 20px;
  font:700 14px Tahoma,'Noto Sans Thai',sans-serif;
  cursor:pointer;
  box-shadow:0 3px 10px rgba(156,114,40,.25);
}
.ro-topup-primary:hover:not(:disabled){filter:brightness(1.05)}
.ro-topup-primary:disabled{opacity:.48;cursor:not-allowed}
.ro-topup-secondary{
  border:1px solid #b7c6d4;
  border-radius:9px;
  background:#f4f8fb;
  color:#27445a;
  min-height:40px;
  padding:8px 16px;
  font:700 13px Tahoma,'Noto Sans Thai',sans-serif;
  cursor:pointer;
}
.ro-topup-secondary:hover:not(:disabled){background:#e7f0f7}
.ro-topup-secondary:disabled{opacity:.5;cursor:not-allowed}

/* Scan + Upload Slip layout */
.ro-topup-scan-grid{
  display:grid;
  grid-template-columns:minmax(220px,285px) minmax(0,1fr);
  gap:20px;
  padding:12px 0 8px;
  align-items:start;
}
.ro-topup-qr-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:14px;
  background:#faf4e6;
  border:1px solid #e2cf9f;
  border-radius:12px;
  text-align:center;
}
.ro-topup-qr-card img{
  width:220px;
  max-width:100%;
  height:auto;
  background:#fff;
  padding:8px;
  border-radius:8px;
  box-shadow:0 3px 14px rgba(0,0,0,.1);
}
.ro-topup-qr-amount{
  margin:10px 0 2px;
  font-size:24px;
  font-weight:700;
  color:#7a5314;
}
.ro-topup-qr-points{
  font-size:14px;
  font-weight:700;
  color:#1f5b3a;
  margin-bottom:6px;
}
.ro-topup-qr-meta{
  font-size:12px;
  line-height:1.55;
  color:#526573;
  margin:4px 0;
}
.ro-topup-download{
  margin-top:6px;
  font-size:12.5px;
  font-weight:700;
  color:#255b84;
  text-decoration:underline;
}
.ro-topup-upload-card{
  display:flex;
  flex-direction:column;
  gap:11px;
  padding:16px;
  background:#fff;
  border:1px solid #d9e2ea;
  border-radius:12px;
}
.ro-topup-upload-card h2{margin:0;font-size:17px;color:#21425c}
.ro-topup-upload-card p{margin:0;font-size:13px;line-height:1.55;color:#4f6473}
.ro-topup-ref-box{
  padding:8px 11px;
  background:#f3f7fa;
  border:1px dashed #b9cad8;
  border-radius:8px;
  font-size:12px;
  color:#345066;
  display:flex;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}
.ro-topup-ref-box code{font:700 12.5px Consolas,monospace;color:#17354c;user-select:all}
.ro-topup-dropzone{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:16px;
  border:2px dashed #c89d47;
  border-radius:11px;
  background:#fffaf0;
  cursor:pointer;
  text-align:center;
  transition:background .14s,border-color .14s;
}
.ro-topup-dropzone:hover{background:#fff3d6;border-color:#a57822}
.ro-topup-dropzone input[type="file"]{display:none}
.ro-topup-upload-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 18px;
  border-radius:8px;
  background:#23445f;
  color:#fff;
  font-weight:700;
  font-size:13.5px;
}
.ro-topup-dropzone small{font-size:11.5px;color:#6c7d8a}
.ro-topup-preview-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  border:1px solid #cfe0ce;
  background:#f4faf3;
  border-radius:9px;
}
.ro-topup-preview-wrap img{
  width:72px;
  height:92px;
  object-fit:cover;
  border-radius:6px;
  border:1px solid #b8ccb7;
  background:#fff;
  flex:none;
}
.ro-topup-preview-info{min-width:0;flex:1;font-size:12.5px}
.ro-topup-preview-info strong{display:block;color:#214f2d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ro-topup-preview-info span{color:#5e7264;font-size:11.5px}
.ro-topup-note-input{
  width:100%;
  padding:9px 11px;
  border:1px solid #bfcdd8;
  border-radius:8px;
  font:13px Tahoma,'Noto Sans Thai',sans-serif;
  color:#1f3547;
  background:#fff;
}
.ro-topup-actions-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.ro-topup-actions-row .ro-topup-primary{flex:1}

/* Submitted / Status / History */
.ro-topup-state-box{
  text-align:center;
  padding:22px 12px 18px;
}
.ro-topup-state-icon{
  display:grid;
  place-items:center;
  width:60px;
  height:60px;
  margin:0 auto 12px;
  border-radius:50%;
  font-size:30px;
  font-weight:700;
}
.ro-topup-state-icon.pending{background:#fff3d6;border:1px solid #dfbe74;color:#9b6a15}
.ro-topup-state-icon.approved{background:#e4f3e5;border:1px solid #96c79a;color:#256a35}
.ro-topup-state-icon.rejected{background:#fde9e7;border:1px solid #e0a59f;color:#a5352b}
.ro-topup-state-box h2{margin:0 0 6px;font-size:21px;color:#21425c}
.ro-topup-state-box .ro-topup-big-pts{display:block;font-size:26px;font-weight:700;color:#8e651c;margin:6px 0}
.ro-topup-state-box p{margin:6px auto;max-width:520px;font-size:13px;line-height:1.65;color:#4f6473}
.ro-topup-history-list{
  display:grid;
  gap:10px;
  padding:10px 0 4px;
}
.ro-topup-history-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid #dce3ea;
  border-radius:10px;
  background:#fff;
}
.ro-topup-history-item h3{margin:0 0 3px;font-size:14.5px;color:#1f3f58}
.ro-topup-history-item p{margin:2px 0;font-size:12px;color:#5f7280}
.ro-topup-pill{
  display:inline-block;
  padding:3px 9px;
  border-radius:999px;
  font-size:11.5px;
  font-weight:700;
  white-space:nowrap;
}
.ro-topup-pill.pending_slip{background:#eef3f8;color:#3f5b72}
.ro-topup-pill.pending_review{background:#fff1cf;color:#915e0b}
.ro-topup-pill.approved{background:#e2f3e4;color:#1e6b34}
.ro-topup-pill.rejected{background:#fde8e6;color:#a33127}
.ro-topup-status{
  margin:0;
  padding:9px 24px 13px;
  font-size:12.5px;
  min-height:36px;
  border-top:1px solid #efe6d2;
  background:#faf6ec;
  color:#3b6650;
}
.ro-topup-status.is-error{color:#a8382c}
.ro-topup-loading{padding:36px 16px;text-align:center;color:#516878}
.ro-topup-layer [hidden]{display:none!important}

@media(max-width:680px){
  .ro-topup-dialog{border-radius:12px}
  .ro-topup-header{padding:12px 46px 10px 16px}
  .ro-topup-header h1{font-size:20px}
  .ro-topup-main{padding:12px 14px 8px}
  .ro-topup-packages{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .ro-topup-package{min-height:84px;padding:10px 8px}
  .ro-topup-package:last-child{grid-template-columns:1fr 1fr}
  .ro-topup-package:last-child .ro-topup-bonus{grid-column:1/-1}
  .ro-topup-scan-grid{grid-template-columns:1fr;gap:12px}
  .ro-topup-qr-card img{width:190px}
  .ro-topup-checkout{flex-direction:column;align-items:stretch}
  .ro-topup-history-item{flex-direction:column;align-items:stretch}
  .ro-topup-status{padding:8px 14px 11px}
}
@media(max-height:500px){
  .ro-topup-header{padding:8px 44px 8px 16px}
  .ro-topup-header h1{font-size:18px}
  .ro-topup-header p{display:none}
  .ro-topup-main{padding:10px 16px 6px}
  .ro-topup-qr-card img{width:165px}
}
