/* Szenenwerkstatt Styling - Hochwertig, ruhig, taktil */

.workshop-bar {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100vw - 32px));
  background: #fffdf8fa;
  border: 1px solid #d4ded0;
  border-radius: 18px;
  box-shadow: 0 12px 42px rgba(35, 55, 42, 0.14);
  backdrop-filter: blur(14px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px;
  color: #273b30;
  transition: all 0.2s ease;
}

.workshop-bar.collapsed {
  width: auto;
  padding: 6px 14px;
}

.workshop-bar.collapsed .workshop-timeline,
.workshop-bar.collapsed .workshop-moment-bar,
.workshop-bar.collapsed .workshop-inspector {
  display: none !important;
}

.workshop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.workshop-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.workshop-title-badge .tag {
  background: #e5ede3;
  color: #2e4d3a;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.workshop-title-badge strong {
  font-family: Georgia, serif;
  font-size: 15px;
  color: #1f3629;
}

.workshop-status {
  font-size: 11px;
  color: #6a7c6f;
  display: flex;
  align-items: center;
  gap: 5px;
}

.workshop-status.unsaved {
  color: #b05a2e;
}

.workshop-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #47805d;
}

.workshop-status.unsaved .workshop-status-dot {
  background: #d46c37;
}

.workshop-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workshop-actions button,
.workshop-moment-bar button {
  background: #f1f4ed;
  border: 1px solid #d0daca;
  color: #2b4435;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.workshop-actions button:hover,
.workshop-moment-bar button:hover {
  background: #e4ebe0;
  border-color: #bccab4;
}

.workshop-actions button.primary,
.workshop-moment-bar button.primary {
  background: #3a5c48;
  color: #fffdf8;
  border-color: #2f4b3a;
}

.workshop-actions button.primary:hover,
.workshop-moment-bar button.primary:hover {
  background: #2f4e3c;
}

.workshop-actions button.icon-only {
  padding: 5px 8px;
  font-size: 14px;
}

/* Timeline & Graph Visualizer */
.workshop-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 8px;
  scrollbar-width: thin;
}

.timeline-branch-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(230, 238, 227, 0.45);
  border: 1px dashed #cad5c4;
  border-radius: 12px;
  padding: 4px 8px;
}

.timeline-branch-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #556c5c;
  letter-spacing: 0.05em;
  padding: 0 4px;
}

