/* ═══════════ 시술 재료비·마진 계산기 (mt- 접두사, 라이트 배경 전용) ═══════════ */

.calc.mt-calc {
  margin-top: 12px;
}

/* ── 입력 그룹 ── */
.mt-group + .mt-group {
  margin-top: 28px;
}

.mt-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 800;
  margin-bottom: 10px;
}

.mt-hint {
  margin-top: 8px;
  min-height: 1.25em;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-mute);
}

/* ── 시술 프리셋 칩 ── */
.mt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mt-chip {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-sub);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease,
    border-color var(--duration-fast) ease, transform var(--duration-fast) ease;
}
.mt-chip:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
  background: var(--brand-50);
}
.mt-chip:active {
  transform: scale(0.95);
}
.mt-chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── 금액 인풋 ── */
.mt-money {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px 18px;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease,
    background var(--duration-fast) ease;
}
.mt-money:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.mt-money input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: right;
  padding: 9px 0;
}
.mt-money input:focus {
  outline: none;
}
.mt-money input::placeholder {
  color: var(--ink-mute);
}
.mt-unit {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--ink-mute);
  flex-shrink: 0;
}

/* ── 재료 항목 리스트 ── */
.mt-items-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.mt-count {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-mute);
}

.mt-items {
  display: grid;
  gap: 8px;
}
.mt-item {
  display: grid;
  grid-template-columns: 1fr 140px 36px;
  gap: 8px;
  align-items: center;
}

.mt-item-name {
  min-width: 0;
  border: 1.5px solid transparent;
  background: var(--bg);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}
.mt-item-name:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.mt-item-name::placeholder {
  color: var(--ink-mute);
}

.mt-item-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}
.mt-item-cost:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.mt-item-cost input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--ink);
  text-align: right;
  padding: 11px 0;
}
.mt-item-cost input:focus {
  outline: none;
}
.mt-item-cost input::placeholder {
  color: var(--ink-mute);
}
.mt-item-cost span {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-mute);
  flex-shrink: 0;
}

.mt-item-remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-mute);
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.mt-item-remove:hover:not(:disabled) {
  background: #fdeef0;
  color: var(--up);
}
.mt-item-remove:disabled {
  opacity: 0.3;
  cursor: default;
}
.mt-item-remove svg {
  width: 16px;
  height: 16px;
}

.mt-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1.5px dashed var(--brand-300);
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: var(--text-sm);
  font-weight: 800;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.mt-add:hover:not(:disabled) {
  background: var(--brand-100);
}
.mt-add:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--bg);
  color: var(--ink-mute);
}
.mt-add svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── 결과 카드 ── */
.mt-summary h3 {
  margin-bottom: 4px;
}

.mt-big {
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.5rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.mt-big.is-minus {
  color: var(--up);
}
.mt-big-sub {
  margin-top: 2px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-mute);
}

/* ── 재료비율 게이지 ── */
.mt-gauge {
  --mt-warn: #f59e0b;
  --mt-warn-ink: #b25309;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
}
.mt-gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.mt-gauge-head span {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--ink-sub);
}
.mt-gauge-head b {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.mt-gauge-track {
  position: relative;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.mt-gauge-fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--brand);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--ease-out-expo),
    background var(--duration-normal) ease;
}
.mt-gauge-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--surface);
}
.mt-tick-15 { left: 25%; }
.mt-tick-30 { left: 50%; }

.mt-gauge-scale {
  position: relative;
  height: 1.2em;
  margin-top: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-mute);
}
.mt-gauge-scale span {
  position: absolute;
  top: 0;
}
.mt-scale-0 { left: 0; }
.mt-scale-15 { left: 25%; transform: translateX(-50%); }
.mt-scale-30 { left: 50%; transform: translateX(-50%); }
.mt-scale-max { right: 0; }

.mt-gauge-status {
  margin-top: 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-sub);
}

.mt-gauge.is-safe .mt-gauge-fill { background: var(--brand); }
.mt-gauge.is-safe .mt-gauge-head b,
.mt-gauge.is-safe .mt-gauge-status { color: var(--brand-600); }

.mt-gauge.is-warn .mt-gauge-fill { background: var(--mt-warn); }
.mt-gauge.is-warn .mt-gauge-head b,
.mt-gauge.is-warn .mt-gauge-status { color: var(--mt-warn-ink); }

.mt-gauge.is-danger .mt-gauge-fill { background: var(--up); }
.mt-gauge.is-danger .mt-gauge-head b,
.mt-gauge.is-danger .mt-gauge-status { color: var(--up); }

/* ── 결과 상세 라인 ── */
.mt-lines {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mt-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
}
.mt-lines span {
  color: var(--ink-sub);
  font-weight: 500;
}
.mt-lines b {
  font-weight: 800;
}

.mt-insight {
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.5;
}

.mt-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── 값 갱신 팝 모션 (transform만 사용) ── */
@keyframes mt-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.is-pop {
  display: inline-block;
  transform-origin: left center;
  animation: mt-pop 240ms var(--ease-out-expo);
}
.mt-lines b.is-pop,
.mt-gauge-head b.is-pop {
  transform-origin: right center;
}

@media (prefers-reduced-motion: reduce) {
  .is-pop {
    animation: none;
  }
  .mt-gauge-fill {
    transition: none;
  }
}

/* ── 반응형 ── */
@media (max-width: 560px) {
  .mt-item {
    grid-template-columns: 1fr 36px;
  }
  .mt-item-name {
    grid-column: 1 / -1;
  }
  .mt-item-cost {
    grid-column: 1;
  }
  .mt-item-remove {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  .mt-money {
    padding: 4px 14px;
  }
  .mt-chip {
    flex: 1 1 calc(50% - 8px);
    padding-inline: 0;
    text-align: center;
  }
}
