.credit-layout {
  margin-top: 24px;
  display: grid;
  gap: 20px;
}

.inline-header {
  padding: 0 0 18px;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.compact {
  margin-top: 6px;
}

.chart-host {
  margin-top: 18px;
  min-height: 460px;
}

.chart-shell {
  position: relative;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.94) 100%),
    radial-gradient(circle at top left, rgba(11, 107, 87, 0.09), transparent 48%);
}

.chart-shell svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-empty {
  min-height: 200px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.cohort-legend {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cohort-chip,
.window-chip {
  width: auto;
  margin-top: 0;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.cohort-chip.active,
.window-chip.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.cohort-chip.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}

.month-window {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.credit-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compact-data {
  grid-template-columns: 150px 1fr;
}

.tight-list {
  gap: 10px;
}

.tight-list li {
  list-style: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.methodology-note p {
  margin: 0;
  color: #d4e2dd;
  line-height: 1.5;
}

.table-card {
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
}

.loss-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
}

.loss-table th,
.loss-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
  background: rgba(248, 246, 241, 0.96);
}

.loss-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2e8;
}

.loss-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  background: #f3f5ee;
}

.loss-table tbody .sticky-col {
  background: rgba(248, 246, 241, 1);
}

.loss-table th:first-child,
.loss-table td:first-child {
  border-left: 1px solid var(--line);
}

.axis-label,
.tick-label {
  fill: var(--muted);
  font-size: 12px;
  font-family: Georgia, "Times New Roman", serif;
}

.grid-line {
  stroke: rgba(87, 112, 106, 0.16);
  stroke-width: 1;
}

.axis-line {
  stroke: rgba(20, 35, 31, 0.25);
  stroke-width: 1;
}

.chart-subtitle {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .credit-summary-grid {
    grid-template-columns: 1fr;
  }

  .inline-header {
    gap: 16px;
  }

  .month-window {
    justify-content: start;
  }
}
