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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-back {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
}
.portal-back:hover { color: #2563eb; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon { font-size: 2rem; }

.brand-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.tagline {
  font-size: 0.75rem;
  color: #64748b;
}

.main-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

/* Controls */
.controls-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  align-items: center;
}

.control-item label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}

.control-item select,
.control-item input[type="range"] {
  width: 100%;
}

.control-item select {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.9rem;
  outline: none;
}

/* Dropzone */
.dropzone-card {
  background: #ffffff;
  border: 2px dashed #93c5fd;
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  background-color: #f0f7ff;
}

.dropzone-card:hover,
.dropzone-card.dragover {
  border-color: #2563eb;
  background-color: #e0f2fe;
  transform: translateY(-2px);
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.dropzone-content h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.dropzone-content p {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.formats-pill {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.free-limit-badge {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #64748b;
}

.free-limit-badge a {
  color: #d97706;
  font-weight: 700;
  text-decoration: none;
}

/* Results */
.results-section {
  margin-top: 32px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-summary {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.batch-actions {
  display: flex;
  gap: 10px;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover {
  background: #1d4ed8;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.images-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-card-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.img-thumb-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 250px;
}

.thumb-preview {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.img-meta-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  word-break: break-all;
}

.img-sizes {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.8rem;
}

.orig-size {
  color: #64748b;
  text-decoration: line-through;
}

.new-size {
  font-weight: 800;
  color: #059669;
}

.savings-pill {
  background: #d1fae5;
  color: #047857;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.btn-download-single {
  background: #0f172a;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
}

.app-footer {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 48px;
  border-top: 1px solid #e2e8f0;
}
