/* Workflow-Viewer — eigene Styles über Dashboard-Layer.
 * Nutzt Tokens aus tokens.css (siehe Design-Handover). */

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: #F4F4F2;
  color: var(--c-text-strong);
  font-family: var(--ff-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.boot {
  padding: 48px 0;
  color: var(--c-text-hint);
  font-size: 14px;
}

.preview-banner {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--c-text-strong);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 240px;
  line-height: 1.4;
}
.preview-banner b {
  color: var(--c-cyan);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
  display: block;
  margin-bottom: 4px;
}
.preview-banner code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
}

.wv-banner {
  background: var(--c-pending-bg);
  border: 1px solid #F0D88E;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text-strong);
}
.wv-banner strong {
  font-weight: 700;
  margin-right: 4px;
}
.wv-banner code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

.wv-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 16px;
}

.wv-actions--idle {
  justify-content: center;
  color: var(--c-text-hint);
  font-size: 12px;
  background: var(--c-neutral-bg);
  padding: 12px 16px;
  border-radius: 8px;
}
.wv-actions--idle code,
.wv-actions--idle em {
  font-style: normal;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--c-text-strong);
}

.wv-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c-blue);
  color: #fff;
  border: none;
  padding: 12px 18px;
  font-family: var(--ff-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: filter 120ms ease, transform 120ms ease;
}
.wv-start-btn:hover {
  filter: brightness(1.06);
}
.wv-start-btn:active {
  transform: translateY(1px);
}
.wv-start-btn__skill {
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0;
}

.pcard__skill-artifact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1;
  color: var(--c-blue);
  text-decoration: none;
  border-radius: 3px;
  transition: background 120ms ease;
}
.pcard__skill-artifact:hover {
  background: rgba(77, 151, 254, 0.12);
  text-decoration: none;
}

.pcard__skill-score {
  display: inline-flex;
  align-items: baseline;
  margin-left: 6px;
  padding: 2px 7px;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-text-strong);
  background: var(--c-neutral-bg, #f4f4f2);
  border: 1px solid var(--c-border, #e5e5e2);
  border-radius: 3px;
  line-height: 1.2;
}
.pcard__skill-score .sep {
  margin: 0 1px;
  opacity: 0.4;
  font-weight: 400;
}

.pcard__gate-passed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-blue);
  letter-spacing: 0.02em;
}
.pcard__gate-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-blue);
  color: #fff;
  font-size: 9px;
  line-height: 1;
}
.pcard__gate-passed-at {
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--c-text-hint, #8a8a82);
  font-weight: 500;
}

