/* ShutterWing-style upload · jxphotos */
body.page-upload {
  background: #070d1a;
}

.upload-shell {
  min-height: 100vh;
  background: #070d1a;
}

.sw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(7, 13, 26, 0.98);
  border-bottom: 1px solid rgba(100, 140, 220, 0.18);
  position: sticky;
  top: 0;
  z-index: 800;
}

.sw-topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #60a5fa;
  text-decoration: none;
}

.sw-topbar-logo img { width: 32px; height: 32px; border-radius: 50%; }

.upload-main {
  padding: 12px 16px 24px;
}

.sw-upload {
  --sw-bg: #070d1a;
  --sw-card: #0f1a2e;
  --sw-border: rgba(100, 140, 220, 0.18);
  --sw-accent: #3b82f6;
  --sw-accent2: #6366f1;
  --sw-text: #e8edf5;
  --sw-muted: #8b9cb3;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 100px;
}

.sw-upload .sw-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 50%;
  border: 1px solid var(--sw-border);
  background: var(--sw-card);
  color: var(--sw-text);
  cursor: pointer;
  text-decoration: none;
}

.sw-card {
  background: var(--sw-card);
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.sw-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sw-accent);
}

.sw-card h3.sw-title-white { color: var(--sw-text); }

.sw-hint {
  margin: -6px 0 12px;
  font-size: 12px;
  color: var(--sw-muted);
  line-height: 1.5;
}

.sw-dropzone {
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  border: 2px dashed var(--sw-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s;
}

.sw-dropzone:hover, .sw-dropzone.drag { border-color: var(--sw-accent); }
.sw-dropzone.has-img { padding: 0; min-height: auto; border-style: solid; cursor: default; }
.sw-dropzone img { width: 100%; border-radius: 10px; display: block; max-height: 360px; object-fit: contain; background: #000; }
.sw-dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sw-dropzone.has-img input { pointer-events: none; }
.sw-dropzone .sw-cloud { font-size: 32px; opacity: 0.7; }
.sw-dropzone p { margin: 0; font-size: 14px; color: var(--sw-text); }
.sw-dropzone small { font-size: 11px; color: var(--sw-muted); }

.sw-extra-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.sw-extra-slot {
  min-height: 90px;
  border: 1px dashed var(--sw-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--sw-muted);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.sw-extra-slot img { width: 100%; height: 100%; object-fit: cover; }
.sw-extra-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.sw-type-group { margin-bottom: 12px; }
.sw-type-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sw-muted);
}

.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.sw-chip {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--sw-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.sw-chip.on {
  color: #fff;
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--sw-accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.sw-field { margin-bottom: 14px; }
.sw-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.sw-field label .req { color: #f87171; }
.sw-field input, .sw-field textarea {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--sw-text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--sw-border);
  border-radius: 10px;
}

.sw-field input:focus, .sw-field textarea:focus {
  outline: none;
  border-color: var(--sw-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sw-reg-row { display: flex; gap: 8px; }
.sw-reg-row input { flex: 1; }
.sw-reg-row .btn { flex-shrink: 0; white-space: nowrap; }

.sw-no-reg-btn {
  width: 100%;
  padding: 10px;
  margin: -4px 0 14px;
  font-size: 12px;
  color: var(--sw-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  cursor: pointer;
}

.sw-fabs {
  position: fixed;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 850;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.sw-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sw-fab.purple {
  width: auto;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
}

.sw-fab.blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.sw-fab.orange { background: linear-gradient(135deg, #f59e0b, #ea580c); font-size: 18px; }

@media (min-width: 769px) {
  .sw-fabs { bottom: 24px; }
  .sw-bottom-nav { display: none !important; }
}

.sw-exif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sw-exif-item {
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 11px;
}

.sw-exif-item span { display: block; color: var(--sw-muted); margin-bottom: 2px; }
.sw-exif-item strong { font-size: 12px; color: var(--sw-text); font-weight: 600; }

.sw-tool-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  margin-bottom: 10px;
}

.sw-tool-preview img { width: 100%; display: block; }

.sw-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.2%, rgba(255,255,255,0.45) 33.3%, transparent 33.4%, transparent 66.2%, rgba(255,255,255,0.45) 66.3%, transparent 66.4%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,0.45) 33.3%, transparent 33.4%, transparent 66.2%, rgba(255,255,255,0.45) 66.3%, transparent 66.4%);
}

.sw-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--sw-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
}

.sw-histogram {
  height: 80px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.sw-histogram canvas { width: 100%; height: 100%; display: block; }

.sw-wm-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  margin-bottom: 12px;
}

.sw-wm-preview img { width: 100%; display: block; }

.sw-wm-text {
  position: absolute;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.sw-wm-text.dark { color: #111; text-shadow: none; }
.sw-wm-text.pos-tl { top: 8px; left: 8px; }
.sw-wm-text.pos-tr { top: 8px; right: 8px; }
.sw-wm-text.pos-bl { bottom: 8px; left: 8px; }
.sw-wm-text.pos-br { bottom: 8px; right: 8px; }

.sw-wm-styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.sw-wm-style {
  padding: 12px;
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
}

.sw-wm-style.on { border-color: var(--sw-accent); background: rgba(59, 130, 246, 0.12); }
.sw-wm-style small { display: block; margin-top: 4px; font-size: 10px; color: var(--sw-muted); }

.sw-range { margin-bottom: 14px; }
.sw-range label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--sw-muted); }
.sw-range input[type=range] { width: 100%; accent-color: var(--sw-accent); }

.sw-pos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.sw-pos-btn {
  padding: 10px;
  font-size: 12px;
  text-align: center;
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.sw-pos-btn.on { border-color: var(--sw-accent); color: var(--sw-accent); }

.sw-social {
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.06);
}

.sw-hot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.sw-hot input { margin-top: 4px; accent-color: #f59e0b; }

.sw-submit {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
}

.sw-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.sw-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: auto;
}

.sw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sw-modal-head h2 { margin: 0; font-size: 16px; color: var(--sw-accent); }

.sw-modal-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.sw-modal-tab {
  padding: 7px 12px;
  font-size: 11px;
  border: 1px solid var(--sw-border);
  border-radius: 6px;
  background: var(--sw-card);
  color: var(--sw-text);
  cursor: pointer;
}

.sw-modal-tab.on { background: var(--sw-accent); border-color: var(--sw-accent); color: #fff; }

.sw-modal-close {
  padding: 10px 16px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 12px;
  width: fit-content;
}

.sw-modal-img { max-width: 100%; margin: 0 auto 12px; border-radius: 8px; }

.sw-horizon-wrap { position: relative; touch-action: none; }
.sw-horizon-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #facc15;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.8);
}
.sw-horizon-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  cursor: ns-resize;
}

.sw-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(7, 13, 26, 0.98);
  border-top: 1px solid var(--sw-border);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}

@media (max-width: 768px) {
  .sw-bottom-nav { display: flex; }
  .site-footer { padding-bottom: 72px; }
}

.sw-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--sw-muted);
  text-decoration: none;
  padding: 4px 8px;
}

.sw-bottom-nav a.active { color: #fbbf24; }
