/* ==========================================================================
   pdf/pdf.css — สไตล์เฉพาะหน้า /pdf เท่านั้น
   (สี/ปุ่ม/การ์ดพื้นฐานมาจาก /shared/tokens.css และ /shared/components.css แล้ว)
   ========================================================================== */

.page-brand-text{
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  margin-top:2px;
}

.pdf-main{
  flex:1;
  width:66.6667%;
  max-width:none;
  margin:0 auto;
  padding:150px 24px 80px;
  display:flex;
  flex-direction:column;
  gap:20px;
}

/* ---------- Hero (แทน .pdf-page-header เดิม) ---------- */
.hero{
  text-align:center;
  padding:0 0 4px;
}
.hero h1{
  margin:0;
  font-size:32px;
  font-weight:800;
  letter-spacing:-.01em;
  color:var(--ink);
}
.hero h1 .hl{ color:var(--accent); }
.hero .subtitle{
  margin:14px auto 0;
  max-width:640px;
  color:var(--muted);
  font-size:14px;
  line-height:1.7;
}

/* ---------- Stat badge (จำนวนใช้งานจริง + Free + ปลอดภัย) ---------- */
.stat-badge{
  margin:16px 0 0;
  display:inline-flex;
  align-items:center;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px;
  background:var(--panel);
  border-radius:999px;
  padding:10px 22px;
  font-size:14px;
  box-shadow:0 6px 20px rgba(20,40,30,.06);
}
.stat-badge .star{ color:#f5b301; margin-right:2px; }
.stat-badge .cnt{ color:var(--accent-dark); font-weight:800; }
.stat-badge .lbl1{ color:var(--muted); font-weight:500; }
.stat-badge .sep{ color:var(--line); margin:0 2px; }
.stat-badge .lbl2{ display:inline-flex; gap:6px; }

/* ---------- Features strip ---------- */
.features{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px 24px;
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:18px;
  margin-top:8px;
}
.feature{
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.feature .icon{
  width:40px;
  height:40px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex-shrink:0;
}
.feature.f1 .icon{ background:var(--accent-soft); color:var(--accent-dark); }
.feature.f2 .icon{ background:#eaf1ff; color:var(--blue); }
.feature.f3 .icon{ background:#f1ecff; color:var(--purple); }
.feature.f4 .icon{ background:#fff3e0; color:var(--orange); }
.feature h3{ margin:0 0 2px; font-size:14px; font-weight:700; }
.feature p{ margin:0; font-size:12.5px; color:var(--muted); }

/* ---------- Footer ---------- */
footer{
  max-width:none;
  margin:24px auto 0;
  width:66.6667%;
  padding:14px 8px 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:10px;
  font-size:12px;
  color:var(--muted);
}
footer .badges{ display:flex; justify-content:center; gap:8px; flex-wrap:wrap; }
footer .fbadge{
  background:var(--accent-soft);
  color:var(--accent-dark);
  border-radius:999px;
  padding:5px 12px;
  font-weight:600;
  font-size:12px;
}

/* ---------- แท็บหลัก ---------- */
.pdf-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.pdf-top-save-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:10px 14px;
  white-space:nowrap;
  box-shadow:0 4px 14px rgba(22,163,74,.25);
}
.pdf-top-save-btn i{ font-size:20px; flex-shrink:0; }
.pdf-top-save-label{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height:1.3;
  font-size:13.5px;
  font-weight:700;
}
.pdf-top-save-label small{ font-size:11px; font-weight:500; opacity:.85; }
.pdf-tab-btn{
  font-family:inherit;
  font-size:14px;
  font-weight:600;
  color:var(--muted);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 18px;
  cursor:pointer;
  transition:all .15s ease;
}
.pdf-tab-btn:hover{ border-color:var(--accent); color:var(--accent-dark); }
.pdf-tab-btn.active{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

.pdf-tab-panel{ display:none; }
.pdf-tab-panel.active{ display:block; }

.pdf-tool-col{ padding-bottom:4px; }
.pdf-tool-body{
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* ---------- แท็บย่อยของ "แปลง" ---------- */
.pdf-subtabs{
  display:flex;
  gap:8px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  flex-wrap:wrap;
}
.pdf-subtab-btn{
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  color:var(--muted);
  background:none;
  border:1px solid var(--line);
  border-radius:10px;
  padding:8px 14px;
  cursor:pointer;
}
.pdf-subtab-btn.active{ color:var(--accent-dark); border-color:var(--accent); background:var(--accent-soft); }
.pdf-subtab-panel{ display:none; flex-direction:column; gap:16px; }
.pdf-subtab-panel.active{ display:flex; }

/* ---------- โซนลากไฟล์วาง ---------- */
.pdf-dropzone{
  border:2px dashed var(--line);
  border-radius:16px;
  padding:36px 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-align:center;
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.pdf-dropzone:hover{ border-color:var(--accent); background:var(--accent-soft); }
.pdf-dropzone.drag-over{ border-color:var(--accent); background:var(--accent-soft); }
.pdf-dropzone-icon{ font-size:32px; }
.pdf-dropzone-text{ font-size:14px; font-weight:600; color:var(--ink); }
.pdf-dropzone-sub{ font-size:12px; color:var(--muted); }

/* ---------- รายการไฟล์ (ใช้ร่วมกันทั้งรวมไฟล์/แปลง) ---------- */
.pdf-list-empty{
  font-size:13px;
  color:var(--muted);
  text-align:center;
  padding:12px;
}
.merge-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.merge-item{
  display:flex;
  align-items:center;
  gap:12px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px 10px;
  background:var(--panel);
}
.merge-item.drag-target{ border-color:var(--accent); background:var(--accent-soft); }
.merge-drag-handle{ cursor:grab; color:var(--muted); font-size:16px; }
.merge-thumb{
  width:44px; height:56px;
  border-radius:6px;
  overflow:hidden;
  background:#f1f4f2;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.merge-thumb img{ width:100%; height:100%; object-fit:cover; }
.thumb-placeholder{ font-size:10px; font-weight:700; color:var(--muted); }
.merge-meta{ flex:1; min-width:0; }
.merge-name{ font-size:13px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.merge-sub{ font-size:11.5px; color:var(--muted); }
.merge-order-btns{ display:flex; gap:2px; flex-shrink:0; }
.merge-order-btns button{ padding:6px 9px; font-size:12px; }
.merge-remove:hover{ color:var(--bad); border-color:var(--bad); }

/* ---------- ตัวแก้ไข (แท็บ "แก้ไข") ---------- */
.edit-workspace{ display:flex; flex-direction:column; gap:14px; }
.edit-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding:10px;
  background:#f7faf8;
  border:1px solid var(--line);
  border-radius:12px;
}
.edit-toolbar [data-tool]{ padding:8px 12px; }
.edit-toolbar [data-tool].active,
.edit-toolbar [data-style].active,
.edit-toolbar [data-align].active{ background:var(--accent); border-color:var(--accent); color:#fff; }
.edit-toolbar-sep{ width:1px; height:22px; background:var(--line); margin:0 4px; }
.edit-toolbar-field{ font-size:12.5px; color:var(--muted); display:flex; align-items:center; gap:6px; }
.edit-toolbar-field input[type="color"]{ width:30px; height:26px; border:1px solid var(--line); border-radius:6px; padding:0; background:none; cursor:pointer; }
.edit-toolbar-field input[type="range"]{ width:100px; }
.edit-size-number{
  width:48px;
  font-family:inherit;
  font-size:12.5px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:4px 6px;
  color:var(--ink);
  background:#fff;
}
body.dark .edit-size-number{ background:var(--panel); color:var(--ink); border-color:var(--line); }

.edit-page-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  font-size:13px;
  color:var(--muted);
  font-weight:600;
}
.edit-zoom-group{ display:flex; align-items:center; gap:8px; }
.ebtn-sm{ width:28px; height:28px; font-size:14px; border-radius:8px; }
.edit-zoom-label{ min-width:44px; text-align:center; cursor:pointer; user-select:none; }

.edit-canvas-wrap{
  position:relative;
  overflow:auto;
  max-height:78vh;
  display:block;
  text-align:center;
  background:#eef2f0;
  border-radius:14px;
  padding:16px;
}
.edit-canvas-wrap canvas{
  display:block;
  margin:0 auto;
}
.edit-canvas-row{
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.edit-canvas-row .edit-canvas-wrap{
  flex:1;
  min-width:0;
}
.edit-layers-panel{
  width:250px;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  max-height:78vh;
  overflow-y:auto;
}
.edit-layers-title{ font-size:13px; font-weight:700; color:var(--ink); margin-bottom:2px; }
.edit-layers-empty{ font-size:12px; color:var(--muted); text-align:center; padding:16px 4px; }
.edit-layers-list{ display:flex; flex-direction:column; gap:6px; }
.edit-layer-row{
  display:flex;
  align-items:center;
  gap:4px;
  padding:6px 8px;
  border:1px solid var(--line);
  border-radius:10px;
  cursor:pointer;
  font-size:12px;
  background:#fafcfb;
}
.edit-layer-row:hover{ border-color:var(--accent); }
.edit-layer-row.active{ border-color:var(--accent); background:var(--accent-soft); }
.edit-layer-row.drag-over{ border-color:var(--accent); background:var(--accent-soft); border-style:dashed; }
.edit-layer-drag{
  flex-shrink:0;
  cursor:grab;
  color:var(--muted);
  font-size:13px;
  padding:0 2px;
}
.edit-layer-drag:active{ cursor:grabbing; }
.edit-layer-icon{ flex-shrink:0; }
.edit-layer-label{
  flex:1;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--ink);
}
.edit-layer-row button{
  flex-shrink:0;
  border:none;
  background:none;
  cursor:pointer;
  font-size:11px;
  padding:2px 4px;
  border-radius:5px;
  color:var(--muted);
}
.edit-layer-row button:hover{ background:var(--line); }
.edit-layer-row .edit-layer-del:hover{ color:var(--bad); }
body.dark .edit-layers-panel{ background:var(--panel); }
body.dark .edit-layer-row{ background:var(--panel); }

@media (max-width:900px){
  .edit-canvas-row{ flex-direction:column; }
  .edit-layers-panel{ width:100%; max-height:220px; }
}
.edit-canvas-wrap canvas{
  background:#fff;
  box-shadow:0 10px 30px rgba(20,40,30,.12);
  touch-action:none;
  cursor:crosshair;
}

.pdf-disclaimer{
  font-size:12.5px;
  line-height:1.7;
  color:var(--accent-dark);
  background:var(--accent-soft);
  border:1px solid var(--accent);
  border-radius:12px;
  padding:12px 14px;
}

/* ---------- แผงพิมพ์ข้อความ (อยู่ในแผงเลเยอร์ทางขวา แบบพับ/กางได้) ---------- */
.edit-text-panel{
  border:2px solid var(--accent);
  background:var(--accent-soft);
  border-radius:12px;
  overflow:hidden;
}
.edit-text-panel-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  background:none;
  border:none;
  font-family:inherit;
  font-size:12.5px;
  font-weight:700;
  color:var(--accent-dark);
  padding:9px 10px;
  cursor:pointer;
}
.edit-text-panel-chev{ transition:transform .15s ease; }
.edit-text-panel.open .edit-text-panel-chev{ transform:rotate(180deg); }
.edit-text-panel-body{
  display:none;
  flex-direction:column;
  gap:8px;
  padding:0 10px 10px;
}
.edit-text-panel.open .edit-text-panel-body{ display:flex; }
.edit-text-panel-hint{ font-size:11.5px; line-height:1.5; color:var(--accent-dark); }
.edit-text-panel-input{
  width:100%;
  min-height:70px;
  resize:vertical;
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px 10px;
  font-family:'Prompt', sans-serif;
  font-size:13.5px;
  line-height:1.5;
  color:var(--ink);
  background:#fff;
}
.edit-text-panel-input:focus{ outline:none; border-color:var(--accent); }
.edit-text-panel-actions{ display:flex; flex-direction:column; gap:6px; }
.edit-text-panel-actions button{ width:100%; justify-content:center; }
body.dark .edit-text-panel-input{ background:var(--panel); color:var(--ink); border-color:var(--line); }

.pdf-select{
  font-family:inherit;
  font-size:13px;
  border:1px solid var(--line);
  border-radius:8px;
  padding:6px 10px;
  background:#fff;
  color:var(--ink);
}

/* ---------- ตัวอย่างผลลัพธ์ก่อนดาวน์โหลด ---------- */
.pdf-preview{
  flex-direction:column;
  gap:12px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  background:#fafcfb;
}
.pdf-preview-loading{ font-size:13px; color:var(--muted); text-align:center; padding:20px; }
.preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.preview-header span{ font-size:13px; font-weight:700; color:var(--ink); }
.preview-strip{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:4px;
}
.preview-page{
  flex-shrink:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.preview-page img{
  height:140px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  box-shadow:0 4px 14px rgba(20,40,30,.08);
}
.preview-page span{ font-size:11px; color:var(--muted); max-width:90px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.preview-more{
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  height:140px;
  padding:0 14px;
  font-size:12px;
  color:var(--muted);
  border:1px dashed var(--line);
  border-radius:6px;
}

/* ---------- Toast แจ้งเตือน ---------- */
.pdf-toast{
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translateX(-50%) translateY(20px);
  background:var(--ink);
  color:#fff;
  font-size:13px;
  font-weight:600;
  padding:12px 20px;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.2);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:1000;
  max-width:90vw;
  text-align:center;
}
.pdf-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.pdf-toast-bad{ background:var(--bad); }
.pdf-toast-good{ background:var(--accent-dark); }

.pdf-spinner{
  display:inline-block;
  width:12px; height:12px;
  border:2px solid rgba(255,255,255,.4);
  border-top-color:#fff;
  border-radius:50%;
  animation:pdf-spin .7s linear infinite;
  vertical-align:middle;
  margin-right:4px;
}
@keyframes pdf-spin{ to{ transform:rotate(360deg); } }

/* ---------- โหมดมืด ---------- */
body.dark .pdf-tab-btn{ background:var(--panel); color:var(--ink); }
body.dark .pdf-dropzone{ background:var(--panel); }
body.dark .edit-toolbar{ background:var(--panel); }
body.dark .edit-canvas-wrap{ background:#0c120f; }
body.dark .merge-item{ background:var(--panel); }
body.dark .pdf-select{ background:var(--panel); color:var(--ink); border-color:var(--line); }

/* ---------- Responsive ---------- */
@media (max-width:640px){
  .pdf-main{ padding:190px 14px 60px; }
  .edit-toolbar{ justify-content:center; }
  .edit-canvas-wrap{ max-height:55vh; }
  .hero h1{ font-size:26px; }
  .features{ grid-template-columns:1fr; }
}

/* ---------- ปุ่ม thumbnail ใน preview (คลิกเพื่อดูขนาดใหญ่) ---------- */
.preview-page-btn{
  border:none;
  background:none;
  padding:0;
  cursor:pointer;
  display:block;
}

/* ---------- โมดัลแสดงตัวอย่างขนาดใหญ่ ---------- */
.edit-preview-modal{
  position:fixed;
  inset:0;
  z-index:2000;
  display:none;
  align-items:center;
  justify-content:center;
}
.edit-preview-modal.open{ display:flex; }
.edit-preview-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,25,20,.75);
}
.edit-preview-modal-body{
  position:relative;
  z-index:1;
  background:#fff;
  border-radius:16px;
  padding:16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  max-width:92vw;
  max-height:92vh;
}
.edit-preview-modal-close{
  position:absolute;
  top:8px;
  right:8px;
  border:none;
  background:var(--line);
  color:var(--ink);
  width:30px;
  height:30px;
  border-radius:50%;
  cursor:pointer;
  font-size:14px;
}
.edit-preview-modal-nav{
  display:flex;
  align-items:center;
  gap:14px;
  font-size:13px;
  font-weight:600;
  color:var(--muted);
}
.edit-preview-modal-imgwrap{
  overflow:auto;
  max-width:88vw;
  max-height:76vh;
  display:flex;
}
.edit-preview-modal-imgwrap canvas{
  box-shadow:0 10px 30px rgba(20,40,30,.2);
  background:#fff;
}
body.dark .edit-preview-modal-body{ background:var(--panel); }

/* ---------- Popup รวมหน้าก่อนบันทึก (ลากสลับลำดับได้) ---------- */
.save-modal{
  position:fixed;
  inset:0;
  z-index:2100;
  display:none;
  align-items:center;
  justify-content:center;
}
.save-modal.open{ display:flex; }
.save-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,25,20,.75);
}
.save-modal-body{
  position:relative;
  z-index:1;
  background:#fff;
  border-radius:16px;
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:14px;
  max-width:92vw;
  max-height:90vh;
  width:720px;
}
.save-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:14px;
  font-weight:700;
  color:var(--ink);
}
.save-modal-close{
  border:none;
  background:var(--line);
  color:var(--ink);
  width:28px;
  height:28px;
  border-radius:50%;
  cursor:pointer;
  font-size:13px;
}
.save-modal-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(110px, 1fr));
  gap:12px;
  overflow-y:auto;
  padding:4px 2px;
}
.save-page-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  border:2px solid transparent;
  border-radius:10px;
  padding:6px;
  cursor:grab;
}
.save-page-item.drag-over{ border-color:var(--accent); background:var(--accent-soft); border-style:dashed; }
.save-page-drag{ font-size:12px; color:var(--muted); }
.save-page-thumb{
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  padding:0;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(20,40,30,.08);
  overflow:hidden;
}
.save-page-thumb img{ display:block; width:100%; height:140px; object-fit:contain; background:#fff; }
.save-page-num{ font-size:11.5px; color:var(--muted); font-weight:600; }
.save-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
}
body.dark .save-modal-body{ background:var(--panel); }
body.dark .save-page-thumb{ background:var(--panel); }
body.dark .save-page-thumb img{ background:var(--panel); }

/* ---------- โมดัลขยายดูภาพหน้าเดียว (จากใน popup รวมหน้า) ---------- */
.save-big-modal{
  position:fixed;
  inset:0;
  z-index:2200;
  display:none;
  align-items:center;
  justify-content:center;
}
.save-big-modal.open{ display:flex; }
.save-big-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,25,20,.8);
}
.save-big-modal-body{
  position:relative;
  z-index:1;
  background:#fff;
  border-radius:16px;
  padding:16px;
  max-width:92vw;
  max-height:92vh;
  display:flex;
}
.save-big-modal-close{
  position:absolute;
  top:8px;
  right:8px;
  border:none;
  background:var(--line);
  color:var(--ink);
  width:30px;
  height:30px;
  border-radius:50%;
  cursor:pointer;
  font-size:14px;
  z-index:2;
}
.save-big-modal-body img{
  max-width:88vw;
  max-height:88vh;
  display:block;
  box-shadow:0 10px 30px rgba(20,40,30,.2);
}
body.dark .save-big-modal-body{ background:var(--panel); }

