.reports-page {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.reports-page .toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.reports-page .toolbar label {
  flex: 1 1 170px;
  min-width: 160px;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.reports-page .toolbar label:first-child {
  flex-basis: 320px;
  min-width: min(100%, 320px);
}

#reportType {
  min-width: 320px;
}

.reports-page .toolbar button {
  min-height: 42px;
}

.report-state-message {
  flex: 1 1 260px;
  color: var(--warning-text, #92400e);
  font-size: 12px;
  font-weight: 700;
}

.report-grid-preview {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #dbe3ee);
}

.combined-report-grid {
  display: grid;
  gap: 16px;
}

.combined-report-grid section {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.combined-report-grid h4 {
  margin: 0;
  color: var(--text-color);
  font-size: 15px;
  font-weight: 800;
}

.printable-preview-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.printable-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.printable-preview-header .toolbar-title p {
  margin-bottom: 0;
}

.printable-preview-scroll-hint {
  display: none;
  align-items: center;
  gap: 7px;
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-weight: 800;
}

.report-preview-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-gutter: stable;
}

.printable-preview-shell.is-collapsed .report-preview-scroll,
.printable-preview-shell.is-collapsed .printable-preview-scroll-hint {
  display: none;
}

@media (max-width: 720px) {
  #reportType {
    min-width: 0;
  }

  .printable-preview-header {
    align-items: stretch;
    flex-direction: column;
  }

  .printable-preview-scroll-hint {
    display: inline-flex;
  }

  .report-preview-scroll {
    border: 1px solid var(--border-color, #dbe3ee);
    border-radius: 8px;
    background: #e5e7eb;
  }
}

@media print {
  .report-preview-scroll {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    background: #ffffff !important;
  }

  .printable-preview-scroll-hint {
    display: none !important;
  }
}
.report-ai-explanation {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--border-color, #d8e2ef);
  border-radius: 8px;
  background: var(--surface-muted, #f8fafc);
}

.report-ai-card-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.report-ai-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #d8e2ef);
  border-radius: 8px;
  background: #fff;
}

.report-ai-card span,
.report-ai-columns p {
  color: var(--muted-text, #64748b);
}

.report-ai-card strong {
  color: var(--text-color, #0f172a);
}

.report-ai-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-ai-columns h4 {
  font-size: 14px;
  margin: 0 0 8px;
}

.report-ai-columns p {
  margin: 0 0 6px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .report-ai-card-row,
  .report-ai-columns {
    grid-template-columns: 1fr;
  }
}
