* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1f2430;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 40px 16px;
}
main { width: 100%; max-width: 640px; }

.ad-slot {
  width: 160px;
  min-height: 600px;
  flex-shrink: 0;
  border: 2px dashed #9aa1ad;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #9aa1ad;
  font-size: 0.8rem;
  line-height: 1.5;
  position: sticky;
  top: 40px;
}
@media (max-width: 1040px) { .ad-slot { display: none; } }

nav.crumbs { font-size: 0.85rem; margin-bottom: 10px; }
nav.crumbs a { color: #6b7280; text-decoration: none; }
nav.crumbs a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; margin-bottom: 4px; }
p.sub { color: #6b7280; margin-bottom: 20px; font-size: 0.95rem; }

.intro { font-size: 0.92rem; color: #374151; line-height: 1.65; margin-bottom: 24px; }
.intro p + p { margin-top: 10px; }

#drop {
  border: 2px dashed #c3c9d4;
  border-radius: 12px;
  background: #fff;
  padding: 40px 20px;
  text-align: center;
  color: #6b7280;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
#drop.over { border-color: #4f7cff; background: #eef3ff; }
#drop strong { color: #4f7cff; }

ul#list { list-style: none; margin-top: 16px; }
ul#list li {
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}
.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tag.img { background: #e6f4ea; color: #1e7e34; }
.tag.pdf { background: #fdecea; color: #c0392b; }
.name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li button, ul#list button {
  background: none;
  border: none;
  cursor: pointer;
  color: #9aa1ad;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
}
li button:hover, ul#list button:hover { background: #f0f1f4; color: #1f2430; }

#filename-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}
#filename-row label { color: #6b7280; }
#filename-row input {
  flex: 1;
  border: 1px solid #e3e6ec;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}
#filename-row input:focus { outline: 2px solid #4f7cff; border-color: transparent; }
#filename-row .ext { color: #6b7280; }

.dup-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
}
.dup-row input { accent-color: #4f7cff; }

.quality-row { margin-top: 16px; font-size: 0.92rem; }
.quality-row label { color: #6b7280; display: block; margin-bottom: 6px; }
.quality-row select {
  width: 100%;
  border: 1px solid #e3e6ec;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  flex: 1;
  min-width: 140px;
  background: #4f7cff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: #3d68e8; }
.btn-primary:disabled { background: #c3c9d4; cursor: not-allowed; }
.btn-secondary {
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  color: #6b7280;
}
.btn-secondary:hover { background: #f0f1f4; }
.status { margin-top: 12px; font-size: 0.9rem; color: #6b7280; text-align: center; min-height: 1.2em; }
.status.error { color: #c0392b; }

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e7e34;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast .check {
  background: #fff;
  color: #1e7e34;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.faq { margin-top: 48px; border-top: 1px solid #e3e6ec; padding-top: 24px; }
.faq h2 { font-size: 1.15rem; margin-bottom: 8px; }
.faq h3 { font-size: 0.98rem; margin: 18px 0 4px; }
.faq p { font-size: 0.92rem; color: #4b5563; line-height: 1.55; }

.tools-nav { margin-top: 48px; border-top: 1px solid #e3e6ec; padding-top: 20px; }
.tools-nav h2 { font-size: 1rem; margin-bottom: 10px; color: #374151; }
.tools-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.tools-nav a {
  font-size: 0.85rem;
  color: #4f7cff;
  text-decoration: none;
  background: #eef3ff;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-block;
}
.tools-nav a:hover { background: #dde8ff; }

footer { margin-top: 32px; padding: 16px 0; text-align: center; font-size: 0.85rem; }
footer a { color: #6b7280; margin: 0 6px; }
