/* Qresume responsive fixes v4 */
html, body { max-width: 100%; }
body { overflow-x: hidden; }
img, svg { height: auto; }
.navbar .container-fluid { align-items: center !important; }
.navbar .navbar-nav { min-width: 0; }
.qr-user-chip { min-width: 0; }

/* Keep all main navigation items on one clean row on desktop. */
@media (min-width: 992px) {
  .navbar .navbar-collapse { min-width: 0; }
  .navbar .navbar-nav.d-contents {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    gap: 4px;
  }
  .navbar .navbar-nav.d-contents > .nav-item {
    display: flex;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
  }
  .navbar .navbar-nav.d-contents > .nav-item > .nav-link { margin-top: 0 !important; margin-bottom: 0 !important; }
  .navbar .navbar-nav.d-contents > .nav-item.flex-grow-1 { flex: 1 1 auto !important; }
}

/* Mobile navigation and general pages. */
@media (max-width: 991.98px) {
  .navbar { min-height: 64px !important; padding-left: 14px !important; padding-right: 14px !important; }
  .navbar-brand img { max-width: 150px; }
  .navbar-collapse { max-height: calc(100vh - 76px); overflow-y: auto; padding: 12px 0; }
  .navbar .navbar-nav.d-contents { display: flex !important; flex-direction: column; align-items: stretch; width: 100%; }
  .navbar .navbar-nav > .nav-item { width: 100%; display: block; }
  .navbar .nav-link, .navbar button.nav-link {
    width: 100%; margin-left: 0 !important; margin-right: 0 !important;
    text-align: left; justify-content: flex-start !important; white-space: normal;
  }
  .navbar .create { margin-top: 8px; }
  .qr-user-chip { max-width: 100% !important; white-space: normal !important; overflow-wrap: anywhere; }
  .container { max-width: 100%; }
}

/* Editors: usable toolbar, canvas and footer on phones/tablets. */
.qr-editor-page { padding-bottom: 105px; }
.qr-editor-page > .container { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.qr-editor-page .navbar .navbar-nav.d-contents { width: 100%; }
.qr-editor-page .navbar .row { min-width: 0; }
.qr-editor-page .editor-footer > .row { align-items: center; }

/* Sections window: headings and controls no longer overlap. */
.qr-editor-page #sections .header-2 {
  height: auto !important; min-height: 49px; padding: 10px 34px !important;
  display: grid !important; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 12px;
}
.qr-editor-page #sections .header-2 > div { width: auto !important; padding-left: 0 !important; }
.qr-editor-page #sections .qr-section-restore-bar {
  position: static !important; width: 100%; margin: 0 !important; padding: 12px 34px 14px;
  border-bottom: 1px solid #e5e9ef; align-items: center; line-height: 1.35;
}
.qr-editor-page #sections .qr-hidden-section-note { flex: 1 1 100%; line-height: 1.45; margin-top: 2px; }
.qr-editor-page #sections .overflow-y-scroll { padding-top: 0 !important; }

@media (max-width: 991.98px) {
  .qr-editor-page { padding-bottom: 165px; }
  .qr-editor-page .navbar-collapse { overflow-x: hidden; }
  .qr-editor-page .navbar-collapse .navbar-nav { gap: 8px; }
  .qr-editor-page .navbar-collapse .nav-link { padding: 8px 0; }
  .qr-editor-page .navbar-collapse .nav-link > .row { width: 100%; margin: 0; }
  .qr-editor-page .navbar-collapse .nav-link .d-flex { max-width: 100%; flex-wrap: wrap; }
  .qr-editor-page .navbar-collapse select.form-select { max-width: 160px; }
  .qr-editor-page > .container { padding-left: 8px; padding-right: 8px; }
  .qr-editor-page > .container main { margin-left: 0 !important; margin-right: 0 !important; }
  .qr-editor-page .editor-footer {
    max-height: 155px; overflow-y: auto; overflow-x: hidden; padding: 9px 8px !important;
  }
  .qr-editor-page .editor-footer > .row { width: 100% !important; gap: 8px 12px; }
  .qr-editor-page .editor-footer .auth-status-text { white-space: normal; overflow-wrap: anywhere; }
  .qr-editor-page #tick { min-width: 0 !important; width: auto; }
  .qr-editor-page #template > div, .qr-editor-page #sections > div {
    width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; max-height: 92vh;
  }
  .qr-editor-page #sections .header-2 { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px !important; }
  .qr-editor-page #sections .qr-section-restore-bar { padding: 12px 16px 14px; }
  .qr-editor-page #sections .ps-34 { padding-left: 16px !important; padding-right: 16px !important; }
  .qr-editor-page #sections .ps-68 { padding-left: 32px !important; padding-right: 16px !important; }
  .qr-editor-page #sections .w-260, .qr-editor-page #sections .w-226 { width: auto !important; flex: 1 1 auto; min-width: 0; }
  .qr-editor-page #sections .footer { height: auto !important; min-height: 54px; padding-top: 10px !important; padding-bottom: 10px !important; }
}