/* ---- Toolbar ---- */
.wv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--c-border, #e5e5e2);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.wv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--ff-text);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 120ms ease, background 120ms ease;
}
.wv-btn--primary {
  background: var(--c-blue);
  color: #fff;
}
.wv-btn--primary:hover { filter: brightness(1.06); }
.wv-btn--ghost {
  background: var(--c-neutral-bg, #f4f4f2);
  color: var(--c-text-strong);
  border-color: var(--c-border, #e5e5e2);
}
.wv-btn--ghost:hover { background: rgba(0,0,0,0.04); }
.wv-btn code {
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 10px;
  background: rgba(255,255,255,0.18);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0;
  font-weight: 500;
}
.wv-btn--ghost code {
  background: rgba(0,0,0,0.06);
  color: var(--c-text-strong);
}

/* ---- Modal ---- */
.wv-modal {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 480px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.wv-modal::backdrop {
  background: rgba(20,19,15,0.55);
}
.wv-modal__form {
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wv-modal__title {
  margin: 0 0 4px;
  font-family: var(--ff-hero);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wv-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.wv-modal__field span {
  color: var(--c-text-hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 600;
}
.wv-modal__field input {
  font-family: var(--ff-text);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--c-border, #e5e5e2);
  background: var(--c-neutral-bg, #f9f9f7);
  outline: none;
  transition: border 120ms ease, background 120ms ease;
}
.wv-modal__field input:focus {
  border-color: var(--c-blue);
  background: #fff;
}
.wv-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.wv-banner__action {
  margin-left: 12px;
}

/* ---- Chat-Icon pro Skill-Zeile (separat klickbar, öffnet Chat-Modal) ---- */
.pcard__skill-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 12px;
  line-height: 1;
  color: var(--c-text-hint, #8a8a82);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, color 120ms ease;
}
.pcard__skill-chat:hover,
.pcard__skill-chat:focus-visible {
  background: var(--c-highlight-bg, #E3EFFF);
  color: var(--c-blue);
  outline: none;
}

/* ---- Per-Skill-Chat-Modal ---- */
.wv-chat {
  border: none;
  padding: 0;
  border-radius: 14px;
  width: min(720px, 92vw);
  height: min(82vh, 880px);
  max-height: 90vh;
  background: var(--c-white, #fff);
  box-shadow: 0 24px 64px rgba(20,19,15,0.28);
  overflow: hidden;
}
.wv-chat::backdrop {
  background: rgba(20,19,15,0.55);
}
.wv-chat > #chat-modal-mount {
  display: contents;
}
.wv-chat__shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--c-white, #fff);
}
.wv-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--c-border-soft, #E5E7EB);
  flex: 0 0 auto;
}
.wv-chat__kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-hint);
}
.wv-chat__title {
  margin: 2px 0 0;
  font-family: var(--ff-hero);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-text-strong);
}
.wv-chat__close {
  border: none;
  background: transparent;
  color: var(--c-text-hint);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
}
.wv-chat__close:hover {
  background: var(--c-neutral-bg, #F2F2F2);
  color: var(--c-text-strong);
}
.wv-chat__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;        /* immer sichtbarer Scrollbar — macOS blendet 'auto' sonst aus */
  padding: 18px 22px;
  background: var(--c-row-bg, #F9F9F9);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(20,19,15,0.35) transparent;
}
.wv-chat__list::-webkit-scrollbar {
  width: 10px;
}
.wv-chat__list::-webkit-scrollbar-thumb {
  background: rgba(20,19,15,0.28);
  border-radius: 8px;
  border: 2px solid var(--c-row-bg, #F9F9F9);
}
.wv-chat__list::-webkit-scrollbar-thumb:hover {
  background: rgba(20,19,15,0.45);
}
.wv-chat__bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}
.wv-chat__bubble--user {
  align-self: flex-end;
  background: var(--c-blue, #4D97FE);
  color: var(--c-text-on-dark, #fff);
  border-bottom-right-radius: 4px;
}
.wv-chat__bubble--assistant {
  align-self: flex-start;
  background: var(--c-white, #fff);
  color: var(--c-text-strong);
  border: 1px solid var(--c-border-soft, #E5E7EB);
  border-bottom-left-radius: 4px;
}
.wv-chat__bubble--pending {
  color: var(--c-text-hint);
  font-style: italic;
}
.wv-chat__cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--c-blue);
  animation: wv-blink 1s step-end infinite;
}
@keyframes wv-blink {
  50% { opacity: 0; }
}
.wv-chat__foot {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--c-border-soft, #E5E7EB);
  background: var(--c-white, #fff);
}
.wv-chat__foot--readonly {
  justify-content: center;
  color: var(--c-text-hint);
  font-size: 12px;
  font-style: italic;
}
.wv-chat__input {
  flex: 1 1 auto;
  font-family: var(--ff-text);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--c-border, #D0D0D0);
  background: var(--c-neutral-bg, #F2F2F2);
  resize: vertical;
  min-height: 44px;
  max-height: 180px;
  outline: none;
  transition: border 120ms ease, background 120ms ease;
}
.wv-chat__input:focus {
  border-color: var(--c-blue);
  background: var(--c-white, #fff);
}
.wv-chat__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.wv-chat__send {
  flex: 0 0 auto;
}
.wv-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

/* ---- Agent-Activity-Banner ---- */
.wv-agent-activity {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--c-text-strong, #14130F);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(20,19,15,0.15);
}
.wv-agent-activity__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-cyan, #4fd1c5);
  box-shadow: 0 0 0 0 currentColor;
  animation: wv-agent-pulse 1.4s ease-in-out infinite;
}
@keyframes wv-agent-pulse {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0.4; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}
.wv-agent-activity__text strong {
  font-weight: 600;
}

/* ---- Progress-Zeilen im Chat (Tool-Use / Thinking / Tool-Error) ---- */
.wv-chat__bubble--progress {
  align-self: stretch;
  max-width: 100%;
  background: transparent;
  color: var(--c-text-hint, #6e6e6a);
  padding: 2px 4px;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 11px;
  line-height: 1.4;
  border-radius: 0;
  border-left: 2px solid var(--c-border-soft, #e5e7eb);
  margin-left: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}
