.capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 1.25rem;
  align-items: start;
}

.capture-banner,
.helper-panel,
.upload-card,
.camera-card,
.side-card,
.detail-card {
  padding: 1.25rem;
  border-radius: 24px;
}

.capture-banner {
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(31,143,95,.12), rgba(79,172,254,.12));
  border: 1px solid rgba(31,143,95,.18);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.25rem;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .75rem;
  border-radius: 999px;
  background: rgba(31,143,95,.12);
  color: #146c48;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: .85rem;
}

.field-shell {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  margin-bottom: .45rem;
  font-weight: 700;
  color: #1f2937;
}

.field-label span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.field-shell input,
.field-shell select,
.field-shell textarea,
.form-pretty input,
.form-pretty select,
.form-pretty textarea {
  width: 100%;
  padding: .92rem 1rem;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  font: inherit;
  box-sizing: border-box;
}

.field-shell input:focus,
.field-shell select:focus,
.field-shell textarea:focus,
.form-pretty input:focus,
.form-pretty select:focus,
.form-pretty textarea:focus {
  outline: none;
  border-color: rgba(31,143,95,.45);
  box-shadow: 0 0 0 4px rgba(31,143,95,.08);
}

.form-help {
  margin-top: .4rem;
  font-size: .92rem;
  color: #64748b;
}

.camera-stage {
  position: relative;
  width: 100%;
  min-height: 300px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1px solid rgba(255,255,255,.08);
  margin: .9rem 0 1rem;
}

.camera-stage video,
.camera-stage canvas,
.camera-stage img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

.capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.capture-actions-spaced {
  margin-top: .9rem;
}

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

.preview-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.08);
  background: #fff;
}

.preview-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.preview-meta {
  padding: .55rem .65rem;
  font-size: .84rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-list {
  display: grid;
  gap: .75rem;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(15,23,42,.08);
}

.accent-slab {
  background: linear-gradient(135deg, rgba(31,143,95,.12), rgba(79,172,254,.16));
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.image-card-clickable {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2,6,23,.84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.image-lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 78vh;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}

.image-lightbox p {
  color: #fff;
  margin-top: 1rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
}

.result-panel {
  display: grid;
  gap: 1rem;
}

.ai-species-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.confidence-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15,23,42,.08);
}

.confidence-bar .fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #1f8f5f, #4facfe);
}

.hidden {
  display: none !important;
}

.btn-sm {
  padding: .55rem .85rem;
  font-size: .88rem;
}

@media (max-width: 980px) {
  .capture-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}
