/* ===== DrSuper Popup Calculator (Top-Right, Persistent, Non-Blocking) ===== */

/* Floating button */
#calcFab{
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;

  border: 1px solid rgba(0,0,0,.2);
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);

  font-size: 18px;
  line-height: 1;
  user-select: none;
}
#calcFab:hover{ transform: translateY(-1px); }

/* IMPORTANT: default CLOSED (beats other CSS) */
.calc-overlay{
  display: none !important;
}

/* When open: anchor top-right and DO NOT block page interaction */
.calc-overlay.is-open{
  display: flex !important;

  position: fixed;
  inset: 0;
  z-index: 10000;

  align-items: flex-start;
  justify-content: flex-end;

  padding: 18px;

  background: transparent;     /* no dim layer */
  pointer-events: none;        /* <-- clicks/typing pass through to page */
}

/* The calculator panel itself IS interactive */
.calc-modal{
  pointer-events: auto;        /* <-- allows clicking calculator buttons */

  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.25);

  padding: 14px;

  /* space from very top-right */
  margin-top: 52px;
  margin-right: 8px;
}

/* Header */
.calc-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.calc-title{ font-weight:700; font-size:16px; }
.calc-sub{ font-size:12px; opacity:.7; margin-top:2px; }

.calc-x{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 10px;
}
.calc-x:hover{ background: rgba(0,0,0,.06); }

/* Display */
.calc-display{
  width: 100%;
  margin: 12px 0;

  font-size: 18px;
  padding: 10px 12px;

  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.18);
  outline: none;
}
.calc-display:focus{ border-color: rgba(0,0,0,.35); }

/* Buttons grid */
.calc-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.cb{
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;

  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
  font-size: 15px;

  user-select: none;
}
.cb:hover{ background: rgba(0,0,0,.04); }
.cb.op{ font-weight:700; }
.cb.eq{ font-weight:800; }
.cb.danger{ font-weight:700; }

/* Footer */
.calc-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top: 10px;
}
.calc-copy{
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  border: 1px solid rgba(0,0,0,.16);
  background: #fff;
}
.calc-copy:hover{ background: rgba(0,0,0,.04); }
.calc-msg{ font-size: 12px; opacity: .75; }

/* Mobile tweak */
@media (max-width: 520px){
  .calc-modal{ width: 92vw; margin-top: 56px; }
  .calc-grid{ grid-template-columns: repeat(4, 1fr); }
}