/* KI-/Pruefhinweise gehoeren nicht in das eigentliche Druckbild. */
#belegPreviewShell {
  position: relative;
}

#belegPreviewShell .xcraft-ai-position-badge,
#belegPreviewShell .beleg-ai-origin-chip,
#belegPreviewShell .beleg-ai-origin-chip-direct {
  display: none !important;
}


.beleg-ai-origin-chip {
  position: absolute;
  left: -8px;
  top: 2px;
  transform: translateX(-100%);
  z-index: 3;
  min-width: 28px;
  box-sizing: border-box;
  border: 1px solid rgba(6, 63, 108, .28);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, .98);
  color: var(--kk-blue, #063F6C);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
  font-family: inherit;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.beleg-ai-origin-chip::before {
  content: '✦';
  margin-right: 4px;
  color: var(--kk-orange, #F28C18);
}

.beleg-ai-origin-chip.is-review {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.beleg-ai-origin-chip.is-review::before {
  content: '!';
  color: #c2410c;
}

@media (max-width: 900px) {
  .beleg-ai-origin-chip {
    left: 3px;
    top: 3px;
    transform: none;
    min-width: 24px;
    padding: 2px 5px;
    font-size: 8px;
  }
}

@media print {
  .beleg-ai-origin-chip {
    display: none !important;
  }
}

.xcraft-ai-position-annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 260;
}

.xcraft-ai-position-annotation {
  position: absolute;
  min-height: 22px;
  max-width: 108px;
  box-sizing: border-box;
  border: 1px solid rgba(6, 63, 108, .22);
  border-radius: 999px;
  padding: 3px 7px 3px 18px;
  background: rgba(6, 63, 108, .07);
  color: var(--kk-blue, #063F6C);
  box-shadow: 0 3px 10px rgba(6, 63, 108, .14);
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
  pointer-events: auto;
  transform: none;
}

.xcraft-ai-position-annotation::before {
  content: '✦';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  line-height: 1;
}

.xcraft-ai-position-annotation.is-review {
  border-color: #fed7aa;
  background: rgba(255, 247, 237, 0.97);
  color: #c2410c;
  box-shadow: 0 3px 10px rgba(194, 65, 12, 0.13);
}

.xcraft-ai-position-annotation.is-review::before {
  content: '!';
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #c2410c;
  color: #fff;
  font-size: 7px;
}

.xcraft-ai-position-annotation.is-compact {
  max-width: 50px;
  min-height: 20px;
  padding: 2px 5px 2px 16px;
  font-size: 8.5px;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.12);
}

.xcraft-ai-position-annotation.is-outside {
  transform: translateX(-100%);
}

.xcraft-ai-position-annotation:hover,
.xcraft-ai-position-annotation:focus-visible {
  z-index: 2;
  outline: none;
  filter: brightness(0.985);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
}

.xcraft-ai-position-annotation-popover {
  position: fixed;
  z-index: 9600;
  width: min(248px, calc(100vw - 16px));
  box-sizing: border-box;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 11px 12px 10px;
  background: rgba(255, 255, 255, 0.99);
  color: #1e293b;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
}

.xcraft-ai-position-annotation-popover-title {
  color: var(--kk-blue, #063F6C);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.xcraft-ai-position-annotation-popover-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.xcraft-ai-position-annotation-popover-tags span {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(6, 63, 108, .07);
  color: var(--kk-blue, #063F6C);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.xcraft-ai-position-annotation-popover-tags span.is-review {
  background: #fff7ed;
  color: #c2410c;
}

.xcraft-ai-position-annotation-popover-note {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
  color: #475569;
  font-size: 11px;
  line-height: 1.4;
}

.xcraft-ai-position-annotation-popover-footer {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid #eef2f7;
  color: #94a3b8;
  font-size: 9px;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .xcraft-ai-position-annotation {
    max-width: 44px;
    min-height: 19px;
    padding: 2px 4px 2px 15px;
    font-size: 8px;
  }
}

@media print {
  .xcraft-ai-position-annotation-layer,
  .xcraft-ai-position-annotation-popover,
  #belegPreviewShell .xcraft-ai-position-badge {
    display: none !important;
  }
}

.xcraft-ai-position-annotation:not(.is-review)::before,
.xcraft-ai-position-annotation-popover-title {
  color: var(--kk-orange, #F28C18);
}

/* Eine feste Hinweis-Spalte außerhalb des Blattes, auch bei Breitenzoom. */
#belegPreviewShell.beleg-preview-shell-large {
  padding-left: 132px;
}


/* Position information shares the editor's right-hand workspace. */
#beleg-single-root.xcraft-insert-sources-ready #belegPreviewShell.beleg-preview-shell-large{padding-left:12px}
#beleg-single-root #belegAiSidebar{
 position:absolute;inset:64px 0 0 auto;z-index:55;display:flex;flex-direction:column;
 width:var(--xcraft-catalog-width,520px);max-width:100%;min-height:0;box-sizing:border-box;
 background:#f5f7fa;border-left:1px solid #d9e2ea;box-shadow:-14px 0 34px rgba(15,23,42,.15);
}
#beleg-single-root #belegAiSidebar[hidden],#beleg-single-root #belegAiSidebarButton[hidden]{display:none!important}
.beleg-ai-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;border-bottom:1px solid #d9e2ea;color:#063f6c}
.beleg-ai-sidebar-list{flex:1;min-height:0;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px}
.beleg-ai-sidebar-entry{flex:0 0 auto;display:flex;flex-direction:column;gap:6px;width:100%;box-sizing:border-box;text-align:left;border:1px solid #d9e2ea;border-radius:5px;background:#fff;color:#334155;padding:12px;font:inherit;cursor:pointer;overflow-wrap:anywhere}
.beleg-ai-sidebar-entry strong{color:#063f6c}
.beleg-ai-sidebar-entry span{white-space:pre-line;font-size:12px;line-height:1.45}
.beleg-ai-sidebar-entry.is-review{border-left:3px solid #f28c18}
.beleg-ai-sidebar-entry:hover{background:#f0f5f8}
.beleg-ai-sidebar-entry:focus-visible{outline:2px solid #063f6c;outline-offset:1px}
@media print{#belegAiSidebar,#belegAiSidebarButton{display:none!important}}


.beleg-ai-review-progress{color:#475569;font-size:12px;line-height:1.5}
.beleg-ai-review-check{display:flex;align-items:center;gap:7px;margin-top:5px;cursor:pointer}
.beleg-ai-review-check input{width:16px;height:16px;margin:0;accent-color:#063f6c}
.beleg-ai-review-check:has(input:disabled){cursor:default}
.beleg-ai-sidebar-entry.is-checked{border-left:3px solid #15803d;background:#f0fdf4}
.beleg-ai-sidebar-entry .beleg-ai-review-error{color:#b91c1c}
