/* Registered Account Contribution Optimizer styles */

#raoResults .grid {
  row-gap: 12px;
  min-width: 0;
}

#raoResults .col {
  min-width: 0;
}

.hoursRow {
  display: none;
}

.chartWrap {
  width: 100%;
  max-width: 520px;
  margin: 15px auto 0;
  position: relative;
  min-width: 0;
}

.raoInlineDonutWrap {
  height: 320px;
  margin-top: 10px;
}

#raoAllocChart {
  width: 100% !important;
  max-width: 100% !important;
  height: 320px !important;
  max-height: 320px;
  display: block;
}

.yearChartWrap {
  width: 100%;
  height: 260px;
  min-height: 260px;
}

.yearChartWrap canvas,
#raoYear1Chart {
  width: 100% !important;
  max-width: 100% !important;
  height: 260px !important;
  max-height: 260px;
  display: block;
}

.scenarioLegend {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  margin-bottom: 4px;
  min-width: 0;
}

.scenarioLegendItem {
  display: block;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.scenarioLegendItem b {
  color: #0f172a;
}

.scenarioLegend .noteLine,
#raoStrategy,
#raoWhy,
.limitSub,
.limitValue,
.taxLegendRow .name>span:last-child {
  overflow-wrap: anywhere;
}

#provCompareCard tr.isSelected {
  background: rgba(37, 99, 235, 0.1);
  outline: 1px solid rgba(37, 99, 235, 0.25);
}

.rankCell {
  text-align: center;
}

.rankNum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-weight: 650;
  font-size: 12px;
}

.rankMedal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.6);
}

.rankMedal svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.rankMedal.gold {
  color: #b45309;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
}

.rankMedal.silver {
  color: #4b5563;
  background: rgba(156, 163, 175, 0.18);
  border-color: rgba(156, 163, 175, 0.35);
}

.rankMedal.bronze {
  color: #92400e;
  background: rgba(217, 119, 6, 0.18);
  border-color: rgba(217, 119, 6, 0.35);
}

/* Limits bars (borrowed pattern from borrowing-capacity) */
.limitsBars {
  display: grid;
  gap: 12px;
  padding: 4px 0;
  min-width: 0;
}

.limitRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.limitTitle {
  font-weight: 700;
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.limitTitleTop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.limitSub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
}

.limitValue {
  font-size: 13px;
  opacity: 0.9;
  white-space: nowrap;
  min-width: 0;
}

.limitProgress {
  grid-column: 1 / -1;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.limitFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 180ms ease;
  background: var(--numora-accent, #111);
}

.limitBadge {
  display: inline-block;
  margin-left: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.limitBadge--maxed {
  background: rgb(20 184 57 / 16%);
  border: 1px solid rgb(13 148 22 / 40%);
}

.limitBadge--open {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.36);
}

.limitBadge--na {
  background: rgba(100, 116, 139, 0.16);
  border: 1px solid rgba(100, 116, 139, 0.34);
}

.taxLegendWrap {
  margin-top: 6px;
}

.taxLegendHeading {
  margin: 0 0 8px;
  font-size: 14px;
  color: #0f172a;
}

.taxLegend {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
}

.taxLegendRow {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  border: 1px solid rgba(15, 23, 42, .06);
  background: rgba(15, 23, 42, .03);
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 0;
}

.taxLegendRowTotal {
  font-weight: 800;
  color: #0f172a;
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.06);
}

.taxLegendRow .name {
  display: flex;
  align-items: baseline;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.taxLegendRow .name>span:last-child {
  min-width: 0;
}

.taxLegendRow b {
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

.taxLegendRow>span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 9px;
}

.dotRrsp {
  background: rgba(37, 99, 235, 0.55);
}

.dotFhsa {
  background: rgba(245, 158, 11, 0.55);
}

.dotResp {
  background: rgba(16, 185, 129, 0.55);
}

.dotTotal {
  background: rgba(15, 23, 42, 0.45);
}

@media (max-width: 620px) {
  #raoResults .col {
    min-width: 0;
  }

  .chartWrap {
    max-width: 100%;
  }

  .limitRow {
    grid-template-columns: 1fr;
  }

  .raoInlineDonutWrap {
    height: 280px;
  }

  #raoAllocChart {
    height: 280px !important;
    max-height: 280px;
  }

  .yearChartWrap {
    height: 240px;
    min-height: 240px;
  }

  .yearChartWrap canvas,
  #raoYear1Chart {
    height: 240px !important;
    max-height: 240px;
  }

  .limitValue {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .taxLegendRow {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .taxLegendRow>span:last-child {
    white-space: normal;
  }
}