/* Initiale im Korrektur-Modus neutralisieren für sauberen Zeilen-Satz */
.orig-article.is-line-editor::first-letter {
  float: none !important;
  font-size: inherit !important;
  line-height: inherit !important;
  padding: 0 !important;
  color: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
}
.orig-article.is-line-editor {
  white-space: normal;
  text-align: left;
}

/* Editierbare Überschriften (Modal & Karten) */
.editable-field {
  border-radius: 2px;
  transition: background 0.12s, box-shadow 0.12s;
}
body.edit-mode-active .editable-field:hover {
  background: #f8f0dc;
  box-shadow: 0 0 0 1px dashed #b99d6b;
  cursor: text;
}
.editable-field:focus {
  outline: none;
  background: #fffdf5 !important;
  box-shadow: 0 0 0 2px var(--crimson) !important;
  padding: 2px 5px;
}
.editable-field.is-dirty {
  background: #f3f9ee;
  border-left: 3px solid #2b7a3d;
  padding-left: 6px;
}

/* Klickbare Einzelzeilen der Transkription */
.ocr-line {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: baseline;
  gap: 6px;
  padding: 2px 4px;
  border-bottom: 1px dashed #eee6d8;
  border-left: 3px solid transparent;
}
.ocr-line.para-end {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #dfd4c0;
}
.ocr-line:hover {
  background: #f7efe0;
}
.ocr-line:focus-within {
  background: #fffdf4;
  border-left-color: var(--crimson);
}
.ocr-line.is-dirty {
  background: #eef8ea;
  border-left-color: #2b7a3d;
}
.line-no {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: #968b7c;
  text-align: right;
  user-select: none;
}
.line-text {
  outline: none;
  min-height: 1.4em;
  cursor: text;
  padding: 1px 3px;
  word-break: break-word;
}
.line-text:empty::before {
  content: "[Zeile geleert – wird beim Speichern entfernt]";
  color: #a65e5a;
  font-style: italic;
  font-size: 0.9rem;
}
.line-undo {
  visibility: hidden;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0 4px;
}
.ocr-line.is-dirty .line-undo { visibility: visible; }
.line-undo:hover { color: var(--crimson); }

.card-dirty-pill {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 700;
  background: #2b7a3d;
  color: #fff;
  padding: 1px 6px;
  border-radius: 2px;
  margin-bottom: 4px;
  align-self: flex-start;
}

/* Schwebendes Sammel-Dock unten */
.editor-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e1b18;
  color: #f6f1e7;
  border-top: 3px solid var(--crimson);
  padding: 0.65rem 1.4rem;
  z-index: 1100;
  display: none;
  font-family: var(--font-sans);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.28);
}
body.edit-mode-active .editor-dock {
  display: block;
}
body.edit-mode-active {
  padding-bottom: 70px;
}
.editor-dock-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}
.dock-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
}
.dock-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #575047;
  background: #2e2924;
  color: #fff;
}
.dock-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.dock-btn-send { background: #b86b11; border-color: #d4831f; }
.dock-btn-commit { background: #1e6b38; border-color: #298a4a; }

/* Tabellen-Prüfdialog vor Live-DB-Schreiben */
.staged-dialog {
  background: var(--paper-card);
  width: min(1100px, 100%);
  max-height: 86vh;
  border: 1px solid var(--ink);
  border-top: 4px solid #1e6b38;
  padding: 1.4rem 1.8rem;
  overflow-y: auto;
  font-family: var(--font-sans);
}
.staged-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.8rem;
}
.staged-table th, .staged-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.diff-old { color: #8c1d18; text-decoration: line-through; font-size: 0.77rem; display: block; }
.diff-new { color: #1e6b38; font-weight: 600; display: block; }
