/* LubaNote Editor Core V2 – produkční integrační vrstva. */

.modalRichTextV2Host[hidden] {
  display: none !important;
}

.modalRichTextV2Host {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Jediný Core V2 engine vložený přímo do fullscreen editoru LubaNote. */
.ln-v2-core.ln-v2-vlozeny {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent;
}


.ln-v2-core.ln-v2-vlozeny .ln-v2-editor {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 18px 2px 14px;
  box-sizing: border-box;
  background: transparent;
  color: var(--color-editor-text);
  font-family: inherit;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}


.lnV2BridgeToast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 68px);
  z-index: 2147483300;
  transform: translateX(-50%);
  max-width: min(90vw, 480px);
  padding: 9px 13px;
  border: 1px solid var(--color-accent, #8958f6);
  border-radius: 12px;
  background: var(--color-surface, #211b29);
  color: var(--color-text, #fff);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  font-size: 0.75rem;
  font-weight: 650;
  text-align: center;
  pointer-events: none;
}

.lnV2BridgeToast[hidden] {
  display: none !important;
}

.lnV2BridgeToast.chyba {
  border-style: dashed;
}

.taskModal.editorCoreV2Mode #modalTitle[aria-readonly="true"] {
  opacity: .88;
}

.taskModal.editorCoreV2Mode .editorQuickTool.lnV2Mixed {
  border-style: dashed;
}

/* Ovladače Core V2 ve stávajících panelech LubaNote. */
.lnV2OnlyControl {
  display: none !important;
}

.taskModal.editorCoreV2Mode .lnV2OnlyControl {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.lnV2TextColorReset {
  min-width: 42px;
  min-height: 38px;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  background: transparent;
  color: var(--color-editor-text);
  font: inherit;
  font-weight: 700;
}


/* V2.9a – odkazy jsou v editačním DOMu SPAN, ale Bridge je na tap otevře. */
.taskModal.editorCoreV2Mode .ln-v2-odkaz {
  cursor: pointer;
}


/* ========================================
   V2.13 – OŘEZ OBRÁZKU
   Vlastní LubaNote modal; výsledek se zapisuje pouze do V2 modelu.
======================================== */
.lnV2CropModal {
  position: fixed;
  inset: 0;
  z-index: 2147483400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(0, 0, 0, .72);
}

.lnV2CropModal[hidden] {
  display: none !important;
}

.lnV2CropDialog {
  width: min(100%, 760px);
  max-height: 94dvh;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .38);
  overscroll-behavior: contain;
}

.lnV2CropHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.lnV2CropHeader h3 {
  margin: 0;
  font-size: calc(1rem + 0.25rem);
}

.lnV2CropClose {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
}

.lnV2CropHelp,
.lnV2CropStatus {
  color: var(--color-text-secondary);
  font-size: calc(1rem - 0.0625rem);
}

.lnV2CropHelp {
  margin-bottom: 12px;
}

.lnV2CropStage {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #101010;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lnV2CropCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.lnV2CropShade {
  position: absolute;
  z-index: 2;
  background: rgba(0, 0, 0, .55);
  pointer-events: none;
}

.lnV2CropSelection {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset;
  cursor: move;
  touch-action: none;
}

.lnV2CropSelection[hidden] {
  display: none !important;
}

.lnV2CropSelection [data-v2-crop-handle] {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.lnV2CropSelection [data-v2-crop-handle="nw"] { left: -13px; top: -13px; }
.lnV2CropSelection [data-v2-crop-handle="ne"] { right: -13px; top: -13px; }
.lnV2CropSelection [data-v2-crop-handle="sw"] { left: -13px; bottom: -13px; }
.lnV2CropSelection [data-v2-crop-handle="se"] { right: -13px; bottom: -13px; }

.lnV2CropStatus {
  min-height: 22px;
  margin-top: 9px;
  text-align: center;
  font-weight: 700;
}

.lnV2CropActions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.lnV2CropActions > button {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0 !important;
}

@media (max-width: 420px) {
  .lnV2CropDialog {
    padding: 12px;
    border-radius: 16px;
  }
  .lnV2CropActions {
    flex-wrap: wrap;
  }
  .lnV2CropActions > button[data-v2-crop-save] {
    flex-basis: 100%;
  }
}

/* ========================================
   V2.14a – STAV SEZNAMU V TOOLBARU
   Aktivní seznam musí být na první pohled zřejmý i v tématech, kde samotné
   accent pozadí splývá. Typ seznamu zůstává pouze stavem V2 Bridge.
======================================== */
.taskModal.editorCoreV2Mode #tlacitkoBullet.active,
.taskModal.editorCoreV2Mode #tlacitkoBullet[aria-pressed="true"] {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 1px currentColor;
}

.taskModal.editorCoreV2Mode #tlacitkoBullet.lnV2Mixed {
  outline-style: dashed;
}


/* V2.14b – typ seznamu se vybírá přímo v kompaktním toolbar popupu,
   stejně jako H1/H2/H3 nebo zarovnání. Žádný samostatný modal. */
.taskModal.editorCoreV2Mode .editorToolbarPanelSeznam {
  width: auto;
  min-width: 164px;
  justify-content: center;
}

.taskModal.editorCoreV2Mode .editorToolbarPanelSeznam .editorPanelSeznamVolba {
  min-width: 46px;
  font-size: 1.1875rem;
}

.taskModal.editorCoreV2Mode .editorToolbarPanelSeznam .editorPanelSeznamText {
  min-width: 58px;
  font-size: 0.9375rem;
}
