.pn-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 420px;
  height: 100%;
  background: var(--pn-bg, #f7f7f8);
  color: var(--pn-text, #111);
  border-radius: 12px;
  overflow: hidden;
  /* iOS: kein Textauswahl-/Callout-Menü beim Auflegen der Handfläche */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Eingabefelder/Notizen bleiben auswählbar und bearbeitbar */
.pn-quick-note textarea,
.pn-field input,
.pn-field select,
.pn-field textarea,
.pn-transcript {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.pn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: var(--pn-toolbar-bg, #fff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pn-tool-btn,
.pn-color-btn,
.pn-size-btn,
.pn-action-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: inherit;
  border-radius: 10px;
  min-height: 36px;
  min-width: 36px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.pn-tool-btn[aria-pressed="true"],
.pn-color-btn[aria-pressed="true"],
.pn-size-btn[aria-pressed="true"] {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.pn-palm-btn[aria-pressed="true"] {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.pn-color-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 999px;
}

.pn-toolbar-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pn-toolbar-spacer {
  flex: 1;
}

.pn-workspace {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  background: #fff;
  touch-action: none;
}

.pn-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  touch-action: none;
  isolation: isolate;
}

.pn-quick-note {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pn-quick-note label {
  color: #555;
  font-size: 12px;
  font-weight: 800;
}

.pn-quick-note textarea {
  width: 100%;
  min-height: 44px;
  max-height: 72px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

.pn-pdf-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: auto;
  pointer-events: none;
  background: #fff;
}

.pn-root.pn-has-pdf .pn-workspace {
  overflow: hidden;
}

.pn-root.pn-has-pdf .pn-stage {
  display: block;
  height: auto;
}

.pn-root.pn-has-pdf .pn-pdf-bg {
  position: relative;
  inset: auto;
  overflow: visible;
  padding: 0;
}

.pn-pdf-bg canvas {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.pn-free-area,
.pn-form-area {
  position: relative;
  z-index: 0;
}

.pn-free-area::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pn-root.pn-has-pdf .pn-free-area {
  height: min(900px, 72vh);
  min-height: 520px;
  border-top: 1px dashed rgba(0, 0, 0, 0.14);
  border-bottom: none;
  background: transparent;
}

.pn-root.pn-has-pdf .pn-free-area::before {
  background:
    linear-gradient(#f1f5f9 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, #f1f5f9 1px, transparent 1px) 0 0 / 22px 22px,
    #fff;
}

.pn-root.pn-has-pdf .pn-form-area {
  display: none;
}

.pn-root.pn-has-pdf.pn-show-form .pn-form-area {
  display: block;
  max-height: 38%;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

.pn-root.pn-has-pdf.pn-show-form .pn-free-area {
  flex: 0 0 58%;
}

.pn-free-area {
  position: relative;
  flex: 0 0 var(--pn-free-ratio, 42%);
  min-height: 120px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  background: transparent;
}

.pn-free-area::before {
  background:
    linear-gradient(#fafafa 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, #fafafa 1px, transparent 1px) 0 0 / 20px 20px,
    #fff;
}

.pn-form-area {
  flex: 1;
  overflow: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.pn-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.pn-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pn-field.full {
  grid-column: 1 / -1;
}

.pn-field label {
  font-size: 12px;
  font-weight: 700;
  color: #555;
}

.pn-field input,
.pn-field select,
.pn-field textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.pn-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
  touch-action: none;
  cursor: crosshair;
}

/* Tipp-/Text-Ebene über dem Canvas (Tastatureingabe auf dem Protokoll) */
.pn-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 21;
  pointer-events: none;
}

.pn-text-box {
  position: absolute;
  pointer-events: auto;
  min-width: 60px;
  max-width: 70%;
  margin: 0;
  padding: 2px 4px;
  border: 1px dashed rgba(37, 99, 235, 0.5);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-weight: 600;
  line-height: 1.25;
  resize: none;
  overflow: hidden;
  touch-action: auto;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.pn-text-box:focus {
  outline: none;
  background: #fff;
  border-color: #2563eb;
}

.pn-footer-spacer {
  flex: 1;
}

/* Medien-Ebene: Bilder sind interaktiv, Tinte liegt visuell darüber. */
.pn-media-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
}

.pn-media-img {
  position: absolute;
  display: block;
  max-width: none;
  border-radius: 4px;
  pointer-events: none;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.pn-root[data-tool="select"][data-select-layer="image"] .pn-media-img {
  pointer-events: auto;
  cursor: move;
}

.pn-select-layer-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 2px solid rgba(37, 99, 235, 0.28);
  border-left: 0;
  border-right: 0;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 800;
  color: #1e3a8a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pn-select-layer-toggle[hidden] {
  display: none;
}

.pn-select-layer-toggle .pn-action-btn[aria-pressed="true"] {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

/* Auswahl-Kontextmenü (Lasso) */
.pn-select-menu {
  position: absolute;
  z-index: 16;
  display: flex;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  padding: 5px 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.pn-select-menu[hidden] {
  display: none;
}

.pn-select-menu .pn-sel-del {
  color: #dc2626;
}

/* Cursor je nach Werkzeug */
.pn-root .pn-stage { cursor: crosshair; }
.pn-root[data-tool="hand"] .pn-stage { cursor: grab; }
.pn-root[data-tool="select"] .pn-stage { cursor: crosshair; }
.pn-root[data-tool="text"] .pn-stage { cursor: text; }

html.theme-dark .pn-select-menu {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f7;
}

html.theme-dark .pn-select-layer-toggle {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

/* Toolbox (Werkzeuge ein-/ausblenden) */
.pn-toolbox {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}
.pn-toolbox[hidden] { display: none; }
.pn-toolbox-card {
  background: #fff;
  color: #111;
  border-radius: 14px;
  padding: 14px 16px;
  width: min(360px, 90%);
  max-height: 80%;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.pn-toolbox-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pn-toolbox-hint { font-size: 12px; color: #6b7280; margin: 0 0 10px; }
.pn-toolbox-list { display: flex; flex-direction: column; gap: 4px; }
.pn-toolbox-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.pn-toolbox-row input { width: 18px; height: 18px; }

/* Bild-Bearbeitung (verschieben/skalieren/zuschneiden) */
.pn-img-handles { position: absolute; z-index: 22; pointer-events: none; }
.pn-img-frame { position: absolute; inset: 0; border: 1.5px dashed #2563eb; border-radius: 4px; }
.pn-img-grip {
  position: absolute; right: -9px; bottom: -9px; width: 20px; height: 20px;
  border-radius: 50%; background: #2563eb; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); pointer-events: auto; cursor: nwse-resize; touch-action: none;
}
.pn-img-toolbar { position: absolute; left: 0; top: -42px; display: flex; gap: 6px; pointer-events: auto; }
.pn-img-crop {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: #16a34a; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); pointer-events: auto; touch-action: none;
}

html.theme-dark .pn-toolbox-card { background: #1c1c1e; color: #f5f5f7; }
html.theme-dark .pn-toolbox-hint { color: #9ca3af; }

.pn-root.pn-has-pdf .pn-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
}

.pn-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.pn-page-select {
  flex: 1;
  min-width: 140px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

.pn-status {
  font-size: 12px;
  color: #666;
  min-width: 80px;
  text-align: right;
}

.pn-sync-status {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.pn-status.is-saving { color: #2563eb; }
.pn-status.is-error { color: #dc2626; }
.pn-status.is-ok { color: #15803d; }

.pn-audio-panel {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.pn-audio-player {
  width: 100%;
  min-width: 0;
}

.pn-audio-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.pn-audio-item,
.pn-word {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f8fafc;
  color: inherit;
  border-radius: 999px;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.pn-transcript {
  grid-column: 1 / -1;
  color: #444;
  font-size: 13px;
  line-height: 1.5;
}

.pn-transcript-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pn-transcript-title {
  font-size: 12px;
  font-weight: 800;
  color: #111;
  flex: 1;
}

.pn-transcript-text {
  max-height: 140px;
  overflow-y: auto;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  -webkit-user-select: text;
  user-select: text;
}

.pn-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.pn-modal-backdrop.is-open {
  display: flex;
}

.pn-modal-shell {
  width: min(1100px, 100%);
  height: 100%;
  max-height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

#orderDetailModal .modal-content.detail-notes-open {
  width: min(1180px, calc(100vw - 28px));
  max-width: min(1180px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(520px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 14px;
}

#orderDetailModal .modal-content.detail-notes-open .modal-header {
  grid-column: 1 / -1;
}

#orderDetailModal .modal-content.detail-notes-open #orderDetailForm {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.detail-notes-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  padding-left: 14px;
}

.detail-notes-side[hidden] {
  display: none;
}

.detail-notes-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px;
}

.detail-notes-mount {
  flex: 1;
  min-height: 0;
}

.detail-notes-mount .pn-root {
  height: 100%;
  min-height: 680px;
}

.pn-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pn-modal-head h3 {
  margin: 0;
  font-size: 16px;
  flex: 1;
}

.pn-modal-body {
  flex: 1;
  min-height: 0;
  padding: 10px;
}

.pn-modal-close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.m-detail-panel[data-panel="notes"] {
  min-height: 420px;
}

.m-detail-panel[data-panel="notes"] .pn-root {
  min-height: 52vh;
}

@media (min-width: 900px) {
  .pn-modal-shell {
    margin: 12px;
    height: calc(100% - 24px);
    border-radius: 16px;
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  #orderDetailModal .modal-content.detail-notes-open {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px) !important;
  }

  .detail-notes-side {
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-left: 0;
    padding-top: 12px;
  }
}

html.theme-dark .pn-root,
html.theme-dark .pn-toolbar,
html.theme-dark .pn-workspace,
html.theme-dark .pn-footer,
html.theme-dark .pn-modal-shell {
  --pn-bg: #1c1c1e;
  --pn-toolbar-bg: #2c2c2e;
  --pn-text: #f5f5f7;
  background: #1c1c1e;
  color: #f5f5f7;
}

html.theme-dark .pn-field input,
html.theme-dark .pn-field select,
html.theme-dark .pn-field textarea,
html.theme-dark .pn-tool-btn,
html.theme-dark .pn-page-select {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

html.theme-dark .pn-audio-panel {
  background: #1c1c1e;
  border-top-color: rgba(255, 255, 255, 0.12);
}

html.theme-dark .pn-audio-item,
html.theme-dark .pn-word {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

/* ===== Auftrags-Modal: Karten-Layout (linke Spalte) ===== */
.detail-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.detail-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-card-icon {
  font-size: 16px;
  line-height: 1;
  flex: none;
}

.detail-card-title {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

.detail-card--summary {
  background: #fffaf0;
  border-color: rgba(230, 126, 34, 0.25);
}

.detail-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.detail-ov-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.detail-ov-ic {
  font-size: 17px;
  line-height: 1.1;
  flex: none;
}

.detail-ov-body {
  min-width: 0;
}

.detail-ov-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detail-ov-val {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

.detail-ov-instructions {
  margin-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 10px;
}

.detail-ov-instr-text {
  margin-top: 4px;
  font-size: 14px;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-card--actions .modal-actions {
  margin: 0;
  border-top: none;
  padding-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-card--actions .modal-actions .btn {
  flex: 1 1 auto;
}

/* ===== "Mehr Details"-Toggle + einklappbare Felder ===== */
.detail-toggle-fields {
  display: block;
  width: 100%;
  text-align: left;
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin: 12px 0;
}

.detail-edit-fields.is-collapsed {
  display: none;
}

/* ===== Gesprächsverlauf ===== */
.detail-conversation {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.detail-conv-summary {
  background: #fffaf0;
  border: 1px solid rgba(230, 126, 34, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
}

.detail-conv-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.detail-conv-bullets {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}

.detail-conv-bullets .detail-conv-empty {
  list-style: none;
  margin-left: -18px;
  color: #6b7280;
}

.detail-conv-head {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.detail-conv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.detail-conv-empty {
  color: #6b7280;
  font-size: 13px;
  padding: 6px 2px;
}

.detail-conv-item {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.detail-conv-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.detail-conv-date {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

.detail-conv-src {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff4ff;
  border-radius: 999px;
  padding: 1px 7px;
}

.detail-conv-del {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.detail-conv-del:hover {
  color: #dc2626;
}

.detail-conv-text {
  font-size: 14px;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-conv-add {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.detail-conv-add textarea {
  flex: 1;
  min-height: 42px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

.detail-notes-side-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== Vollbild des gesamten Auftrags-Modals ===== */
#orderDetailModal .modal-content.detail-notes-open.detail-fullscreen {
  width: calc(100vw - 12px);
  max-width: calc(100vw - 12px) !important;
  height: calc(100vh - 12px);
  max-height: calc(100vh - 12px);
  grid-template-columns: minmax(320px, 400px) minmax(560px, 1fr);
}

/* ===== PDF-Only-Vollbild des Schichtprotokolls ===== */
body.pn-pdf-fullscreen {
  overflow: hidden;
}

.detail-notes-mount.pn-pdf-fullscreen-mount {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #fff;
  margin: 0;
  padding: 0;
}

.detail-notes-mount.pn-pdf-fullscreen-mount .pn-root {
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
}

.pn-pdf-fullscreen-mount .pn-quick-note,
.pn-pdf-fullscreen-mount .pn-footer,
.pn-pdf-fullscreen-mount .pn-audio-panel {
  display: none;
}

.pn-pdf-fullscreen-mount .pn-workspace {
  flex: 1;
  min-height: 0;
}

.pn-pdf-fs-exit {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 4100;
  border: none;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

html.theme-dark .detail-card {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.12);
}

html.theme-dark .detail-card-title,
html.theme-dark .detail-ov-val,
html.theme-dark .detail-ov-instr-text,
html.theme-dark .detail-conv-text {
  color: #e5e7eb;
}

html.theme-dark .detail-card--summary {
  background: #2a2418;
  border-color: rgba(230, 126, 34, 0.3);
}

html.theme-dark .detail-conv-item,
html.theme-dark .detail-conv-add textarea {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

html.theme-dark .detail-toggle-fields {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

/* ===== Seitenübersicht (Notability-artig) ===== */
.pn-root { position: relative; }

.pn-pages-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 188px;
  background: var(--pn-toolbar-bg, #fff);
  color: var(--pn-text, #111);
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: -6px 0 16px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.18s ease;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pn-root.pn-pages-open .pn-pages-panel {
  transform: translateX(0);
}

.pn-pages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 14px;
}

.pn-pages-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pn-page-thumb {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  cursor: pointer;
  text-align: left;
}

.pn-page-thumb.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4);
}

.pn-page-thumb-canvas {
  width: 100%;
  height: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  background: #fff;
  display: block;
}

.pn-page-thumb-label {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pn-page-add {
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font-weight: 700;
  color: #2563eb;
  border-style: dashed;
  width: 100%;
}

.pn-page-add-box {
  display: grid;
  gap: 8px;
}

.pn-page-protocol-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 8px;
  background: rgba(22, 163, 74, 0.07);
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pn-page-protocol-option input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
}

.pn-pages-empty {
  color: #6b7280;
  font-size: 12px;
  padding: 8px;
}

html.theme-dark .pn-page-thumb,
html.theme-dark .pn-page-thumb-canvas {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.14);
}

html.theme-dark .pn-page-thumb-label {
  color: #e5e7eb;
}

html.theme-dark .pn-page-protocol-option {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(74, 222, 128, 0.28);
  color: #bbf7d0;
}
