:root{
  --bp-primary:#00A754;
  --bp-primary-hover:#00A754;
  --bp-link:#0b2a4a;
  --bp-bg:#f6f7fb;
  --bp-surface:#ffffff;
  --bp-text:#0f172a;
  --bp-muted:#475569;
  --bp-border:#e5e7eb;
  --bp-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius:16px;
  --radius-sm:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: linear-gradient(180deg, var(--bp-bg), #ffffff);
  color:var(--bp-text);
}

a{color:var(--bp-link); text-decoration: none}
a:hover{text-decoration: underline}

.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 10px 0 18px;
}

.brand{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.brand h1{
  margin:0;
  font-size: 22px;
  letter-spacing: .2px;
}
.brand p{
  margin:0;
  color:var(--bp-muted);
  font-size: 13px;
}

.actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.btn{
  border:1px solid var(--bp-border);
  background: var(--bp-surface);
  padding: 10px 14px;
  border-radius: 12px;
  cursor:pointer;
  color: var(--bp-text);
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease, transform 120ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--bp-shadow);
}
.btn:active{
  transform: translateY(0);
  box-shadow: none;
}

.btnPrimary{
  border-color: transparent;
  background: var(--bp-primary);
  color: #fff;
}
.btnPrimary:hover{background: var(--bp-primary-hover)}

.btnDanger{
  border-color: transparent;
  background: #ef4444;
  color: #fff;
}
.btnDanger:hover{filter: brightness(0.95)}

.card{
  background: var(--bp-surface);
  border: 1px solid var(--bp-border);
  border-radius: var(--radius);
  box-shadow: var(--bp-shadow);
}

.grid2{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
}
@media (max-width: 940px){
  .grid2{grid-template-columns: 1fr}
}

.section{
  padding: 16px;
}

.sectionTitle{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom: 10px;
}
.sectionTitle h2{
  margin:0;
  font-size: 16px;
}
.sectionTitle span{
  color:var(--bp-muted);
  font-size:12px;
}

.drop{
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 18px;
  background: #fbfcff;
  text-align:center;
}
.drop.isDrag{
  border-color: var(--bp-primary);
  background: #fff5f5;
}
.drop h3{
  margin:0 0 6px;
  font-size: 14px;
}
.drop p{
  margin:0;
  color:var(--bp-muted);
  font-size: 12px;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap: wrap;
  margin-top: 12px;
}
.rowLeft{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

.hint{
  color:var(--bp-muted);
  font-size: 12px;
  margin-top: 6px;
}

.preview{
  margin-top: 12px;
  border:1px solid var(--bp-border);
  border-radius: var(--radius-sm);
  overflow:hidden;
  background:#fff;
}
.preview img{
  width: 100%;
  height: 260px;
  object-fit: contain;
  display:block;
}
.previewMeta{
  padding: 10px 12px;
  border-top:1px solid var(--bp-border);
}
.previewMeta .url{
  font-size: 12px;
  color: var(--bp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.galleryHeader{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}
.galleryHeader h2{margin:0;font-size:16px}
.gallery{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px){
  .gallery{grid-template-columns: repeat(2, minmax(0, 1fr))}
}
@media (max-width: 560px){
  .gallery{grid-template-columns: 1fr}
}
.tile{
  border:1px solid var(--bp-border);
  border-radius: var(--radius-sm);
  overflow:hidden;
  background:#fff;
  display:flex;
  flex-direction:column;
  min-height: 230px;
}
.tile img{
  width:100%;
  height: 140px;
  object-fit: cover;
  background:#f8fafc;
}
.tileBody{
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.tileBody .name{
  font-size: 12px;
  color: var(--bp-muted);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tileBody .urlDisplay{
  font-size: 12px;
  color: var(--bp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tileBody .tileActions{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  margin-top:auto;
  width:100%;
}

.tileButtons{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
}

.btnCopy{
  border-color: transparent;
  background: var(--bp-primary);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.btnCopy:hover{background: var(--bp-primary-hover)}

.tileBody .tileActions .btnDanger{
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.toast{
  display:none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid var(--bp-border);
  background:#fff;
  color:var(--bp-muted);
  font-size: 13px;
}
.toast.show{display:block}
.toast.error{
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.modalBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.modalBackdrop.show{display:flex}
.modal{
  width: 420px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  border:1px solid var(--bp-border);
  box-shadow: var(--bp-shadow);
  padding: 16px;
}
.modal h2{margin:0 0 10px;font-size:16px}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom: 10px;
}
.field label{
  font-size:12px;
  color:var(--bp-muted);
  font-weight:600;
}
.field input{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--bp-border);
  outline:none;
}
.modal .modalActions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top: 12px;
}

