/* Merge PDF — dedicated styles (uses theme vars from style.css) */
.mg-wrap { max-width: 600px; margin: 0 auto; padding: 56px 22px 90px; }
.mg-head { text-align: center; margin-bottom: 30px; }
.mg-head .eyebrow { margin-bottom: 16px; }
.mg-head h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.mg-head p { color: var(--txt2); margin-top: 12px; font-weight: 400; }

.mg-stage { animation: fadeUp .4s cubic-bezier(.22,1,.36,1) both; }
.hidden { display: none !important; }

/* dropzone */
.mg-drop { position: relative; display: block; text-align: center; cursor: pointer; padding: 46px 22px;
  border: 1.5px dashed var(--line2); border-radius: var(--r-lg); background: var(--card); transition: all .25s; }
.mg-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mg-drop:hover, .mg-drop.drag { border-color: var(--lime); background: rgba(194,240,74,0.04); }
.mg-drop-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
  background: var(--lime); color: #0a0b0d; transition: transform .25s; }
.mg-drop:hover .mg-drop-ic { transform: translateY(-4px); }
.mg-drop .t { font-size: 1.15rem; font-weight: 700; }
.mg-drop .s { font-family: 'JetBrains Mono', monospace; font-size: .74rem; color: var(--txt3); margin-top: 6px; }
.mg-drop .s strong { color: var(--lime); }

/* list */
.mg-list-wrap { margin-top: 18px; }
.mg-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: .72rem; letter-spacing: .04em; color: var(--txt3); }
.mg-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mg-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: grab;
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); transition: border-color .18s, box-shadow .18s, opacity .18s; }
.mg-item:hover { border-color: var(--txt3); }
.mg-item.dragging { opacity: .5; box-shadow: var(--shadow-lg); border-color: var(--lime); cursor: grabbing; }
.mg-item.drop-target { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.mg-grip { color: var(--txt3); flex-shrink: 0; cursor: grab; line-height: 0; }
.mg-idx { font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: var(--lime); width: 22px; flex-shrink: 0; }
.mg-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--surface2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.mg-meta { flex: 1; min-width: 0; }
.mg-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-size { font-family: 'JetBrains Mono', monospace; font-size: .7rem; color: var(--txt3); }
.mg-moves { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.mg-move { background: none; border: none; color: var(--txt3); cursor: pointer; line-height: .8; font-size: .8rem; padding: 1px 4px; border-radius: 4px; }
.mg-move:hover:not(:disabled) { color: var(--lime); background: var(--surface2); }
.mg-move:disabled { opacity: .25; cursor: default; }
.mg-rm { background: none; border: none; color: var(--txt3); cursor: pointer; font-size: 1.05rem; flex-shrink: 0; padding: 4px; }
.mg-rm:hover { color: var(--lime); }

.mg-addmore { width: 100%; margin-top: 10px; padding: 11px; cursor: pointer;
  background: transparent; border: 1px dashed var(--line2); border-radius: var(--r); color: var(--txt2);
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600; font-size: .85rem; transition: all .18s; }
.mg-addmore:hover { border-color: var(--lime); color: var(--lime); }
.mg-hint { text-align: center; font-family: 'JetBrains Mono', monospace; font-size: .68rem; color: var(--txt3); margin-top: 12px; }

/* loader */
.mg-scan-box { text-align: center; padding: 48px 24px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.mg-stacker { width: 70px; height: 84px; margin: 0 auto 24px; position: relative; }
.mg-stacker span { position: absolute; left: 0; right: 0; height: 22px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--line2); }
.mg-stacker span:nth-child(1){ top: 0; animation: mgstack 1.4s ease-in-out infinite; }
.mg-stacker span:nth-child(2){ top: 31px; animation: mgstack 1.4s ease-in-out infinite .2s; }
.mg-stacker span:nth-child(3){ top: 62px; animation: mgstack 1.4s ease-in-out infinite .4s; background: var(--lime); border-color: var(--lime); }
@keyframes mgstack { 0%,100%{ transform: translateX(0); } 50%{ transform: translateX(6px); } }
.mg-scan-box h3 { font-size: 1.3rem; }
.mg-scan-box p { color: var(--txt3); margin-top: 10px; font-size: .8rem; }

/* result */
.mg-result-card { text-align: center; padding: 40px 28px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.mg-check { width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lime); color: #0a0b0d; box-shadow: 0 0 36px -6px rgba(194,240,74,0.7); }
.mg-result-card h3 { font-size: 1.5rem; }
.mg-result-card > p { color: var(--txt2); margin-top: 8px; font-weight: 400; }
.mg-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; margin-top: 22px; }
.mg-stat { padding: 15px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.mg-stat.hi { border-color: rgba(194,240,74,0.4); background: rgba(194,240,74,0.06); }
.mg-stat .l { font-family: 'JetBrains Mono', monospace; font-size: .6rem; letter-spacing: .07em; text-transform: uppercase; color: var(--txt3); margin-bottom: 5px; }
.mg-stat .v { font-weight: 800; font-size: 1.15rem; }
.mg-stat .v.g { color: var(--lime); }
