.upload-bar {
  max-width: 1100px;
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.upload-open {
  appearance: none;
  background: #c8a84b;
  color: #0a1628;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.upload-open:hover { filter: brightness(1.05); }
.upload-hint { color: #9aa8bc; font-size: 0.85rem; }
.upload-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.upload-modal[hidden] { display: none !important; }
.upload-card {
  background: #12203a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 1.35rem 1.25rem 1.25rem;
  width: min(100%, 420px);
  position: relative;
  color: #f5f7fa;
}
.upload-card h2 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.upload-sub { color: #9aa8bc; font-size: 0.88rem; margin-bottom: 1rem; }
.upload-x {
  position: absolute; top: 0.6rem; right: 0.7rem;
  background: transparent; border: none; color: #f5f7fa;
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.upload-label {
  display: block; font-size: 0.82rem; color: #9aa8bc; margin-bottom: 0.85rem;
}
.upload-label input[type="text"],
.upload-label input[type="file"] {
  display: block; width: 100%; margin-top: 0.35rem;
  background: #0a1628; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; color: #f5f7fa; padding: 0.55rem 0.65rem;
}
.upload-submit {
  appearance: none; width: 100%; margin-top: 0.25rem;
  background: #c8a84b; color: #0a1628; border: none; border-radius: 8px;
  padding: 0.7rem 1rem; font-weight: 700; cursor: pointer;
}
.upload-submit:disabled { opacity: 0.6; cursor: wait; }
.upload-status { margin-top: 0.75rem; font-size: 0.88rem; color: #c8a84b; min-height: 1.2em; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.community-thumb { position: relative; }
.upload-badge {
  position: absolute; left: 0.4rem; bottom: 0.4rem;
  background: rgba(200,168,75,0.92); color: #0a1628;
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.15rem 0.4rem; border-radius: 4px;
}
body.upload-open-body { overflow: hidden; }

/* select + download */
.dl-bar {
  max-width: 1100px;
  margin: 0.85rem auto 0;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.dl-btn {
  appearance: none;
  background: #1a2f4d;
  color: #f5f7fa;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
}
.dl-btn:hover { border-color: rgba(200,168,75,0.55); }
.dl-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dl-primary { background: #c8a84b; color: #0a1628; border-color: transparent; }
.dl-primary:disabled { background: #1a2f4d; color: #f5f7fa; border-color: rgba(255,255,255,0.14); }
.dl-ghost { background: transparent; }
.dl-count { color: #9aa8bc; font-size: 0.85rem; }
#gallery.select-mode > button { cursor: pointer; }
#gallery.select-mode > button.selected {
  border-color: #c8a84b;
  box-shadow: 0 0 0 2px rgba(200,168,75,0.35);
}
.thumb-check {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(10,22,40,0.35);
  z-index: 2;
}
#gallery > button.selected .thumb-check {
  background: #c8a84b;
  border-color: #c8a84b;
}
#gallery > button.selected .thumb-check::after {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.05rem;
  width: 0.28rem;
  height: 0.55rem;
  border: solid #0a1628;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
