/* Scoped: nothing leaks outside .matuc */
.matuc{
  --matuc-accent: #C3532B;
  --matuc-text: #2f3a44;
  --matuc-muted: rgba(69,88,108,0.18);
  --matuc-card: #ffffff;
  --matuc-row: #f6f7f8;
  color: var(--matuc-text);
}

.matuc *{ box-sizing:border-box; }

.matuc-grid{
  display:grid;
  gap:24px;
}

.matuc-grid--top{
  grid-template-columns: 1fr 1fr;
}

.matuc-grid--charts{
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

@media (max-width: 900px){
  .matuc-grid--top,
  .matuc-grid--charts{
    grid-template-columns: 1fr;
  }
}

.matuc-card{
  background: var(--matuc-card);
  border: 1px solid var(--matuc-muted);
  border-radius: 12px;
  padding: 20px;
}

.matuc-card__title{
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.matuc-toggle{
  display:flex;
  gap:10px;
  margin-bottom: 16px;
}

.matuc-toggle__btn{
  appearance:none;
  border: 1px solid var(--matuc-muted);
  background: #f4f5f6;
  padding: 9px 14px;
  border-radius: 10px;
  cursor:pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  color: var(--matuc-text);
}

.matuc-toggle__btn:hover{
  background: #eceeef;
}

.matuc-toggle__btn.is-active{
  background: var(--matuc-accent);
  border-color: var(--matuc-accent);
  color: #fff;
}


.matuc-form{
  display:grid;
  gap:14px;
}

.matuc-field__label{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.matuc-help{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius: 999px;
  border:1px solid var(--matuc-muted);
  font-size: 12px;
  opacity: .8;
  cursor: help;
}

.matuc-input{
  width:100%;
  padding:10px 12px;
  border-radius: 10px;
  border:1px solid var(--matuc-muted);
  font: inherit;
}

.matuc-input:focus{
  outline:none;
  border-color: var(--matuc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--matuc-accent) 18%, transparent);
}

.matuc-metrics{
  display:grid;
  gap:12px;
}

.matuc-metric{
  display:flex;
  justify-content: space-between;
  align-items:center;
  background: var(--matuc-row);
  padding: 12px 14px;
  border-radius: 10px;
}

.matuc-metric__label{
  font-weight: 600;
}

.matuc-pill{
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--matuc-muted);
  background: #fff;
}

.matuc-pill.is-green{ background:#d4edda; border-color:#c3e6cb; color:#155724; }
.matuc-pill.is-amber{ background:#fff3cd; border-color:#ffeeba; color:#856404; }
.matuc-pill.is-red{ background:#f8d7da; border-color:#f5c6cb; color:#721c24; }

.matuc-value{
  font-weight: 700;
}

.matuc-legend{
  display:flex;
  gap:16px;
  justify-content:center;
  margin-top: 16px;
  font-size: .9rem;
  opacity: .85;
  flex-wrap: wrap;
}

.matuc-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:999px;
  margin-right: 6px;
}

.matuc-dot.is-green{ background:#28a745; }
.matuc-dot.is-amber{ background:#ffc107; }
.matuc-dot.is-red{ background:#dc3545; }

.matuc-chart__title{
  text-align:center;
  margin: 6px 0 10px 0;
  font-size: .95rem;
  font-weight: 650;
}

/* CRITICAL: fixed height so Chart.js can't expand the page forever */
.matuc-chart__area{
  height: 280px;
  max-height: 280px;
  width: 100%;
  position: relative;
}

.matuc-chart__area canvas{
  width: 100% !important;
  height: 100% !important;
  display:block;
}
/* Space between top cards and visualisation */
.matuc-grid--top{
  margin-bottom: 36px;
}

