.report-shell,
.db-shell {
  max-width: 1100px;
  margin: 0 auto;
}

.report-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-hero {
  position: relative;
  min-height: 280px;
  background: #e9edf0;
  display: flex;
  align-items: end;
}

.report-hero img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.hero-placeholder {
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
}

.report-hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 22px;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.15), rgba(0,0,0,0));
  color: white;
}

.report-hero-title {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.1;
}

.report-hero-sub {
  font-size: 14px;
  opacity: 0.95;
}

.report-content {
  padding: 22px;
}

.top-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: start;
}

.score-panel,
.meta-panel,
.audio-card,
.plot-card,
.photo-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.score-panel,
.meta-panel {
  background: #fafafa;
  border: 1px solid #eceff3;
  padding: 16px;
}

.score-number {
  font-size: 42px;
  font-weight: bold;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.score-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.score-emoji {
  font-size: 22px;
  line-height: 1.3;
  word-break: break-word;
}

.score-status {
  margin-top: 12px;
  font-size: 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.meta-item {
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.photo-card {
  overflow: hidden;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f0f0f0;
  cursor: zoom-in;
}

.photo-card .caption {
  padding: 8px 10px;
  font-size: 13px;
}

.audio-list {
  display: grid;
  gap: 16px;
}

.audio-card {
  padding: 12px;
}

.audio-title {
  font-weight: bold;
  margin-bottom: 6px;
}

.audio-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.analysis-box {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #dfe5eb;
  border-radius: 10px;
  background: #fafbfc;
}

.analysis-box img {
  width: 100%;
  max-width: 720px;
  display: block;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  margin-top: 10px;
  cursor: zoom-in;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.plot-card {
  padding: 10px;
}

.plot-card-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 8px;
}

.plot-card img {
  width: 100%;
  display: block;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
}

.metrics-table,
.cut-table {
  width: 100%;
  border-collapse: collapse;
}

.metrics-table th,
.metrics-table td,
.cut-table th,
.cut-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}

.metrics-table th,
.cut-table th {
  background: #fafafa;
  width: 220px;
}

#notes {
  max-width: 780px;
  line-height: 1.55;
}

#notes p {
  margin: 0 0 10px;
}

.print-only {
  display: none;
}

.screen-only {
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-width: 95vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #fff;
}

.lightbox-caption {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  max-width: 90vw;
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.db-header {
  margin-bottom: 22px;
  background: linear-gradient(180deg, rgba(47,111,79,0.88), rgba(47,111,79,0.72)),
    radial-gradient(circle at top right, rgba(255,255,255,0.22), transparent 35%);
  color: #fff;
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}

.db-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
}

.db-subhead {
  color: rgba(255,255,255,0.92);
  font-size: 15px;
  max-width: 760px;
}

.toolbar {
  margin: 18px 0 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input,
.toolbar select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.add-btn {
  display: inline-block;
  padding: 10px 14px;
  background: #2f6f4f;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.db-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.thumb-wrap {
  height: 200px;
  background: #eef1f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  color: var(--muted);
  font-size: 14px;
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7f1;
  border: 1px solid #cfe6d8;
  font-size: 12px;
}

.score {
  font-weight: bold;
  color: var(--accent);
}

.score div:last-child {
  font-size: 18px;
  margin-top: 4px;
}

.empty,
.loading {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .report-content {
    padding: 16px;
  }

  .top-row {
    grid-template-columns: 1fr;
  }

  .meta-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .report-hero,
  .report-hero img,
  .hero-placeholder {
    min-height: 220px;
    height: 220px;
  }

  .report-hero-title {
    font-size: 26px;
  }
}

@media print {
  .toolbar {
    display: none !important;
  }

  .db-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .db-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .screen-only {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  audio,
  video,
  .lightbox {
    display: none !important;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .photo-card img {
    height: auto;
    max-height: 260px;
    object-fit: contain;
    background: #fff;
    cursor: default;
  }

  .analysis-box img {
    cursor: default;
  }
}
