body{
  margin:0;
  font-family:Arial,sans-serif;
  background:#e5e7eb;
  color:#111827;
}
.editor-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:260px 1fr;
}
.thumbbar{
  background:#111827;
  color:#fff;
  padding:18px 14px;
  overflow-y:auto;
}
.thumbbar-header{
  font-size:20px;
  font-weight:700;
  margin-bottom:18px;
}
.thumbnail-container{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.thumb-item{
  background:#1f2937;
  border-radius:12px;
  padding:10px;
  cursor:pointer;
  transition:.2s ease;
}
.thumb-item:hover{
  background:#273449;
}
.thumb-item canvas{
  width:100%;
  height:auto;
  display:block;
  border-radius:8px;
  background:#fff;
}
.thumb-label{
  margin-top:8px;
  font-size:13px;
  color:#cbd5e1;
  text-align:center;
}
.editor-main{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.editor-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:18px 24px;
  background:#f9fafb;
  border-bottom:1px solid #d1d5db;
  position:sticky;
  top:0;
  z-index:1000;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
}
.editor-title{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.editor-title strong{
  font-size:22px;
}
.editor-title span{
  color:#4b5563;
}
.editor-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.font-size-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:12px;
  padding:10px 12px;
}
.font-size-wrap span{
  font-size:14px;
  color:#374151;
}
.font-size-wrap select{
  border:none;
  background:transparent;
  font-size:14px;
  outline:none;
}
.editor-stage{
  flex:1;
  overflow:auto;
  padding:24px;
  scroll-padding-top:110px;
}
.save-status{
  margin:0 auto 18px;
  max-width:420px;
  background:#dcfce7;
  color:#166534;
  padding:12px 16px;
  border-radius:12px;
  text-align:center;
}
.pdf-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:28px;
}
.pdf-page-wrap{
  position:relative;
  background:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}
.pdf-page-wrap canvas{
  display:block;
}
.pdf-page-wrap.active-page{
  outline:3px solid #2563eb;
  outline-offset:4px;
}
.overlay-layer{
  position:absolute;
  inset:0;
  z-index:5;
}
.text-box{
  position:absolute;
  min-width:18px;
  min-height:18px;
  padding:2px 4px;
  background:rgba(255,255,255,0.78);
  border:2px dashed #2563eb;
  border-radius:6px;
  color:#111827;
  font-size:18px;
  line-height:1.2;
  cursor:move;
  user-select:none;
  white-space:pre-wrap;
  box-sizing:border-box;
  overflow:visible;
  resize:none;
}
.text-box.selected{
  border-style:solid;
  border-color:#dc2626;
  background:rgba(255,255,255,0.96);
  box-shadow:0 0 0 2px rgba(220,38,38,.10);
}
.text-box[contenteditable="true"]:focus{
  outline:none;
}
@media (max-width: 980px){
  .editor-shell{grid-template-columns:1fr}
  .thumbbar{display:none}
}


.text-box:focus{
  outline:none;
}


.overlay-layer.add-text-mode{
  cursor:crosshair;
}

#addTextBtn.tool-active{
  box-shadow:0 0 0 3px rgba(37,99,235,.20);
}


.resize-handle{
  position:absolute;
  width:12px;
  height:12px;
  right:-7px;
  bottom:-7px;
  background:#2563eb;
  border:2px solid #ffffff;
  border-radius:50%;
  box-shadow:0 1px 4px rgba(0,0,0,.25);
  cursor:nwse-resize;
  display:none;
  z-index:20;
}

.text-box.selected .resize-handle{
  display:block;
}


.text-content{
  width:100%;
  height:100%;
  outline:none;
  white-space:pre-wrap;
  word-break:break-word;
  overflow:hidden;
  cursor:text;
}

.text-content:focus{
  outline:none;
}

.editor-shell{
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.04), transparent 20%),
    #eef2f7;
}

.thumbbar{
  background:linear-gradient(180deg, #081225, #0b1730);
  border-right:1px solid rgba(255,255,255,.04);
}

.thumbbar-header{
  font-size:28px;
  font-weight:800;
  letter-spacing:-.2px;
  margin-bottom:20px;
}

.thumb-item{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.06);
  border-radius:18px;
  padding:12px;
  box-shadow:none;
}

.thumb-item:hover{
  background:rgba(255,255,255,.08);
  transform:translateY(-1px);
}

.thumb-item canvas{
  border-radius:12px;
  box-shadow:0 8px 18px rgba(0,0,0,.14);
}

.thumb-label{
  margin-top:10px;
  font-size:14px;
  font-weight:600;
  color:#d6e3ff;
}

.editor-topbar{
  background:rgba(255,255,255,.84);
  backdrop-filter:blur(10px);
  border-bottom:1px solid #dbe3ee;
  box-shadow:0 8px 24px rgba(15,23,42,.05);
}

.editor-title strong{
  font-size:30px;
  font-weight:800;
  letter-spacing:-.3px;
}

.editor-title span{
  font-size:16px;
  color:#556276;
}

.editor-actions .btn{
  border-radius:18px;
}

.font-size-wrap{
  background:rgba(255,255,255,.92);
  border:1px solid #dbe3ee;
  border-radius:18px;
  padding:12px 14px;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
}

.editor-stage{
  padding:28px;
}

.pdf-page-wrap{
  border-radius:6px;
  overflow:visible;
  box-shadow:0 20px 40px rgba(15,23,42,.14);
}

.pdf-page-wrap.active-page{
  outline:3px solid #2563eb;
  outline-offset:6px;
}

.text-box{
  border-radius:12px;
  transition:box-shadow .14s ease, border-color .14s ease, background .14s ease;
  box-shadow:0 3px 10px rgba(37,99,235,.08);
}

.text-box.selected{
  box-shadow:0 8px 22px rgba(220,38,38,.12);
}

.save-status{
  box-shadow:0 12px 24px rgba(22,101,52,.08);
}

@media (max-width: 980px){
  .editor-stage{
    padding:18px;
  }
}
