/* KI-Projektberater — Tavernen-Look, Dialog-Fokus */

.pb-page .topic-hero {
  padding-bottom: 8px;
}

.pb-page .topic-lead {
  margin-bottom: 0;
}

.pb-page .topic-content {
  padding-top: 8px;
}

.pb-page .contact-form-wrap {
  margin-top: 0;
}

.pb-page .topic-section {
  margin-bottom: 0;
}

.pb-shell {
  max-width: 780px;
  margin-inline: auto;
}

/* Äußere Hülle: weniger Rundung, klarer Kasten-Look */
.pb-shell.terminal-card {
  border-radius: 14px;
  padding: 10px;
}

.pb-shell.terminal-card::before {
  border-radius: 18px;
}

.pb-shell .terminal-inner {
  padding: 1.1rem 1.2rem 1.35rem;
  border-radius: 8px;
}

.pb-shell .card-head {
  margin-bottom: .85rem;
  padding-bottom: .85rem;
}

.pb-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pb-progress {
  flex: 1;
  min-width: 0;
}

.pb-progress span {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: .35rem;
  letter-spacing: .02em;
}

.pb-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.pb-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  border-radius: inherit;
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 0 12px rgba(251, 191, 36, .35);
}

.pb-ai-badge {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  padding: .28rem .55rem;
  border-radius: 4px;
  border: 1px solid rgba(94, 234, 212, .28);
  background: rgba(94, 234, 212, .08);
}

.pb-body {
  position: relative;
  min-height: 320px;
}

/* Verlauf wird nicht angezeigt — Antworten bleiben intern für API + Abschluss */
.pb-thread {
  display: none !important;
}

.pb-thread-item {
  display: grid;
  gap: .35rem;
  animation: pb-fade-up .35s ease both;
}

.pb-thread-q {
  font-size: .78rem;
  color: var(--muted);
}

.pb-thread-a {
  display: inline-flex;
  align-self: flex-start;
  flex-wrap: wrap;
  gap: .35rem;
}

.pb-chip {
  display: inline-block;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  background: rgba(251, 191, 36, .14);
  border: 1px solid rgba(251, 191, 36, .28);
  color: var(--amber2);
}

.pb-stage {
  transition: opacity .25s ease, transform .25s ease;
}

.pb-stage.is-loading {
  opacity: .45;
  pointer-events: none;
}

.pb-stage.is-enter {
  animation: pb-fade-up .4s ease both;
}

.pb-bubble {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.pb-bubble[hidden] {
  display: none !important;
}

.pb-bubble--compact {
  margin-bottom: .65rem;
}

.pb-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(145deg, var(--amber), #f59e0b);
  box-shadow: 0 4px 14px rgba(251, 191, 36, .25);
}

.pb-bubble-body {
  flex: 1;
  padding: .75rem .9rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  font-size: .92rem;
  line-height: 1.55;
}

.pb-bubble-body p {
  margin: 0;
}

.pb-question-card {
  padding: 1rem 1rem 1.1rem;
  border-radius: 0;
  border: 1px solid rgba(253, 230, 138, .18);
  background: linear-gradient(160deg, rgba(251, 191, 36, .07), rgba(0, 0, 0, .22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.pb-question {
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  margin: 0 0 .35rem;
  line-height: 1.3;
}

.pb-question-hint {
  margin: 0 0 1rem;
  font-size: .86rem;
  color: var(--muted);
}

.pb-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: 1rem;
}

.pb-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  text-align: left;
  padding: .7rem .8rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
  animation: pb-fade-up .4s ease both;
}

.pb-option:nth-child(1) { animation-delay: .03s; }
.pb-option:nth-child(2) { animation-delay: .06s; }
.pb-option:nth-child(3) { animation-delay: .09s; }
.pb-option:nth-child(4) { animation-delay: .12s; }
.pb-option:nth-child(5) { animation-delay: .15s; }
.pb-option:nth-child(6) { animation-delay: .18s; }
.pb-option:nth-child(7) { animation-delay: .21s; }

.pb-option:hover {
  border-color: rgba(251, 191, 36, .5);
  background: rgba(251, 191, 36, .08);
  transform: translateY(-1px);
}

.pb-option.is-active {
  border-color: var(--amber);
  background: rgba(251, 191, 36, .14);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, .3), 0 8px 24px rgba(0, 0, 0, .2);
}

.pb-option-icon {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .06);
}

.pb-option-icon .lucide {
  width: 1rem;
  height: 1rem;
  color: var(--amber2);
}

.pb-option.is-active .pb-option-icon {
  background: rgba(251, 191, 36, .2);
}

.pb-option-mark {
  display: none;
}

.pb-freetext {
  display: block;
  margin-bottom: 1rem;
}

.pb-freetext span {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .4rem;
}

.pb-freetext textarea,
.pb-contact-form input {
  width: 100%;
  padding: .72rem .85rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .32);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}

.pb-freetext textarea:focus,
.pb-contact-form input:focus {
  outline: none;
  border-color: rgba(94, 234, 212, .55);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .12);
}

.pb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .25rem;
}

.pb-actions .btn {
  border-radius: 6px;
}

.pb-actions .btn.primary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.pb-btn-arrow {
  transition: transform .2s ease;
}

.pb-actions .btn.primary:not(:disabled):hover .pb-btn-arrow {
  transform: translateX(3px);
}

.pb-contact-form {
  display: grid;
  gap: .85rem;
  margin-top: .5rem;
}

.pb-contact-form label span {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .35rem;
}

.pb-summary {
  display: grid;
  gap: .75rem;
  margin: 0 0 1.25rem;
}

.pb-summary div {
  padding: .8rem .95rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.pb-summary dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .25rem;
}

.pb-summary dd {
  margin: 0;
  line-height: 1.5;
}

.pb-summary .pb-badge {
  display: inline-block;
  margin-top: .15rem;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 600;
}

.pb-badge--high { background: rgba(94, 234, 212, .18); color: var(--teal); }
.pb-badge--mid { background: rgba(251, 191, 36, .18); color: var(--amber2); }
.pb-badge--low { background: rgba(251, 113, 133, .15); color: var(--rose); }

.pb-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  margin-top: .75rem;
  color: var(--muted);
  font-size: .88rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.pb-loading.is-active,
.pb-loading:not([hidden]) {
  display: flex;
}

.pb-loading[hidden] {
  display: none !important;
}

.pb-typing {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pb-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pb-bounce 1.2s infinite ease-in-out;
}

.pb-typing i:nth-child(2) { animation-delay: .15s; }
.pb-typing i:nth-child(3) { animation-delay: .3s; }

.pb-error {
  margin-top: 1rem;
  padding: .75rem .9rem;
  border-radius: 6px;
  background: rgba(251, 113, 133, .12);
  border: 1px solid rgba(251, 113, 133, .35);
  color: #fecdd3;
  font-size: .9rem;
}

@keyframes pb-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pb-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@media (max-width: 640px) {
  .pb-options {
    grid-template-columns: 1fr;
  }

  .pb-status {
    flex-direction: column;
    align-items: stretch;
  }

  .pb-ai-badge {
    align-self: flex-start;
  }
}