@media (max-width: 575.98px) {
  main { max-width: 100%; }
  .fs-32 { font-size: 27px !important; }
  .qr-editor-page .navbar-brand img { max-width: 120px; }
  .qr-editor-page .editor-footer { font-size: 12px !important; }
  .qr-editor-page #sections .header { padding-left: 16px !important; padding-right: 16px !important; }
  .qr-editor-page #sections .qr-section-restore-bar button { width: 100%; }
}


/* Editor toolbar v4: no overlap between underline, undo and save. */
.qr-editor-page .navbar .navbar-nav.d-contents > .nav-item { position: relative; }
.qr-editor-page .navbar .nav-item.flex-grow-1 .nav-link > .row { margin-left: 0; margin-right: 0; }
.qr-editor-page .navbar .nav-item.flex-grow-1 .nav-link > .row > div { min-width: 0; }
.qr-editor-page .navbar .nav-item.flex-grow-1 .nav-link > .row > div:last-child { flex: 0 0 auto; }
.qr-editor-page .navbar button.nav-link { position: relative; z-index: 1; }
@media (max-width: 991.98px) {
  .qr-editor-page .navbar .nav-item.flex-grow-1 .nav-link > .row { width: 100%; gap: 8px; }
  .qr-editor-page .navbar .nav-item.flex-grow-1 .nav-link > .row > div:first-child { flex-wrap: wrap; }
  .qr-editor-page .navbar .nav-item.flex-grow-1 .nav-link > .row > div:last-child { padding: 3px 0; }
}

/* Profile anchors opened from the editor footer. */
#profil, #gespeicherte-lebenslaeufe, #kaufhistorie { scroll-margin-top: 150px; }