/* ===== Toolbar ใหม่: ไอคอนล้วน จัดกลุ่ม โชว์/ซ่อนตามเครื่องมือที่ใช้งานได้จริง ===== */
.edit-toolbar-main{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.toolbar-group{ display:flex; align-items:center; gap:6px; }
.toolbar-group[hidden]{ display:none; }
.toolbar-spacer{ flex:1; }

.ebtn{
  width:36px; height:36px; padding:0;
  display:flex; align-items:center; justify-content:center;
  background:#f1f4f2; border:none; border-radius:10px;
  color:var(--ink); font-size:17px; cursor:pointer;
  transition:background .15s ease, color .15s ease;
}
.ebtn:hover{ background:var(--line); }
.ebtn.active{ background:var(--accent); color:#fff; }
.ebtn:disabled{ opacity:.4; cursor:default; }

.ebtn-main{
  width:56px; height:48px; border-radius:12px;
  flex-direction:column; gap:2px;
}
.ebtn-main i{ font-size:18px; }
.ebtn-main span{ font-size:10px; font-weight:600; line-height:1; }

.ebtn-pill{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--accent); color:#fff; border:none;
  border-radius:10px; padding:0 14px; height:36px;
  font-family:inherit; font-size:13px; font-weight:600; cursor:pointer;
}
.ebtn-pill:hover{ background:var(--accent-dark); }
.ebtn-pill-ghost{
  background:none; color:var(--accent-dark);
  border:1px solid var(--accent);
}
.ebtn-pill-ghost:hover{ background:var(--accent-soft); }

.ecolor{
  width:36px; height:36px; padding:0; border:none; border-radius:50%;
  -webkit-appearance:none; appearance:none; cursor:pointer; overflow:hidden;
  background:none;
}
.ecolor::-webkit-color-swatch-wrapper{ padding:0; border-radius:50%; }
.ecolor::-webkit-color-swatch{ border:none; border-radius:50%; }

.edit-size-number{ width:48px; height:36px; border-radius:10px; border:1px solid var(--line); text-align:center; font-family:inherit; font-size:13px; }
#editSize{ width:80px; }

.efont{ height:36px; border-radius:10px; border:1px solid var(--line); font-family:inherit; font-size:13px; padding:0 10px; min-width:130px; }

body.dark .ebtn{ background:var(--panel); color:var(--ink); }
body.dark .edit-size-number, body.dark .efont{ background:var(--panel); color:var(--ink); border-color:var(--line); }

/* ---------- Popup ประเมินความพึงพอใจ ---------- */
.feedback-modal{
  position:fixed;
  inset:0;
  z-index:2300;
  display:none;
  align-items:center;
  justify-content:center;
}
.feedback-modal.open{ display:flex; }
.feedback-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,25,20,.7);
}
.feedback-modal-body{
  position:relative;
  z-index:1;
  background:#fff;
  border-radius:18px;
  padding:28px 24px 24px;
  width:360px;
  max-width:90vw;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
  text-align:center;
  animation:feedback-modal-in .2s ease;
}
@keyframes feedback-modal-in{
  from{ transform:scale(.9); opacity:0; }
  to{ transform:scale(1); opacity:1; }
}
.feedback-modal-close{
  position:absolute;
  top:10px;
  right:10px;
  border:none;
  background:var(--line);
  color:var(--ink);
  width:28px;
  height:28px;
  border-radius:50%;
  cursor:pointer;
  font-size:13px;
}
.feedback-modal-title{ font-size:15px; font-weight:700; color:var(--ink); line-height:1.5; }
.feedback-btn-row{ display:flex; gap:16px; }
.feedback-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  background:var(--panel);
  border:2px solid var(--line);
  border-radius:14px;
  padding:14px 22px;
  cursor:pointer;
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  color:var(--ink);
  transition:border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.feedback-btn:hover{ border-color:var(--accent); transform:translateY(-2px); box-shadow:0 6px 16px rgba(20,40,30,.1); }
