:root {
  --bg: #0e0f13;
  --card: #171922;
  --card2: #1f2230;
  --line: #2a2e3d;
  --txt: #e8eaf0;
  --muted: #8a8fa3;
  --accent: #6c8cff;
  --accent2: #4f6ef0;
  --good: #43d18a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #1a1d2b 0%, var(--bg) 60%);
  color: var(--txt);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: grid;
  place-items: start center;
  padding: 6vh 20px 40px;
}
main { width: 100%; max-width: 460px; }
.langbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
#lang {
  appearance: none; background: var(--card); color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: 13px; cursor: pointer;
}
#lang:hover { color: var(--txt); border-color: var(--accent); }
header { text-align: center; margin-bottom: 26px; }
h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff, #9fb0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tag { color: var(--muted); margin: 8px 0 0; font-size: 13.5px; }

.drop {
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  background: var(--card);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.drop:hover { border-color: var(--accent); background: var(--card2); }
.drop.drag { border-color: var(--accent); background: var(--card2); transform: scale(1.01); }
.drop-inner {
  padding: 46px 20px;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
}
.drop-inner svg { color: var(--accent); }
.drop-inner p { margin: 4px 0 0; color: var(--txt); }
.hint { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 16px;
}
.filelist { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.frow {
  display: flex; align-items: center; gap: 10px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px; position: relative;
}
.frow.rowerr { border-color: #7a2a2a; }
.thumb {
  flex: none; width: 38px; height: 38px; border-radius: 8px; overflow: hidden;
  background: #0e1018; display: grid; place-items: center; font-size: 18px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.clickable { cursor: zoom-in; outline: 1.5px solid var(--accent); outline-offset: 1px; }
.fmeta { min-width: 0; flex: 1; }
.fname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.fsize { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fbar { width: 56px; height: 5px; background: #0e1018; border-radius: 99px; overflow: hidden; flex: none; }
.fbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--good)); transition: width .2s; }
.frow-dl {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--good); color: #07271a; border-radius: 8px; text-decoration: none; font-weight: 800;
}
.frow-x {
  flex: none; width: 26px; height: 26px; padding: 0; border-radius: 7px;
  background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 12px; line-height: 1;
}
.frow-x:hover { color: #ff9b9b; border-color: #7a2a2a; }
.controls { display: grid; gap: 14px; }
.check-field { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; line-height: 1.45; }
.check-field input { margin-top: 1px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.check-field b { color: var(--txt); }
.targetrow { display: flex; gap: 8px; }
.targetrow input[type="number"] {
  flex: 1; background: var(--card2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 15px;
}
.targetrow select { flex: 1; }
.btnrow { display: flex; gap: 10px; }
.btnrow .go { flex: 1; }

.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.field em { color: var(--accent); font-style: normal; }
select, input[type="range"] { width: 100%; }
select {
  appearance: none;
  background: var(--card2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
}
input[type="range"] { accent-color: var(--accent); }

button, .download {
  font: inherit;
  cursor: pointer;
  border-radius: 11px;
  border: 0;
  padding: 13px 16px;
}
.go {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 600;
}
.go:disabled { opacity: .5; cursor: progress; }
.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 13px;
}
.ghost:hover { color: var(--txt); border-color: var(--accent); }

.status { display: grid; gap: 8px; }
.bar { height: 7px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--good)); transition: width .2s; }
#statusText { font-size: 12.5px; color: var(--muted); }

.download {
  background: var(--good);
  color: #07271a;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: block;
}

footer { text-align: center; margin-top: 18px; color: var(--muted); font-size: 12px; }

/* before/after compare */
.cmp-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 7, 11, 0.82); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
}
.cmp-box { width: 100%; max-width: 560px; position: relative; }
.cmp-wrap { position: relative; border-radius: 14px; overflow: hidden; user-select: none; line-height: 0; background: #000; }
.cmp-img { width: 100%; display: block; pointer-events: none; }
.cmp-after { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.cmp-after .cmp-img { width: 100vw; max-width: 560px; height: 100%; object-fit: cover; }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4); transform: translateX(-1px); pointer-events: none;
}
.cmp-handle::after {
  content: '⟷'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; background: #fff; color: #111; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
}
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp-tag {
  position: absolute; top: 10px; font-size: 11px; padding: 3px 8px; border-radius: 99px;
  background: rgba(0,0,0,.6); color: #fff; pointer-events: none;
}
.cmp-tl { left: 10px; } .cmp-tr { right: 10px; }
.cmp-caption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; word-break: break-all; }
.cmp-close {
  position: absolute; top: -14px; right: -8px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--card2); color: var(--txt); border: 1px solid var(--line); font-size: 13px;
}

/* big-file row + command modal */
.frow.big { border-color: #6a5a1f; background: #211d12; }
.cmd-btn { flex: none; font-size: 12px; padding: 7px 10px; white-space: nowrap; }
.big-box {
  width: 100%; max-width: 600px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; position: relative; max-height: 86vh; overflow-y: auto;
}
.big-box h3 { margin: 0 8px 6px 0; font-size: 18px; }
.big-intro { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.big-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.wa-note {
  background: #11261c; border: 1px solid #1f6f4a; color: #b9f0d2;
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin: 0 0 14px;
}
.wa-note b { color: #eafff3; }
.sp-list { display: grid; gap: 4px; margin-top: 12px; max-height: 180px; overflow-y: auto; }
.sp-item { font-size: 12.5px; color: var(--good); font-family: ui-monospace, Menlo, Consolas, monospace; }
.mob-warn {
  background: #2a1414; border: 1px solid #7a2a2a; color: #ffd2d2;
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; margin: 0 0 14px;
}
.mob-warn b { color: #fff; }
.big-tabs { display: flex; gap: 6px; margin: 14px 0 8px; }
.big-tab {
  background: var(--card2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 13px;
}
.big-tab.active { color: var(--txt); border-color: var(--accent); background: #1c2233; }
.big-cmd {
  background: #0a0c12; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; overflow-x: auto; margin: 0 0 12px;
}
.big-cmd code { font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #cfe0ff; white-space: pre; }

.errbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #5a1d1d; color: #ffd9d9;
  padding: 10px 16px; font-size: 13px; text-align: center;
  border-top: 1px solid #7a2a2a;
}
