/* Theme-resistant preview and result containment. */
.ehr-app [hidden] {
  display: none !important;
}

.ehr-app .ehr-selected-file:not([hidden]) {
  display: block !important;
  width: 100% !important;
  margin-top: 10px !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  background: #effbf3 !important;
  color: #137a43 !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere !important;
}

.ehr-app .ehr-preview-panel {
  min-width: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

.ehr-app .ehr-preview:not([hidden]) {
  display: block !important;
  position: static !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.ehr-app .ehr-image-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
  height: 330px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.ehr-app .ehr-image-wrap > img {
  display: block !important;
  position: static !important;
  inset: auto !important;
  float: none !important;
  transform: none !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: 300px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}

.ehr-app .ehr-status:not([hidden]),
.ehr-app .ehr-result:not([hidden]) {
  position: static !important;
  clear: both !important;
  width: 100% !important;
  visibility: visible;
}

.ehr-app .ehr-result:not([hidden]),
.ehr-app .ehr-result:not([hidden]) .ehr-download {
  display: block !important;
}

@media (max-width: 760px) {
  .ehr-app .ehr-image-wrap { height: 280px !important; }
  .ehr-app .ehr-image-wrap > img { max-height: 250px !important; }
}

/* Version 1.1 crop workspace */
.ehr-app .ehr-type { grid-template-columns: repeat(3, 1fr) !important; }
.ehr-app .ehr-crop-editor:not([hidden]) { display: block !important; margin-top: 14px; }
.ehr-app .ehr-crop-stage { position: relative !important; display: flex !important; align-items: center !important; justify-content: center !important; width: 100% !important; height: 360px !important; overflow: hidden !important; border-radius: 13px; background: #222; touch-action: none; user-select: none; }
.ehr-app .ehr-crop-stage > img { display: block !important; position: static !important; width: auto !important; height: auto !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; margin: 0 !important; pointer-events: none; }
.ehr-app .ehr-crop-box { position: absolute !important; z-index: 3; border: 2px solid #f57c00; box-shadow: 0 0 0 9999px rgba(0,0,0,.48); cursor: move; touch-action: none; }
.ehr-app .ehr-crop-handle { position: absolute; right: -8px; bottom: -8px; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: #f57c00; cursor: nwse-resize; }
.ehr-app .ehr-crop-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.ehr-app .ehr-crop-toolbar label { font-size: 12px; font-weight: 750; }
.ehr-app .ehr-crop-toolbar select { margin-top: 5px; }
.ehr-app .ehr-small-button,.ehr-app .ehr-secondary { border: 1.5px solid #f57c00; border-radius: 10px; background: #fff; color: #b95400; min-height: 46px; padding: 10px 14px; font-weight: 800; cursor: pointer; }
.ehr-app .ehr-secondary:not([hidden]) { display: block !important; width: 100%; margin-top: 10px; }
.ehr-app .ehr-crop-help { margin: 8px 2px 0; color: #626262; font-size: 12px; line-height: 1.45; }
@media (max-width: 520px) {
  .ehr-app .ehr-type span { font-size: 12px; padding: 11px 3px; }
  .ehr-app .ehr-crop-stage { height: 300px !important; }
  .ehr-app .ehr-crop-toolbar { grid-template-columns: 1fr; }
}

.ehr-app .ehr-enhance:not([hidden]) {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #bce5ca;
  border-radius: 11px;
  background: #effbf3;
  color: #14532d;
  cursor: pointer;
}
.ehr-app .ehr-enhance input { margin-top: 3px; accent-color: #137a43; }
.ehr-app .ehr-enhance span,.ehr-app .ehr-enhance strong,.ehr-app .ehr-enhance small { display: block; }
.ehr-app .ehr-enhance strong { font-size: 13px; }
.ehr-app .ehr-enhance small { margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: #356047; }
