
.agdemo {
  --agd-accent: var(--accent, #026CDF);
  --agd-accent-dark: var(--accent-dark, #0147B1);
  --agd-accent-soft: var(--accent-soft, #DCEBFF);
  --agd-ink: var(--ink, #2b3033);
  --agd-neben: var(--grey, #61686c);
  --agd-border: var(--border, #e9e9e9);
  --agd-white: var(--white, #ffffff);
  --agd-bg: var(--bg, #f5f5f5);

  display: block;
  font-family: inherit;
  color: var(--agd-ink);
  text-align: left;
}

.agdemo__badge {
  display: inline-block;
  margin: 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--agd-border);
  border-radius: 999px;
  background: var(--agd-white);
  color: var(--agd-neben);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.agdemo__mini {
  position: relative;
  border: 2px solid var(--agd-border);
  border-radius: 16px;
  background: var(--agd-white);
  box-shadow: 0 6px 18px rgba(43, 48, 51, 0.08);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.agdemo__kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.agdemo__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 2px solid var(--agd-accent);
  border-radius: 999px;
  background: var(--agd-white);
  color: var(--agd-accent);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.agdemo__hint svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agdemo__mini:focus-visible {
  outline: 3px solid var(--agd-accent);
  outline-offset: 2px;
}

.agdemo__mini:focus-visible,
.agdemo__mini:active {
  border-color: var(--agd-accent);
  box-shadow: 0 18px 48px rgba(43, 48, 51, 0.12);
}

.agdemo__mini:focus-visible .agdemo__hint,
.agdemo__mini:active .agdemo__hint {
  background: var(--agd-accent-dark);
  border-color: var(--agd-accent-dark);
  color: #ffffff;
}

@media (hover: hover) {
  .agdemo__mini:hover {
    border-color: var(--agd-accent);
    box-shadow: 0 18px 48px rgba(43, 48, 51, 0.12);
  }
  .agdemo__mini:hover .agdemo__hint {
    background: var(--agd-accent-dark);
    border-color: var(--agd-accent-dark);
    color: #ffffff;
  }
}

.agdemo__stream {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 12rem;
  overflow: hidden;
}

.agdemo__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--agd-border);
}

.agdemo__case {
  color: var(--agd-neben);
  font-size: 0.875rem;
  line-height: 1.5;
}

.agdemo__turn { display: flex; flex-direction: column; gap: 0.5rem; }

.agdemo__msg {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 88%;
}

.agdemo__msg--user { align-self: flex-end; flex-direction: row-reverse; }
.agdemo__msg--agent { align-self: flex-start; }

.agdemo__msg[hidden] { display: none; }

.agdemo__avatar {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--agd-border);
  background-color: var(--agd-white);
  background-repeat: no-repeat;
}

.agdemo__avatar--agent {
  background-size: 70% auto;
  background-position: 50% 55%;
  background-color: var(--agd-accent-soft);
}

.agdemo__avatar--symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--agd-neben);
}

.agdemo__avatar--symbol svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.agdemo__bubble {
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.agdemo__bubble--user {
  background: var(--agd-accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.agdemo__bubble--agent {
  background: var(--agd-accent-soft);
  color: var(--agd-ink);
  border-bottom-left-radius: 4px;
}

.agdemo__who {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.agdemo__msg--agent .agdemo__who {
  text-transform: none;
  letter-spacing: 0.02em;
}

.agdemo__time {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.agdemo__tools {
  align-self: flex-start;
  list-style: none;
  margin: 0 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.agdemo__tool {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--agd-neben);
}

.agdemo__tool[hidden] { display: none; }

.agdemo__tool svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agdemo__tool::after {
  content: "✓";
  color: var(--agd-accent);
  font-family: inherit;
}

.agdemo__typing {
  align-self: flex-start;
  margin: 0 0 0 2rem;
  color: var(--agd-neben);
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.5;
}

.agdemo__msg,
.agdemo__tool,
.agdemo__typing {
  animation: agdemo-in 200ms ease-out both;
}

@keyframes agdemo-in {
  from { opacity: 0; transform: translateY(0.25rem); }
  to   { opacity: 1; transform: none; }
}

.agdemo__btn {
  min-height: 2.75rem;
  padding: 0 1.5rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  border: 2px solid var(--agd-accent);
  background: transparent;
  color: var(--agd-accent);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.agdemo__btn:active { border-color: var(--agd-accent-dark); color: var(--agd-accent-dark); }

.agdemo__btn:disabled {
  border-color: var(--agd-border);
  background: var(--agd-bg);
  color: var(--agd-neben);
  box-shadow: none;
  cursor: default;
}

@media (hover: hover) {
  .agdemo__btn:not(:disabled):hover { border-color: var(--agd-accent-dark); color: var(--agd-accent-dark); }
  .agdemo__tab:hover { border-color: var(--agd-accent); }
  .agdemo__close:hover { border-color: var(--agd-accent); color: var(--agd-accent); }
}

.agdemo__btn:focus-visible,
.agdemo__tab:focus-visible,
.agdemo__close:focus-visible {
  outline: 3px solid var(--agd-accent);
  outline-offset: 2px;
}

.agdemo__more {
  position: relative;
  overflow: hidden;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin: 0.5rem 0 0.25rem;
  padding: 0 1.25rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  border: 2px solid var(--agd-accent);
  background: var(--agd-bg);
  color: var(--agd-accent);
  cursor: pointer;
  animation: agdemo-in 200ms ease-out both;
}
.agdemo__more-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--agd-accent);
  transform-origin: left;
  animation: agdemo-countdown var(--agd-lesen, 2800ms) linear both;
}
.agdemo__more-arrow svg {
  display: block;
  width: 1rem; height: 1rem;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  animation: agdemo-nudge 900ms ease-in-out infinite;
}
@keyframes agdemo-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes agdemo-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }
@media (hover: hover) {
  .agdemo__more:hover { border-color: var(--agd-accent-dark); color: var(--agd-accent-dark); }
}
.agdemo__more:focus-visible { outline: 3px solid var(--agd-accent); outline-offset: 2px; }

.agdemo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.agdemo-overlay[hidden] { display: none; }

.agdemo-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 40, 0.72);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.agdemo-overlay__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  max-height: min(88dvh, 860px);
  display: flex;
  flex-direction: column;
  background: var(--agd-white);
  border: 3px solid var(--agd-accent);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(43, 48, 51, 0.28);
  overflow: hidden;
  animation: agdemo-auf 320ms ease-out both;
}

@keyframes agdemo-auf {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: none; }
}

.agdemo-overlay__head {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--agd-border);
}

.agdemo-overlay__head .agdemo__badge {
  display: block;
  margin-right: 3.5rem;
  border-radius: 12px;
}

.agdemo-overlay__kopfzeile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.agdemo-overlay__bild {
  flex: none;
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 12px;
  border: 1px solid var(--agd-border);
}

.agdemo-overlay__bild[hidden] { display: none; }

.agdemo-overlay__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.35;
}

.agdemo-overlay__dept {
  display: block;
  color: var(--agd-neben);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.agdemo__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--agd-border);
  background: var(--agd-bg);
}

.agdemo__tab {
  min-height: 2.75rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid var(--agd-border);
  background: var(--agd-white);
  color: var(--agd-ink);
  cursor: pointer;
  transition: border-color 120ms ease;
}

.agdemo__tab[aria-selected="true"] {
  background: var(--agd-accent);
  border-color: var(--agd-accent);
  color: #ffffff;
}

.agdemo-overlay .agdemo__stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.agdemo-overlay__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--agd-border);
  background: var(--agd-bg);
}

