/* Mobile-first, single-page camp photo uploader. No framework, no build step. */

:root {
  --navy: #1c3f94;
  --navy-dark: #16337a;
  --ink: #1b1b1d;
  --muted: #6a6a75;
  --line: #e2e2e8;
  --bg: #f7f7fa;
  --danger: #b3261e;
  --ok: #1b6e3c;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Top bar ---- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1rem 0.75rem;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.bar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #ffd23f;
  flex: none;
}

.bar .link-btn {
  color: #fff;
}

/* ---- Layout ---- */
.pad {
  padding: 1rem;
}

.center {
  text-align: center;
  max-width: 26rem;
  margin: 0 auto;
  padding-top: 2.5rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

/* ---- Scope banner ---- */
.scope {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.scope-mark {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.scope-label {
  font-weight: 600;
  flex: 1;
}

.scope-picker select {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: 12rem;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.tab {
  flex: 1;
  padding: 0.9rem 0.5rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  min-height: 48px;
}

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* ---- Buttons ---- */
button {
  font: inherit;
  cursor: pointer;
}

.primary,
.secondary,
.danger {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.8rem 1.2rem;
  font-weight: 600;
  min-height: 48px;
}

.primary {
  background: var(--navy);
  color: #fff;
}

.primary:active {
  background: var(--navy-dark);
}

.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.danger {
  background: var(--danger);
  color: #fff;
}

.big {
  width: 100%;
  font-size: 1.05rem;
}

.wide {
  width: 100%;
  margin-top: 1rem;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.link-btn {
  background: none;
  border: 0;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  padding: 0.5rem;
  min-height: 44px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ---- Dropzone ---- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 2rem 1rem;
  background: #fff;
  border: 2px dashed #b9c3dd;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
}

.dropzone-icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--navy);
}

.dropzone-title {
  font-weight: 600;
}

.dropzone-hint {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---- Upload queue ---- */
.queue {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  flex: none;
}

.queue-meta {
  flex: 1;
  min-width: 0;
}

.queue-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.queue-state {
  font-size: 0.8rem;
  color: var(--muted);
}

.queue-item[data-state='done'] .queue-state {
  color: var(--ok);
  font-weight: 600;
}

.queue-item[data-state='error'] .queue-state {
  color: var(--danger);
  font-weight: 600;
}

.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--navy);
  transition: width 0.15s linear;
}

/* ---- Review grid ---- */
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}

.cell {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #dfe1ea;
}

.cell img,
.cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cell-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.status {
  margin-top: 1rem;
  min-height: 1.5rem;
  font-size: 0.9rem;
}

.status.error {
  color: var(--danger);
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  z-index: 50;
  padding: calc(0.75rem + env(safe-area-inset-top)) 0.75rem
    calc(0.75rem + env(safe-area-inset-bottom));
  gap: 0.75rem;
}

.lightbox-close {
  align-self: flex-end;
  background: none;
  border: 0;
  color: #fff;
  font-weight: 600;
  padding: 0.6rem;
  min-height: 44px;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox-body img,
.lightbox-body video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
