/* Layout */
.lhe-wrap{
  width: var(--lhe-width, 90%);
  max-width: none;
  margin: 24px auto;
  box-sizing: border-box;
}

/* LHE: im gesamten Editor-Bereich keinerlei Fokusanzeige (auch nicht per Tastatur) */
.lhe-wrap :is(.lhe-editor, .lhe-pass-modal) :is(a, button, input, select, textarea):focus,
.lhe-wrap :is(.lhe-editor, .lhe-pass-modal) :is(a, button, input, select, textarea):focus-visible{
  outline: none !important;
  box-shadow: none !important;
}

/* Firefox: zusätzlicher Innenrahmen bei Buttons entfernen */
.lhe-wrap .lhe-editor button::-moz-focus-inner{
  border: 0 !important;
}

/* Safari/Chrome: WebKit-Focusring entfernen */
.lhe-wrap .lhe-editor :is(a, button, input, select, textarea){
  -webkit-tap-highlight-color: transparent;
}

.lhe-card{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}

.lhe-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid rgba(0,0,0,.08);
  background: linear-gradient(#fbfbfb,#f3f3f3);
}

.lhe-title{
  font:700 13px/1.1 system-ui;
  margin:0;
  color: rgba(0,0,0,.78);
  letter-spacing:.2px;
}

.lhe-toolbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.lhe-view{ display:flex; gap:8px; }

.lhe-toggle{
  appearance:none;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.14);
  font:700 12px/1 system-ui;
  padding:8px 12px;
  cursor:pointer;
  background:#fff;
  color:#111;
}
.lhe-toggle:hover{ background:#f2f2f2; }
.lhe-toggle:focus-visible{ outline:3px solid #0b5fff; outline-offset:2px; }
.lhe-toggle.is-active{ background:#111; color:#fff; border-color:#111; }

.lhe-badges{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.lhe-badge{
  font:600 11px/1 system-ui;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  color: rgba(0,0,0,.70);
}
.lhe-badge.lhe-badge-dirty{ border-color: rgba(0,0,0,.18); }

/* Preview / Canvas */
.lhe-preview-wrap{
  display:flex;
  justify-content:center;
  background:#fff;
  padding: 14px;
  box-sizing: border-box;
}

.lhe-preview{
  width:100%;
  max-width:100%;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  background:#fff;
  display:block;

  /* feste Basishöhe über Variable */
  height: var(--lhe-preview-h, 500px);
  min-height: var(--lhe-preview-h, 500px);
}

.lhe-view-mobile .lhe-preview{
  width:390px;
  max-width:100%;
  height: calc(var(--lhe-preview-h, 560px) + 140px);
  min-height: calc(var(--lhe-preview-h, 560px) + 140px);
}

/* Editor */
.lhe-editor{
  padding: 14px;
  border-top:1px solid rgba(0,0,0,.08);
  background:#fff;
}

.lhe-panels{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width: 860px){
  .lhe-panels{ grid-template-columns:1fr; }
}

.lhe-panel{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.lhe-label{
  font:700 12px/1 system-ui;
  color: rgba(0,0,0,.72);
  letter-spacing:.2px;
  padding: 10px 12px;
  background: linear-gradient(#fbfbfb,#f4f4f4);
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* Code wrapper: gutter + textarea (wie Editor) */
.lhe-code{
  display:grid;
  grid-template-columns: 52px 1fr;
  align-items: stretch;
  height: var(--lhe-editor-h, 320px);
  background: #fbfcfe;
}

.lhe-lines{
  margin:0;
  padding: 12px 10px;
  border-right: 1px solid rgba(0,0,0,.10);
  background: #f2f4f7;
  color: rgba(0,0,0,.45);
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}

.lhe-ta{
  width:100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(0,0,0,.88);
  padding: 12px 14px;
  box-sizing: border-box;
  resize: vertical;
  outline: none;

  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.lhe-ta:focus-visible{
  outline: 3px solid rgba(11,95,255,.25);
  outline-offset: -3px;
  background: rgba(11,95,255,.03);
}

/* Slim Scrollbars (Textarea + Lines) – schwarz wie Buttons */
.lhe-ta, .lhe-lines{
  scrollbar-width: thin;
  scrollbar-color: #111 rgba(0,0,0,.10);
}
.lhe-ta::-webkit-scrollbar,
.lhe-lines::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}
.lhe-ta::-webkit-scrollbar-track,
.lhe-lines::-webkit-scrollbar-track{
  background: rgba(0,0,0,.06);
  border-radius: 999px;
}
.lhe-ta::-webkit-scrollbar-thumb,
.lhe-lines::-webkit-scrollbar-thumb{
  background: #111;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.08);
}
.lhe-ta::-webkit-scrollbar-thumb:hover,
.lhe-lines::-webkit-scrollbar-thumb:hover{
  background: #000;
}

/* Actions */
.lhe-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}
.lhe-actions-spacer{ flex:1 1 auto; }

.lhe-btn{
  appearance:none;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.14);
  font:700 12px/1 system-ui;
  padding:10px 14px;
  cursor:pointer;
  background:#f5f5f5;
  color:#111;
  transition:transform .02s ease, background .15s ease;
}
.lhe-btn:hover{ background:#ededed; }
.lhe-btn:active{ transform:translateY(1px); }
.lhe-btn:focus-visible{ outline:3px solid #0b5fff; outline-offset:2px; }

.lhe-btn-primary{
  background:#111;
  color:#fff;
  border-color:#111;
}
.lhe-btn-primary:hover{ background:#000; }
.lhe-btn-ghost{ background:#fff; }

/* Flash + Errors */
.lhe-flash{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  font:12px/1.35 system-ui;
  color:rgba(0,0,0,.78);
}
.lhe-flash.is-ok{ border-color: rgba(0,0,0,.18); }
.lhe-flash.is-err{ border-color: rgba(0,0,0,.28); }

.lhe-errors{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
}
.lhe-err-title{
  font:800 12px/1.1 system-ui;
  margin:0 0 8px;
  color:rgba(0,0,0,.75);
}
.lhe-err-list{
  margin:0;
  padding-left:18px;
  font:12px/1.45 system-ui;
  color:rgba(0,0,0,.78);
}
.lhe-err-sev{
  display:inline-block;
  font:800 11px/1 system-ui;
  padding:3px 8px;
  border-radius:999px;
  margin-right:6px;
  background:#111;
  color:#fff;
}
.lhe-err-sev-w{ background:#666; }

.lhe-note{
  margin-top:10px;
  font:12px/1.35 system-ui;
  color:rgba(0,0,0,.62);
}

.lhe-status{
  font:12px/1.35 system-ui;
  color:rgba(0,0,0,.62);
  padding:12px 14px;
  border-top:1px solid rgba(0,0,0,.08);
  background:#fff;
}

/* Passwort-Modal (Default speichern) */
.lhe-pass-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
}

.lhe-pass-modal{
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.14);
  box-shadow: 0 18px 45px rgba(0,0,0,.25);
  padding: 14px;
}

.lhe-pass-title{
  font: 800 13px/1.2 system-ui;
  margin: 0 0 8px;
  color: rgba(0,0,0,.86);
}

.lhe-pass-text{
  font: 12px/1.35 system-ui;
  margin: 0 0 10px;
  color: rgba(0,0,0,.72);
}

.lhe-pass-input{
  width: 100%;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 12px;
  padding: 10px 12px;
  font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  box-sizing: border-box;
}

.lhe-pass-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}