.feedback-btn:active{ transform:scale(.92); }
.feedback-btn-selected.feedback-btn-good{ border-color:#f5c518; background:#fff8e1; }
.feedback-btn-selected.feedback-btn-bad{ border-color:#ff8a65; background:#fff1ec; }
.feedback-btn-pop{ animation:feedback-pop .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes feedback-pop{
  0%{ transform:scale(1); }
  40%{ transform:scale(1.25) rotate(-4deg); }
  70%{ transform:scale(.95) rotate(3deg); }
  100%{ transform:scale(1) rotate(0); }
}
.feedback-comment-box{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:8px;
  animation:feedback-modal-in .2s ease;
}
.feedback-comment-title{ font-size:13px; font-weight:700; color:var(--bad); }
.feedback-comment-input{
  width:100%;
  min-height:70px;
  resize:vertical;
  border:1px solid var(--line);
  border-radius:10px;
  padding:8px 10px;
  font-family:'Prompt', sans-serif;
  font-size:13.5px;
  color:var(--ink);
  background:#fff;
}
.feedback-comment-input:focus{ outline:none; border-color:var(--accent); }
.feedback-submit-btn{ width:100%; justify-content:center; }
.feedback-thanks{ font-size:14px; font-weight:600; color:var(--accent-dark); }
body.dark .feedback-modal-body{ background:var(--panel); }
body.dark .feedback-btn{ background:var(--panel); }
body.dark .feedback-comment-input{ background:var(--panel); color:var(--ink); border-color:var(--line); }
