html, body { height: 100%; }
body { margin: 0; overflow: hidden; font-family: Arial, Helvetica, sans-serif; }

.edpdf-wrap { display: flex; gap: 10px; height: 100vh; padding: 10px; box-sizing: border-box; }

.edpdf-list { width: 340px; border: 1px solid #ddd; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.edpdf-list-head { padding: 10px; border-bottom: 1px solid #eee; background: #f8f8f8; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.edpdf-list-title { font-weight: bold; }
.edpdf-sort { padding: 6px; }

.edpdf-manage { padding: 8px 10px; border-bottom: 1px solid #eee; background: #fcfcfc; }
.edpdf-manage summary { cursor: pointer; font-weight: bold; }
.edpdf-manage-block { margin-top: 10px; }
.edpdf-manage-title { font-weight: bold; margin-bottom: 6px; }
.edpdf-manage form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.edpdf-manage input[type="file"] { max-width: 100%; }
.edpdf-manage select, .edpdf-manage input[type="text"] { padding: 6px; min-width: 220px; }
.edpdf-manage button { padding: 6px 10px; cursor: pointer; }

.edpdf-title-grid { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.edpdf-title-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; align-items: center; }
.edpdf-title-file { font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.edpdf-list ul { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.edpdf-list li { border-bottom: 1px solid #f0f0f0; }
.edpdf-list a { display: block; padding: 10px; text-decoration: none; color: #333; }
.edpdf-list a:hover { background: #f5f5f5; }
.edpdf-attach-title { font-weight: 600; }
.edpdf-attach-sub { font-size: 12px; color: #666; margin-top: 4px; }

.edpdf-viewer { flex: 1; min-width: 0; border: 1px solid #ddd; background: #fff; display: flex; flex-direction: column; overflow: hidden; }

.edpdf-toolbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid #eee; background: #f8f8f8; }
.edpdf-toolbar-left, .edpdf-toolbar-right { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.edpdf-toolbar input { width: 70px; padding: 4px; }
.edpdf-toolbar button { padding: 6px 8px; cursor: pointer; }
.edpdf-toolbar a { padding: 6px 8px; border: 1px solid #ccc; background: #fff; text-decoration: none; color: #333; border-radius: 2px; }

.edpdf-canvas-wrap { overflow: auto; flex: 1; padding: 10px; }
#edpdfCanvas { display: block; margin: 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.edpdf-msg { padding: 10px; color: #b00; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .edpdf-wrap { flex-direction: column; height: auto; }
  .edpdf-list { width: auto; height: 360px; }
  .edpdf-viewer { height: 70vh; }
  .edpdf-title-row { grid-template-columns: 1fr; }
}

.edpdf-dropzone{
  border: 2px dashed #bbb;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  margin: 8px 0;
  text-align: center;
  font-size: 13px;
}
.edpdf-dropzone.drag{ border-color: #666; background: #f5f5f5; }

.edpdf-upload-msg{ margin-top: 6px; font-size: 12px; }
.edpdf-upload-msg.ok{ color: #0a6; }
.edpdf-upload-msg.err{ color: #b00; }

.edpdf-attach{ position: relative; }
.edpdf-del-form{ position:absolute; top:8px; right:8px; margin:0; }
.edpdf-del-btn{
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  line-height: 1;
}
.edpdf-del-btn:hover{ background:#f2f2f2; }

.edpdf-list { order: 2; }

@media (max-width: 900px) {
  .edpdf-wrap { flex-direction: column; height: auto; }
  .edpdf-viewer { order: 1; }
  .edpdf-list { order: 2; width: auto; height: 360px; }
}

/* v1.2.6 layout: attachment LEFT on desktop, BELOW on mobile */
.edpdf-list { order: 1; }
.edpdf-viewer { order: 2; }

@media (max-width: 900px) {
  .edpdf-wrap { flex-direction: column; height: auto; }
  .edpdf-viewer { order: 1; }
  .edpdf-list { order: 2; width: auto; height: 360px; }
}

/* icon links (home / full page) */
.edpdf-iconlink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:30px;
  border:1px solid #ccc;
  background:#fff;
  text-decoration:none;
  color:#333;
  border-radius:4px;
  font-size:16px;
  line-height:1;
}
.edpdf-iconlink:hover{ background:#f2f2f2; }

/* icon buttons (full page / back) */
.edpdf-iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:30px;
  border:1px solid #ccc;
  background:#fff;
  color:#333;
  border-radius:4px;
  font-size:16px;
  line-height:1;
  cursor:pointer;
}
.edpdf-iconbtn:hover{ background:#f2f2f2; }

/* list item structure (supports delete button beside title) */
.edpdf-attach-item{ position:relative; }
.edpdf-del-form{ position:absolute; top:10px; right:8px; }
.edpdf-attach{ display:block; padding-right:36px; }
