/* Nicer rendering for the auto-generated charts and tables on the reports */

.chart-wrap {
  margin: 1.5em 0;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 1em;
  background: #fff;
  /* Horizontal scroll for wide charts on narrow viewports; vertical never
     scrolls. Vertical overflow:hidden would clip Plotly's hover labels. */
  overflow-x: auto;
  /* min-height keeps the container measurable during reflows so Plotly's
     ResizeObserver never sees a 0-height parent (the cause of the iOS/Android
     "load then collapse" bug). */
  min-height: 420px;
  /* Force a new stacking context so iOS Safari composites Plotly's SVG
     reliably across URL-bar show/hide reflows. */
  position: relative;
  isolation: isolate;
}
.chart-wrap > h4 {
  margin: 0 0 0.5em 0;
  font-size: 0.95em;
  color: #586069;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-wide { min-width: 100%; }
.chart-tall { min-height: 600px; }

/* Sortable tables */
table.smart {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}
table.smart thead th {
  background: #f6f8fa;
  border-bottom: 2px solid #d0d7de;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
table.smart thead th.num { text-align: right; }
table.smart thead th:hover { background: #eef1f4; }
table.smart thead th::after { content: ""; opacity: 0.4; margin-left: 4px; }
table.smart thead th.sort-asc::after  { content: "▲"; opacity: 1; }
table.smart thead th.sort-desc::after { content: "▼"; opacity: 1; }
table.smart tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid #eaecef;
}
table.smart tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.smart tbody tr:hover { background: #fbfcfd; }

/* Heatmap-style coloured cells inside a regular table */
.cell-heat {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

/* Filter input on top of a sortable table */
.smart-controls {
  display: flex;
  gap: 0.5em;
  margin-bottom: 0.6em;
  align-items: center;
}
.smart-controls input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 0.92em;
}
.smart-controls .count {
  color: #586069;
  font-size: 0.85em;
}

/* Make the cayman main-content actually wide enough for full-bleed charts */
.main-content { max-width: 1100px !important; }
@media (max-width: 1199px) {
  .main-content { max-width: 95% !important; }
}