.timeline-node {
  position: relative;
  min-width: 90px;
  max-width: 150px;
  background: #fff;
  border: 1.5px solid #d3ddce;
  border-radius: 10px;
  padding: 6px 9px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.timeline-node:hover {
  border-color: #7d9b85;
  transform: translateY(-1px);
}

.timeline-node.active {
  background: #eef5ec;
  border-color: #3b604a;
  box-shadow: 0 0 0 2px #3b604a33;
}

.timeline-node-step {
  font-size: 9px;
  font-weight: 700;
  color: #587462;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.timeline-node-title {
  font-size: 11px;
  font-weight: 600;
  color: #1f3528;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-node-phase {
  font-size: 9px;
  color: #798b7d;
  margin-top: 2px;
}

.timeline-connector {
  color: #8c9e8f;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}

.timeline-fork-badge {
  background: #fbf3e4;
  border: 1px solid #e5d1b3;
  color: #8a571e;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Moment Action Bar */
.workshop-moment-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #e5ede0;
  padding-top: 6px;
}

.moment-bar-left, .moment-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.moment-impact-toast {
  font-size: 11px;
  background: #eaf4eb;
  color: #2b5638;
  border: 1px solid #bcdbc0;
  padding: 3px 8px;
  border-radius: 6px;
  animation: fadeIn 0.2s ease;
}

/* Moment Inspector (Collapsible) */
.workshop-inspector {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  background: #fbfdf9;
  border: 1px solid #e1ebdc;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 4px;
}

.workshop-inspector label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #3b5243;
}

.workshop-inspector input,
.workshop-inspector select,
.workshop-inspector textarea {
  border: 1px solid #ccd8c7;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  background: #fff;
  color: #223328;
  font-family: inherit;
}

.workshop-inspector textarea {
  resize: vertical;
  min-height: 44px;
}

/* Modal Dialogs */
.workshop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 30, 22, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.workshop-modal-card {
  background: #fffdf8;
  border: 1px solid #cfd9cb;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(20, 36, 26, 0.22);
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #23382c;
}

.workshop-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5ede2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workshop-modal-header h3 {
  margin: 0;
  font: 20px Georgia, serif;
  color: #1a3225;
}

.workshop-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.workshop-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e5ede2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f9fbf7;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #d5decfee;
  border-radius: 12px;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.draft-item:hover {
  background: #f4f8f1;
  border-color: #9eb6a3;
}

.draft-item-info strong {
  display: block;
  font-size: 14px;
  color: #1c3326;
}

.draft-item-info span {
  font-size: 11px;
  color: #6a7c6f;
}

.draft-item-actions {
  display: flex;
  gap: 6px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .workshop-bar {
    top: 60px;
    width: calc(100vw - 16px);
    padding: 8px 10px;
  }
  .workshop-inspector {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Werkstatt: Exkurs-Timeline & Seitenäste
   ========================================================================== */

.timeline-excursion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #f1f7ef;
  border: 1.5px solid #82a88a;
  border-radius: 10px;
  padding: 6px 12px;
  margin-bottom: 6px;
  gap: 10px;
}

.excursion-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.excursion-banner-badge {
  background: #345840;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.excursion-banner-sub {
  color: #556c5e;
  font-size: 11px;
}

.excursion-banner-exit {
  background: #fff !important;
  border: 1px solid #7ea387 !important;
  color: #274330 !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.excursion-banner-exit:hover {
  background: #e3ede0 !important;
  border-color: #52805c !important;
}

.timeline-node-excursions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}

.timeline-exc-pill {
  font-size: 9px;
  font-weight: 600;
  background: #f7faf5;
  border: 1px dashed #7ea387;
  color: #274330;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  transition: all 0.15s ease;
}

.timeline-exc-pill:hover {
  background: #e4efe0;
  border-color: #3b604a;
  transform: translateY(-1px);
}

.timeline-node.timeline-node-anchor {
  background: #fbf5ea;
  border-color: #d1b78c;
  color: #5c431b;
}

.timeline-node.timeline-node-anchor .timeline-node-step {
  color: #8c682a;
}

.timeline-node.timeline-node-anchor:hover {
  background: #f5ebd3;
  border-color: #8c682a;
  transform: translateY(-1px);
}

.timeline-node.timeline-node-excursion {
  border-style: dashed;
  background: #fbfdf9;
}

.timeline-connector.is-dashed-left {
  color: #728c78;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -1px;
  user-select: none;
}




/* Scene workshop is an overlay tool, not a second header.
   Dock the sequence rail at the bottom and reserve actual measured height
   for zoom/status/inspectors so mode switches cannot bury the controls. */
body.is-workshop-active .workshop-bar {
  top: auto;
  bottom: 12px;
  width: min(1120px, calc(100vw - 24px));
  max-height: min(46dvh, 400px);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 14;
  background: #f8f4ebfa;
}
body.is-workshop-active .bottom { display: none !important; }
body.is-workshop-active:not(.is-genogram) .zoom {
  bottom: calc(var(--workshop-dock-height, 180px) + 26px);
}
body.is-workshop-active:not(.is-genogram) .panel {
  bottom: calc(var(--workshop-dock-height, 180px) + 26px);
}
body.is-workshop-active:not(.is-genogram) #status {
  bottom: calc(var(--workshop-dock-height, 180px) + 7px);
}
@media (max-width: 768px) {
  body.is-workshop-active .workshop-bar {
    top: auto;
    bottom: 8px;
    max-height: 43dvh;
    width: calc(100vw - 12px);
  }
  body.is-workshop-active:not(.is-genogram) .panel {
    top: 95px;
    bottom: calc(var(--workshop-dock-height, 180px) + 23px);
    max-height: unset;
    width: calc(100vw - 16px);
  }
}
