/* Tab "Assistent" */
.as-card .tk-card-head { flex-wrap: wrap; }
.as-info { margin-right: auto; }

.as-notice {
    margin: 0 0 0.9rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-small); font-size: var(--fs-small); line-height: 1.55;
    background: var(--color-warn-soft); border: 1px solid rgba(245, 196, 81, 0.3); color: var(--color-text);
}
.as-notice[hidden] { display: none; }
.as-notice code, .as-bubble code {
    font-family: var(--font-mono); font-size: 0.92em; padding: 0.08rem 0.35rem; border-radius: 6px; background: rgba(0, 0, 0, 0.35);
    overflow-wrap: anywhere;
}

.as-log {
    display: flex; flex-direction: column; gap: 0.9rem; min-height: 240px; max-height: calc(100vh - 390px); overflow-y: auto;
    padding: 0.3rem 0.15rem 0.6rem; scroll-behavior: smooth;
}
.as-empty { margin: auto; max-width: 440px; text-align: center; color: var(--color-text-faint); font-size: var(--fs-small); line-height: 1.6; }

.as-msg { display: flex; flex-direction: column; gap: 0.35rem; max-width: min(760px, 92%); }
.as-msg.user { align-self: flex-end; align-items: flex-end; }
.as-msg.assistant { align-self: flex-start; align-items: flex-start; }
.as-bubble {
    padding: 0.7rem 0.95rem; border-radius: var(--radius-medium); font-size: var(--fs-body); line-height: 1.6;
    overflow-wrap: anywhere; word-break: break-word;
}
.as-msg.user .as-bubble { background: var(--color-accent-soft); border: 1px solid var(--color-border-strong); border-bottom-right-radius: 5px; }
.as-msg.assistant .as-bubble { background: var(--color-surface); border: 1px solid var(--color-border); border-bottom-left-radius: 5px; }
.as-msg.is-error .as-bubble { background: var(--color-error-soft); border-color: rgba(255, 95, 109, 0.35); }
.as-bubble p { margin: 0 0 0.6rem; }
.as-bubble p:last-child, .as-bubble ul:last-child, .as-bubble ol:last-child, .as-bubble pre:last-child { margin-bottom: 0; }
.as-bubble ul, .as-bubble ol { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.as-bubble li { margin: 0.15rem 0; }
.as-bubble strong { color: #fff; }
.as-bubble a { color: var(--color-agentic-accent); text-decoration: underline; text-underline-offset: 2px; }
.as-bubble pre {
    margin: 0 0 0.6rem; padding: 0.7rem 0.85rem; border-radius: var(--radius-small); background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border); overflow-x: auto; font-size: var(--fs-small);
}
.as-bubble pre code { padding: 0; background: none; white-space: pre; overflow-wrap: normal; }

.as-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 0.2rem; }
.as-chip {
    font-size: var(--fs-tiny); padding: 0.14rem 0.55rem; border-radius: 999px; color: var(--color-text-muted);
    border: 1px solid var(--color-border); background: rgba(255, 255, 255, 0.03);
}
.as-chip.is-write { color: var(--color-text); border-color: rgba(255, 122, 51, 0.55); background: var(--color-agentic-soft); }
.as-chip.is-fail { color: var(--color-error); border-color: rgba(255, 95, 109, 0.4); background: var(--color-error-soft); }

.as-typing { display: inline-flex; gap: 5px; align-items: center; padding: 0.9rem 1rem; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-faint); animation: as-dot 1.2s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: 0.15s; }
.as-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes as-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .as-typing i { animation: none; opacity: 0.6; } .as-log { scroll-behavior: auto; } }

.as-suggest { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.4rem 0 0.7rem; }
.as-suggest:empty { display: none; }

.as-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; align-items: end; margin-top: 0.6rem; }
.as-form textarea {
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--color-border); border-radius: var(--radius-small); color: inherit;
    padding: 0.7rem 0.9rem; min-width: 0; width: 100%; resize: none; font: inherit; line-height: 1.5; max-height: 160px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.as-form textarea:hover { border-color: var(--color-border-strong); }
.as-form textarea:focus { outline: none; border-color: rgba(255, 122, 51, 0.6); box-shadow: var(--glow-accent); background: rgba(0, 0, 0, 0.45); }
.as-form textarea:disabled { opacity: 0.55; }
.as-form .ao-run-btn { align-self: stretch; }

.as-foot { margin-top: 0.7rem; font-size: var(--fs-tiny); color: var(--color-text-faint); line-height: 1.5; }

@media (max-width: 700px) {
    .as-log { max-height: calc(100dvh - 400px); }
    .as-msg { max-width: 96%; }
    .as-form { grid-template-columns: minmax(0, 1fr); }
    .as-form .ao-run-btn { justify-self: end; padding-left: 1.6rem; padding-right: 1.6rem; }
}

/* Startknopf-Ansicht (ohne API-Schlüssel): Weiterleitung nach claude.ai */
.as-lead { margin: 0 0 1rem; line-height: 1.6; color: var(--color-text-muted); max-width: 70ch; }
.as-lead strong { color: var(--color-text); }
.as-open { display: inline-block; text-decoration: none; text-align: center; margin: 0 0 1.4rem; }
.as-launch-head { font-size: var(--fs-tiny); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-text-faint); margin: 0 0 0.5rem; }
.as-launch { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.as-launch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.6rem 0; border-top: 1px solid var(--color-border); }
.as-launch-row:first-child { border-top: none; }
.as-q { flex: 1; min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.as-launch-actions { display: flex; gap: 0.4rem; flex: none; }
.as-launch-actions .tk-btn { text-decoration: none; margin-top: 0; }
.as-help { margin: 0 0 0.4rem; padding-left: 1.3rem; color: var(--color-text-muted); font-size: var(--fs-small); line-height: 1.7; }
.as-help b { color: var(--color-text); font-weight: 600; }
@media (max-width: 700px) {
    .as-launch-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
    .as-launch-actions { justify-content: flex-end; }
}
