/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  line-height: 1.5;
  min-height: 100dvh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Typography ── */
.page-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}

/* ── Form elements ── */
.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #444;
}

.field-optional {
  font-weight: 400;
  color: #888;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.text-input {
  border: 1.5px solid #d8d8d8;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 0.15s;
}
.text-input:focus {
  outline: none;
  border-color: #7c6af7;
  box-shadow: 0 0 0 3px rgb(124 106 247 / 15%);
}

.textarea { resize: vertical; min-height: 4rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: #7c6af7; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #6a57e3; }

.btn-secondary { background: #ebebeb; color: #333; }
.btn-secondary:hover:not(:disabled) { background: #ddd; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-ghost { background: transparent; color: #666; padding-left: 0.75rem; padding-right: 0.75rem; }
.btn-ghost:hover:not(:disabled) { color: #333; background: #ebebeb; }

.btn-small { font-size: 0.8125rem; padding: 0.35rem 0.75rem; }

/* ── Footer ── */
.site-footer {
  margin-top: 3rem;
  padding-bottom: 1.5rem;
  text-align: center;
}
.footer-text {
  font-size: 0.8rem;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.claude-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.claude-name {
  color: #c96442;
}

/* ── Hero photo (mobile only) ── */
.hero-wrap {
  display: none;
}
@media (max-width: 600px) {
  .hero-wrap {
    display: block;
    height: 280px;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 1.5rem;
  }
  .hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
  }
}

/* ── Staging grid ── */
.staging-area {
  margin-top: 1rem;
}
.staging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.staging-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #ebebeb;
}
.staging-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.staging-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0 0 0 / 60%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.staging-remove:hover { background: rgba(0 0 0 / 85%); }
.staging-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed #c8c8c8;
  border-radius: 10px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #7c6af7;
  background: rgb(124 106 247 / 5%);
}
.drop-zone-text { font-size: 0.95rem; color: #555; }
.drop-zone-link { color: #7c6af7; font-weight: 600; }
.drop-zone-hint { font-size: 0.8125rem; color: #999; margin-top: 0.25rem; }

/* ── Progress list ── */
.progress-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-row {
  background: #fff;
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 6%);
  font-size: 0.875rem;
}

.row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
}

.row-bar-wrap {
  width: 80px;
  height: 6px;
  background: #ebebeb;
  border-radius: 99px;
  overflow: hidden;
}

.row-bar {
  height: 100%;
  background: #7c6af7;
  border-radius: 99px;
  transition: width 0.1s;
}
.bar-success { background: #22c55e; }
.bar-error   { background: #ef4444; }

.row-status { font-size: 0.8125rem; color: #888; min-width: 2.5rem; text-align: right; }
.row-done .row-status { color: #22c55e; }
.row-error .row-status { color: #ef4444; }

.row-error-msg {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: #ef4444;
}

/* ── Banners ── */
.success-banner {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  color: #15803d;
  font-size: 0.9375rem;
  font-weight: 500;
}

.error-text {
  color: #ef4444;
  font-size: 0.875rem;
}

/* ── Gallery toolbar ── */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.download-progress {
  font-size: 0.875rem;
  color: #555;
}

.state-message {
  text-align: center;
  color: #888;
  padding: 3rem 0;
  font-size: 1rem;
}

/* ── Photo grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}

.photo-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgb(0 0 0 / 12%); }

.card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #ebebeb;
}

.card-meta {
  padding: 0.5rem 0.625rem 0;
  flex: 1;
  min-height: 0;
}

.card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-caption {
  font-size: 0.75rem;
  color: #777;
  margin-top: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  padding: 0.5rem 0.625rem 0.625rem;
  display: flex;
  justify-content: flex-end;
}

.heic-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #f0f0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #888;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 88%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  gap: 0.75rem;
}
.lightbox:not([hidden]) {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-img {
  max-width: 100%;
  max-height: 80dvh;
  border-radius: 6px;
  object-fit: contain;
}

.lightbox-caption {
  color: rgb(255 255 255 / 75%);
  font-size: 0.9rem;
  text-align: center;
  max-width: 600px;
}
