/* Scoped: nothing leaks outside .matfc */
.matfc {
  --matfc-accent: #C3532B;
  --matfc-text: #2f3a44;
  --matfc-muted: rgba(69,88,108,0.18);
  --matfc-card: #ffffff;
  --matfc-row: #f6f7f8;
  color: var(--matfc-text);
}

.matfc * { box-sizing: border-box; }

.matfc-card {
  background: var(--matfc-card);
  border: 1px solid var(--matfc-muted);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.matfc-card__title {
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  font-weight: 650;
}

/* Sliders - 2x2 grid on desktop, stacked on mobile */
.matfc-form--sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

@media (max-width: 600px) {
  .matfc-form--sliders {
    grid-template-columns: 1fr;
  }
}

.matfc-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.matfc-field__label {
  font-weight: 600;
  font-size: 0.9rem;
}

.matfc-slider-value {
  font-weight: 700;
  font-size: 0.95rem;
}

.matfc-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, var(--matfc-accent) 50%, #d1d5db 50%);
}

/* Vertical-line slider thumb */
.matfc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 3px;
  height: 20px;
  border-radius: 1px;
  background: var(--matfc-accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(195,83,43,0.15);
}

.matfc-range::-moz-range-thumb {
  width: 3px;
  height: 20px;
  border-radius: 1px;
  background: var(--matfc-accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(195,83,43,0.15);
}

.matfc-slider-minmax {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 2px;
}

/* Toggle buttons */
.matfc-toggle {
  display: flex;
  gap: 10px;
}

.matfc-toggle__btn {
  appearance: none;
  border: 1px solid var(--matfc-muted);
  background: #f4f5f6;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  color: var(--matfc-text);
  flex: 1;
  text-align: center;
}

.matfc-toggle__btn:hover {
  background: #eceeef;
}

.matfc-toggle__btn.is-active {
  background: var(--matfc-accent);
  border-color: var(--matfc-accent);
  color: #fff;
}

.matfc-toggle-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 3px;
}

/* Results header: title + inflation toggle on same row */
.matfc-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.matfc-results-header .matfc-card__title {
  margin: 0;
}

/* Inflation toggle */
.matfc-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.matfc-check-row input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--matfc-accent);
  cursor: pointer;
}

.matfc-muted {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Combined tier + result rows */
.matfc-results-tiers {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.matfc-tier-row {
  background: var(--matfc-row);
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 4px solid var(--row-color);
}

.matfc-tier-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

.matfc-tier-row__name {
  font-weight: 650;
  font-size: 0.9rem;
}

.matfc-tier-row__amount {
  font-weight: 700;
  font-size: 1rem;
  font-family: 'DM Mono', monospace;
  color: #111827;
}

.matfc-tier-row__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: #6b7280;
}

.matfc-tier-row__fee {
  font-weight: 600;
  font-family: 'DM Mono', monospace;
}

.matfc-tier-row__diff {
  color: #dc2626;
  font-family: 'DM Mono', monospace;
  font-weight: 600;
}

.matfc-tier-row__bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.matfc-tier-row__bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Callout */
.matfc-callout {
  margin-top: 20px;
  padding: 14px 16px;
  background: #fef2f2;
  border-radius: 10px;
  border: 1px solid #fecaca;
}

.matfc-callout__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #991b1b;
}

.matfc-callout__desc {
  font-size: 0.8rem;
  color: #b91c1c;
  margin-top: 4px;
}

/* Chart */
.matfc-chart__area {
  height: 380px;
  max-height: 380px;
  width: 100%;
  position: relative;
}

.matfc-chart__area canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Disclaimer */
.matfc-disclaimer {
  font-size: 0.7rem;
  opacity: 0.5;
  line-height: 1.5;
  padding: 0 4px;
  margin-top: 0;
}