.agdemo__progress {
  margin-right: auto;
  color: var(--agd-neben);
  font-size: 0.875rem;
}

.agdemo__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--agd-border);
  background: var(--agd-white);
  color: var(--agd-ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 1;
  transition: border-color 120ms ease, color 120ms ease;
}
.agdemo__close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

html.agdemo-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .agdemo__msg,
  .agdemo__tool,
  .agdemo__typing,
  .agdemo__more,
  .agdemo__more-bar,
  .agdemo__more-arrow svg,
  .agdemo-overlay__panel { animation: none; }
  .agdemo__mini,
  .agdemo__hint,
  .agdemo__btn,
  .agdemo__tab,
  .agdemo__close { transition: none; }
}

@media (max-width: 40rem) {
  .agdemo__msg { max-width: 100%; }
  .agdemo-overlay { padding: 0.5rem; }
  .agdemo-overlay__panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 12px;
  }
  .agdemo__tabs { flex-wrap: nowrap; overflow-x: auto; }
  .agdemo__tab { flex: none; }
  .agdemo-overlay__bild { width: 3rem; height: 3rem; }
  .agdemo-overlay__title { font-size: 1.25rem; }
  .agdemo-overlay__head,
  .agdemo__tabs,
  .agdemo-overlay .agdemo__stream,
  .agdemo-overlay__foot { padding-left: 1rem; padding-right: 1rem; }
}
