/* Angebotewelt: mobile Formulare und lokale Bildbearbeitung */
.mobile-tools{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.mobile-tools button{min-height:48px}.image-preview{display:block;max-width:100%;max-height:320px;object-fit:contain;margin:16px auto}.image-preview[hidden]{display:none}.photo-dialog{width:min(720px,calc(100% - 20px));max-height:92dvh;overflow:auto;padding:24px;border:1px solid #8595a5;border-radius:24px 0 24px 24px;color:#222b33;background:white}.photo-dialog::backdrop{background:rgba(0,20,45,.75)}.photo-dialog h2{font-size:27px}.photo-canvas{display:block;width:100%;height:auto;max-height:42dvh;object-fit:contain;background:#edf0f3;touch-action:none;cursor:grab}.photo-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.photo-controls label{margin:0}.photo-controls input[type=range]{padding:0;min-height:44px;width:100%;accent-color:#00489f}.photo-dialog .actions{margin-top:16px}.photo-status{margin:12px 0;overflow-wrap:anywhere}.password-control{margin-top:6px}.editor fieldset{min-width:0}.field small{overflow-wrap:anywhere}
@media(max-width:650px){.auth{width:100%}.auth .card{padding:20px 16px}.auth .btn,.editor>.actions>.btn{width:100%}.nav nav{width:100%;gap:8px 16px}.nav nav>a{display:inline-flex;align-items:center;min-height:44px}.section-head>.btn{width:100%}.editor legend{max-width:100%;font-size:20px}.editor>.actions{padding:12px 0 max(12px,env(safe-area-inset-bottom));z-index:5}.editor .check{min-height:44px}.editor input[type=datetime-local]{min-width:0;max-width:100%}.photo-dialog{padding:16px}.photo-controls{gap:10px}.photo-dialog .actions .btn{flex:1}.mobile-tools .btn{flex:1 1 130px}.brand-logo{width:180px}.offer-summary,.offer-row{max-width:100%;overflow-wrap:anywhere}h1{overflow-wrap:anywhere}.footer{padding-bottom:max(24px,env(safe-area-inset-bottom))}}
/* Kleine Verbesserungen der Bildbearbeitung und der Angebotsdarstellung. */
.mobile-tools{align-items:center}.mobile-tools .link{min-height:44px}
.photo-dialog .photo-controls input[type=range]{height:44px;min-height:44px;cursor:pointer}
.photo-dialog .photo-controls label{display:flex;flex-direction:column;gap:6px}
.photo-dialog h2,.photo-dialog p{overflow-wrap:anywhere}
.photo-dialog .photo-canvas{touch-action:none;max-width:100%;border:1px solid #bdcbd8;border-radius:12px 0 12px 12px}
.offer-card .offer-photo{display:block;width:100%;height:190px;max-height:none;object-fit:cover;margin-bottom:20px;border-radius:16px 0 16px 16px;background:#f4f7fa}
.photo-empty{display:grid!important;place-items:center;text-align:center;color:#53616f;font-size:14px}
@media(max-width:650px){.offer-card .offer-photo{height:210px}.photo-dialog{max-height:95dvh;overflow-y:auto}.photo-dialog .photo-controls{grid-template-columns:1fr 1fr}.photo-dialog .actions{position:sticky;bottom:0;background:white;padding:10px 0;z-index:1}}

/* -------------------------------------------------------
   Bildgroessen-Fix 2026-11-03
   Gilt fuer die Haendler-Uebersicht, die Angebotskarten,
   gespeicherte Bilder und die mobile Foto-Bearbeitung.
   Schuetzt vor riesigen Originalfotos/SVG-Grafiken.
------------------------------------------------------- */
/* Meine Angebote: feste Thumbnail-Groesse auch bei sehr grossen Originaldateien */
.offer-row {
  display:grid;
  grid-template-columns:120px minmax(0, 1fr) auto;
  align-items:center;
  gap:18px;
  max-width:100%;
  min-width:0;
}
.offer-row > img.offer-thumb,
.offer-row > .offer-thumb {
  display:block;
  width:120px !important;
  min-width:0;
  max-width:120px !important;
  height:90px !important;
  max-height:90px !important;
  flex:0 0 120px !important;
  object-fit:cover !important;
  object-position:center;
  border-radius:12px 0 12px 12px;
  overflow:hidden;
}
.offer-row > .offer-summary {min-width:0;max-width:100%;overflow-wrap:anywhere}
.offer-row > .offer-summary h2 {font-size:clamp(19px, 2vw, 24px);margin:6px 0}
.offer-row > .actions {justify-content:flex-end;min-width:0}
/* Oeffentliche Angebotskarten: einheitliche Bildflaeche statt Originalgroesse */
.offer-card img.offer-photo,
.offer-card img.media.offer-photo {
  display:block;
  width:100% !important;
  max-width:100% !important;
  height:190px !important;
  max-height:190px !important;
  object-fit:cover !important;
  object-position:center;
  border-radius:14px 0 14px 14px;
}
/* Gespeichertes Bild beim Bearbeiten: kompakte Vorschau */
.editor ~ .grid .stored-offer-image,
img.stored-offer-image {
  display:block;
  width:100% !important;
  max-width:320px !important;
  height:180px !important;
  max-height:180px !important;
  object-fit:contain !important;
  object-position:center;
  margin-inline:auto;
  background:#f4f7fa;
}
/* Foto-Upload und Dialog: auch bei hohen Bildern keine riesige Vorschau */
img.image-preview {
  display:block;
  width:auto !important;
  max-width:min(100%, 320px) !important;
  height:auto !important;
  max-height:200px !important;
  object-fit:contain !important;
}
img.image-preview[hidden] {display:none !important}
.photo-dialog {width:min(640px, calc(100% - 20px));max-height:92dvh;overflow:auto}
.photo-dialog canvas.photo-canvas {
  display:block;
  width:auto !important;
  max-width:100% !important;
  max-height:300px !important;
  height:auto !important;
  margin:0 auto;
  object-fit:contain;
}
@media (max-width:700px) {
  .offer-row {
    display:grid !important;
    grid-template-columns:96px minmax(0,1fr);
    gap:12px;
    align-items:center;
  }
  .offer-row > img.offer-thumb,
  .offer-row > .offer-thumb {
    width:96px !important;
    max-width:96px !important;
    height:86px !important;
    max-height:86px !important;
    flex:0 0 96px !important;
  }
  .offer-row > .actions {grid-column:1 / -1;justify-content:flex-start;width:100%}
  .offer-card img.offer-photo,
  .offer-card img.media.offer-photo {height:180px !important;max-height:180px !important}
  .photo-dialog canvas.photo-canvas {max-height:240px !important}
  .photo-dialog .photo-controls {grid-template-columns:1fr 1fr}
}
@media (max-width:380px) {
  .offer-row {grid-template-columns:80px minmax(0,1fr)}
  .offer-row > img.offer-thumb,
  .offer-row > .offer-thumb {width:80px !important;max-width:80px !important;height:76px !important;max-height:76px !important}
  .photo-dialog .photo-controls {grid-template-columns:1fr}
}

/* V3.3 Handy-Bildeditor – kompakter, vollständig bedienbarer Ausschnitt. */
.photo-dialog .hp-photo-stage {
  display:grid;place-items:center;width:100%;height:clamp(155px,28dvh,260px);
  min-height:0;padding:8px;overflow:hidden;
  border:1px solid #d5e1eb;border-radius:12px 0 12px 12px;background:#f2f6fa;
}
.photo-dialog .hp-photo-stage canvas.photo-canvas {
  display:block!important;width:auto!important;height:auto!important;
  max-width:100%!important;max-height:100%!important;
  object-fit:contain!important;margin:0 auto!important;
  border:0!important;border-radius:8px!important;
  cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;
}
.photo-dialog .hp-photo-stage canvas.hp-photo-dragging{cursor:grabbing;}
.photo-dialog .hp-photo-instructions{font-size:14px;line-height:1.45;margin:4px 0 12px;color:#53616f;}
.photo-dialog .photo-controls{gap:12px;}
.photo-dialog .photo-controls label{font-size:14px;line-height:1.3;min-width:0;}
.photo-dialog .photo-controls label output{font-size:12px;float:right;color:#53616f;}
.photo-dialog .photo-controls select{max-width:100%;min-width:0;}
.photo-dialog .photo-controls small{font-size:11px;line-height:1.3;}
@media(max-width:650px){
  .photo-dialog:not([hidden]){
    box-sizing:border-box;width:calc(100% - 14px)!important;
    max-width:440px!important;max-height:calc(100dvh - 14px)!important;
    overflow-y:auto;overscroll-behavior:contain;
    padding:14px 12px 9px!important;border-radius:17px 0 17px 17px!important;
  }
  .photo-dialog h2{font-size:21px!important;line-height:1.2!important;margin:0 0 5px!important;letter-spacing:0;}
  .photo-dialog .hp-photo-instructions{font-size:12px!important;margin:0 0 9px!important;}
  .photo-dialog .hp-photo-stage{height:clamp(140px,27dvh,205px)!important;padding:6px!important;}
  .photo-dialog .photo-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:9px 10px!important;margin:11px 0!important;}
  .photo-dialog .photo-controls label{font-size:12px!important;margin:0!important;gap:4px!important;}
  .photo-dialog .photo-controls select{
    width:100%;font-size:13px!important;min-height:36px!important;height:36px!important;
    padding:6px 22px 6px 7px!important;border-radius:8px 0 8px 8px!important;
  }
  .photo-dialog .photo-controls input[type=range]{
    height:29px!important;min-height:29px!important;padding:0!important;margin:0!important;
    width:100%!important;touch-action:pan-y;
  }
  .photo-dialog .photo-controls small{display:none!important;}
  .photo-dialog #hp-photo-transforms{display:flex!important;flex-wrap:nowrap!important;gap:7px!important;margin:4px 0 7px!important;}
  .photo-dialog #hp-photo-transforms button{
    flex:1 1 0!important;min-width:0!important;min-height:36px!important;height:36px!important;
    padding:6px 5px!important;font-size:12px!important;line-height:1.2!important;
    white-space:nowrap;border-radius:9px 0 9px 9px!important;
  }
  .photo-dialog #hp-photo-feedback{font-size:12px!important;margin:4px 0!important;}
  .photo-dialog #hp-photo-actions{
    display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;
    position:sticky;bottom:0;margin:8px -12px -9px!important;
    padding:8px 12px max(9px,env(safe-area-inset-bottom))!important;
    background:#fff;box-shadow:0 -6px 16px #ffffffee;border-top:1px solid #e5edf3;z-index:3;
  }
  .photo-dialog #hp-photo-actions button{
    flex:none!important;width:100%!important;min-width:0!important;
    height:42px!important;min-height:42px!important;
    font-size:14px!important;line-height:1.1!important;font-weight:400!important;
    white-space:nowrap;padding:7px 9px!important;
    border-radius:10px 0 10px 10px!important;
  }
}
@media(max-width:360px){
  .photo-dialog h2{font-size:19px!important;}
  .photo-dialog .hp-photo-stage{height:150px!important;}
  .photo-dialog .photo-controls{gap:7px!important;}
}
