/* ===== Calculator Modal ===== */
.calc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.calc-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.calc-modal {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0,0,0,.35);
  transform: translateY(16px);
  transition: transform .25s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.calc-modal-overlay.is-open .calc-modal {
  transform: translateY(0);
}

.calc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eef0f3;
  flex-shrink: 0;
}
.calc-modal__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.02em;
}
.calc-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.calc-modal__close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.calc-modal__body {
  overflow-y: auto;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

/* ===== Calculator layout inside modal ===== */
.calc-modal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 680px) {
  .calc-modal-layout { grid-template-columns: 1fr 1fr; }
}

.calc-modal-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
}

/* Chips */
.calc-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.calc-modal-chip {
  padding: 7px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  color: #475569;
}
.calc-modal-chip:hover { border-color: #cbd5e1; }
.calc-modal-chip.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.calc-modal-chip small {
  display: block;
  font-size: 10px;
  opacity: .7;
  margin-top: 1px;
}

/* Fields */
.calc-modal-field { margin-bottom: 18px; }
.calc-modal-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #334155;
}
.calc-modal-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}
.calc-modal-select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

.calc-modal-custom {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.calc-modal-custom.is-visible { display: flex; }
.calc-modal-custom input {
  width: 90px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.calc-modal-custom input:focus {
  outline: none;
  border-color: #0f766e;
}
.calc-modal-custom span { font-size: 13px; color: #64748b; }

/* Slider */
.calc-modal-slider {
  margin-top: 10px;
}
.calc-modal-slider input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}
.calc-modal-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #0f766e;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.calc-modal-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #0f766e;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
}
.calc-modal-slider-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

/* ===== Result area ===== */
.calc-modal-result {
  background: #f8fafc;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.calc-modal-draw-label {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}
.calc-modal-draw-value {
  font-size: 48px;
  font-weight: 800;
  color: #0f766e;
  margin: 4px 0;
  line-height: 1;
  letter-spacing: -.03em;
}
.calc-modal-draw-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 16px;
}

.calc-modal-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}
.calc-modal-stat strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
.calc-modal-stat span {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Syringe visual */
.calc-modal-syringe {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}
.calc-modal-syringe svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.calc-modal-syringe-summary {
  text-align: center;
  font-size: 13px;
  color: #475569;
  margin-top: 12px;
  line-height: 1.5;
}
.calc-modal-syringe-summary strong { color: #0f766e; }

/* Warning */
.calc-modal-warning {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}
.calc-modal-warning.is-visible { display: block; }

/* ===== Mobile ===== */
@media (max-width: 679px) {
  .calc-modal-overlay { padding: 0; }
  .calc-modal {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
  }
  .calc-modal__header { padding: 16px; }
  .calc-modal__title { font-size: 17px; }
  .calc-modal__body { padding: 16px; }
  .calc-modal-result { padding: 18px; }
  .calc-modal-draw-value { font-size: 40px; }
  .calc-modal-stats { gap: 16px; }
}