/* Editor-Werkzeugleiste beim Scrollen sichtbar halten */
.qr-editor-toolbar{
  position:-webkit-sticky !important;
  position:sticky !important;
  top:0 !important;
  z-index:1025 !important;
  background:rgba(248,249,250,.98) !important;
  box-shadow:0 5px 18px rgba(23,35,60,.12);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.qr-editor-toolbar .navbar-collapse{background:inherit}
@media (max-width:991.98px){
  .qr-editor-toolbar{max-height:55vh;overflow-y:auto;overscroll-behavior:contain}
  .qr-editor-toolbar .navbar-collapse{padding-bottom:10px}
}


/* Editor Runtime v6: Werkzeugleiste wirklich fest und Klickbereiche getrennt */
body.qr-editor-page > nav.qr-editor-toolbar.qr-toolbar-fixed{
  position:fixed !important;top:0 !important;left:0 !important;right:0 !important;width:100% !important;
  z-index:2040 !important;margin:0 !important;background:rgba(255,255,255,.98) !important;
  box-shadow:0 6px 20px rgba(23,35,60,.16) !important;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
}
.qr-editor-toolbar-spacer{display:block;width:100%;height:var(--qr-editor-toolbar-height,80px);flex:0 0 auto}
.qr-editor-page [id^="date-wrapper-"]{position:relative;z-index:1;flex:0 0 auto}
.qr-editor-page [id^="details-wrapper-"]{position:relative;z-index:2;flex:1 1 auto;min-width:0;cursor:text}
.qr-editor-page [id^="details-wrapper-"] .edit-container{left:0 !important;right:auto !important}
.qr-template-name-badge{position:absolute;left:9px;bottom:9px;z-index:22;background:rgba(23,35,60,.92);color:#fff;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:800;line-height:1;pointer-events:none;box-shadow:0 4px 12px rgba(0,0,0,.18)}
.qr-current-template-name{display:inline-flex;align-items:center;border-left:1px solid #d9e0e8;margin-left:8px;padding-left:12px;color:#17233c;font-size:13px;font-weight:800;white-space:nowrap}
#file #file-copy,#file #file-browse,#file #file-back{cursor:pointer}
@media(max-width:991.98px){
  body.qr-editor-page > nav.qr-editor-toolbar.qr-toolbar-fixed{max-height:72vh;overflow-y:auto;overscroll-behavior:contain}
  .qr-current-template-name{margin-left:2px;padding-left:8px;font-size:12px}
}


/* Vorlagenauswahl: Namen sichtbar neben der Vorschau, Premium klar markiert */
.qr-editor-page #template .qr-template-grid{align-items:stretch}
.qr-editor-page #template .qr-template-card{
  display:grid!important;grid-template-columns:minmax(0,1fr) 104px;align-items:stretch;gap:10px;
  padding:10px!important;background:#fff;border:1px solid #e3e8ef;border-radius:14px;
  box-shadow:0 8px 22px rgba(23,35,60,.08);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.qr-editor-page #template .qr-template-card:hover{transform:translateY(-3px);border-color:#ff9a51;box-shadow:0 13px 30px rgba(23,35,60,.15)}
.qr-editor-page #template .qr-template-preview{position:relative;min-width:0;border-radius:10px;overflow:hidden;background:#f2f5f8;display:flex;justify-content:center;align-items:flex-start}
.qr-editor-page #template .qr-template-preview>img{display:block;width:100%;height:auto;max-height:260px;object-fit:contain}
.qr-editor-page #template .qr-template-preview .use{inset:0!important;width:100%!important;height:100%!important;z-index:8}
.qr-editor-page #template .qr-template-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-width:0;color:#17233c;padding:5px 2px}
.qr-editor-page #template .qr-template-card-name{font-size:16px;line-height:1.2;overflow-wrap:anywhere;margin-bottom:9px}
.qr-editor-page #template .qr-template-access{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:900;line-height:1.15;margin-bottom:8px}
.qr-editor-page #template .qr-template-access.is-free{background:#e9f8ef;color:#11763d}
.qr-editor-page #template .qr-template-access.is-premium{background:#fff3d2;color:#8b5c00}
.qr-editor-page #template .qr-template-info small{font-size:11px;line-height:1.35;color:#687386}
.qr-editor-page #template .qr-premium-star{position:absolute;top:8px;right:8px;z-index:12;width:31px;height:31px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#ffd75a,#f29b16);color:#fff;font-size:18px;line-height:1;box-shadow:0 5px 14px rgba(139,92,0,.35);border:2px solid rgba(255,255,255,.9);pointer-events:none}
@media(max-width:575.98px){
 .qr-editor-page #template .qr-template-card{grid-template-columns:minmax(0,1fr) 92px;gap:8px;padding:8px!important}
 .qr-editor-page #template .qr-template-card-name{font-size:14px}
 .qr-editor-page #template .qr-template-info small{font-size:10px}
}

/* Vorlagennamen v3: farbige, abgerundete Markierung passend je Design */
.qr-template-card-name{
  display:inline-flex!important;
  align-items:center;
  max-width:100%;
  padding:6px 11px;
  border:2px solid var(--qr-template-color,#1769aa);
  border-radius:999px;
  color:var(--qr-template-color,#1769aa)!important;
  background:var(--qr-template-tint,#eaf4ff);
  box-shadow:0 0 0 3px rgba(255,255,255,.92),0 4px 12px rgba(23,35,60,.12);
  font-weight:900!important;
  letter-spacing:.01em;
}
.qr-current-template-name{
  border:2px solid #ff8a3d!important;
  border-radius:999px;
  padding:5px 10px!important;
  margin-left:10px!important;
  color:#a94300!important;
  background:#fff1e7;
  box-shadow:0 3px 10px rgba(255,122,31,.16);
}
/* Vorlagen auf der Startseite: Name unter der Vorschau klar sichtbar */
#all .qr-template-card{display:flex!important;flex-direction:column;align-items:stretch;width:min-content!important;padding:8px!important;border:1px solid #e3e8ef;border-radius:14px;background:#fff;box-shadow:0 8px 22px rgba(23,35,60,.08)}
#all .qr-template-preview{position:relative;border-radius:10px;overflow:hidden}
#all .qr-template-info{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:10px 2px 2px;min-width:0}
#all .qr-template-info small{width:100%;color:#687386;font-size:11px}
#all .qr-template-access{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:900;line-height:1.15}
#all .qr-template-access.is-free{background:#e9f8ef;color:#11763d}
#all .qr-template-access.is-premium{background:#fff3d2;color:#8b5c00}
#all .qr-premium-star{position:absolute;top:8px;right:8px;z-index:12;width:31px;height:31px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#ffd75a,#f29b16);color:#fff;font-size:18px;box-shadow:0 5px 14px rgba(139,92,0,.35);border:2px solid #fff;pointer-events:none}
.qr-templates-anchor{scroll-margin-top:95px}
@media(max-width:575.98px){#all .qr-template-card-name{font-size:13px;padding:5px 8px}.qr-current-template-name{font-size:11px!important;padding:4px 7px!important}}
