/* Chat-Fenster für Änderungswünsche (rechts unten) und die zugehörigen Seiten. Nutzt die Tokens aus design.css. */
.wish-widget { position: fixed; right: 24px; bottom: 24px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; pointer-events: none; }
.wish-widget > * { pointer-events: auto; }

.wish-fab { position: relative; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; color: #fff;
    background: linear-gradient(150deg, var(--c-brand-500), var(--c-brand-700)); box-shadow: var(--sh-brand), var(--sh-md); cursor: pointer;
    transition: transform var(--t-base) var(--ease-spring), box-shadow var(--t-base) var(--ease-out); }
.wish-fab:hover { background: linear-gradient(150deg, var(--c-brand-500), var(--c-brand-700)); transform: translateY(-2px) scale(1.04); }
.wish-fab:focus-visible, .wish-icon-button:focus-visible, .wish-send:focus-visible, .wish-row:focus-visible, .wish-tabs button:focus-visible { outline: none; box-shadow: var(--ring), var(--sh-md); }
.wish-fab svg { width: 26px; height: 26px; }
.wish-widget.is-open .wish-fab { transform: scale(.92); }
.wish-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--c-danger); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }

.wish-panel { display: flex; flex-direction: column; width: 384px; max-width: calc(100vw - 32px); height: min(600px, calc(100vh - 128px)); overflow: hidden;
    background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-xl); box-shadow: var(--sh-lg);
    transform-origin: bottom right; animation: wish-open var(--t-base) var(--ease-out) both; }
.wish-panel[hidden], .wish-chat[hidden], .wish-mine[hidden], .wish-compose[hidden] { display: none; }
@keyframes wish-open { from { opacity: 0; transform: translateY(10px) scale(.96); } }

.wish-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 20px; color: #fff;
    background: linear-gradient(150deg, var(--c-brand-600), var(--c-brand-700)); }
.wish-header strong { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.wish-header span { display: block; margin-top: 2px; font-size: 12px; opacity: .85; }
.wish-icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; flex-shrink: 0; border: 0; border-radius: var(--r-sm); background: rgb(255 255 255 / .12); color: #fff; cursor: pointer; }
.wish-icon-button:hover { background: rgb(255 255 255 / .22); }
.wish-icon-button svg { width: 18px; height: 18px; }

.wish-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--c-line); background: #fbfcfb; }
.wish-tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 8px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0;
    background: transparent; color: var(--c-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.wish-tabs button:hover { background: var(--c-brand-50); color: var(--c-brand-700); }
.wish-tabs button[aria-selected="true"] { color: var(--c-brand-700); border-bottom-color: var(--c-brand-500); }
.wish-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--c-brand-50); color: var(--c-brand-700); font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums; }
.wish-count[hidden], .wish-badge[hidden], .wish-error[hidden], .wish-link[hidden] { display: none; }

.wish-chat, .wish-mine { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wish-context { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--c-line); font-size: 12px; color: var(--c-muted); }
.wish-context strong { color: var(--c-ink); font-variant-numeric: tabular-nums; }
.wish-context-page { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink-2); }
.wish-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--c-canvas); }

.wish-bubble { max-width: 88%; padding: 10px 13px; border: 1px solid var(--c-line); border-radius: 14px 14px 14px 4px; background: var(--c-surface); box-shadow: var(--sh-xs); }
.wish-bubble.is-user { align-self: flex-end; border-color: #d7e8df; border-radius: 14px 14px 4px 14px; background: linear-gradient(160deg, #e9f5ef, #e1f0e8); }
.wish-bubble.is-operator { border-color: #d9dffa; background: #f4f6fe; }
.wish-bubble-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 11.5px; color: var(--c-muted); }
.wish-bubble-meta strong { color: var(--c-ink-2); font-weight: 650; }
.wish-bubble p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--c-ink); }

.wish-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 14px 14px 14px 4px; background: var(--c-surface); }
.wish-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--c-brand-400); animation: wish-dot 1.1s ease-in-out infinite; }
.wish-typing span:nth-child(2) { animation-delay: .15s; }
.wish-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wish-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.wish-error { margin: 0; padding: 8px 16px; background: var(--c-danger-bg); color: var(--c-danger); font-size: 12.5px; }
.wish-compose button { margin: 0; }
.wish-compose { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 12px 12px 6px 16px; border-top: 1px solid var(--c-line); }
.wish-compose textarea { flex: 1; min-height: 44px; max-height: 140px; margin: 0; padding: 10px 12px; resize: none; border: 1px solid var(--c-line-strong); border-radius: var(--r-md);
    background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 13.5px; line-height: 1.45; field-sizing: content; }
.wish-compose textarea:focus { outline: none; border-color: var(--c-brand-500); box-shadow: var(--ring); }
.wish-send { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; border: 0; border-radius: var(--r-md); background: var(--c-brand-500); color: #fff; cursor: pointer; }
.wish-send:hover { background: var(--c-brand-600); }
.wish-send:disabled { background: var(--c-line-strong); cursor: default; }
.wish-send svg { width: 19px; height: 19px; }
.wish-hint { margin: 0; padding: 0 16px 10px; font-size: 11px; line-height: 1.4; color: var(--c-subtle); }
.wish-link, button.wish-link { align-self: flex-start; margin: 0 16px 12px; padding: 0; border: 0; background: transparent; color: var(--c-brand-600); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wish-link:hover { background: transparent; color: var(--c-brand-700); text-decoration: underline; }

.wish-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 10px; display: grid; align-content: start; gap: 6px; }
.wish-mine .wish-link { margin-top: 10px; }
.wish-empty { padding: 28px 16px; text-align: center; font-size: 13px; color: var(--c-muted); }
.wish-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; width: 100%; padding: 11px 12px; text-align: left; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); color: var(--c-ink); cursor: pointer; font-weight: 400; }
.wish-row:hover { background: var(--c-brand-50); border-color: var(--c-brand-200); }
.wish-row.is-unread { border-color: var(--c-brand-400); box-shadow: inset 3px 0 0 var(--c-brand-500); }
.wish-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wish-row-top strong { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wish-row-title { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wish-row-meta { font-size: 11.5px; color: var(--c-muted); }

/* Seiten „Meine Wünsche“ und Plattformkonsole */
.wish-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.wish-card-head h2 { margin: 0; font-size: 17px; }
.wish-card-head h2 span { color: var(--c-muted); font-weight: 500; font-variant-numeric: tabular-nums; margin-right: 6px; }
.wish-meta { margin: 6px 0 16px; font-size: 12.5px; color: var(--c-muted); overflow-wrap: anywhere; }
.wish-log { display: flex; flex-direction: column; gap: 10px; }
.wish-log .wish-bubble { max-width: min(720px, 92%); }
.wish-prompt { margin: 0; padding: 16px; max-height: 460px; overflow: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); background: #fbfcfb; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--c-ink); }
.wish-facts { display: grid; gap: 12px; margin: 0; }
.wish-facts dt { font-size: 11.5px; color: var(--c-muted); }
.wish-facts dd { margin: 2px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }

@media (max-width: 520px) {
    .wish-widget { right: 12px; bottom: 12px; left: 12px; }
    .wish-panel { width: 100%; max-width: none; height: min(600px, calc(100dvh - 96px)); }
}
@media (prefers-reduced-motion: reduce) { .wish-panel, .wish-typing span { animation: none; } .wish-fab { transition: none; } }
@media print { .wish-widget { display: none; } }
