/* The console assistant: the Ask button in the header and the panel it opens. Loaded globally from
   App.razor, because the button is on every page. */

.admin-ask-btn {
    width: auto;
    gap: 6px;
    padding: 0 11px;
    color: #6d28d9;
    font-weight: 600;
    font-size: 13.5px;
}

.admin-ask-btn i { font-size: 18px; }

.admin-ask-btn:hover,
.admin-ask-btn.is-active { background: #f1eafe; }

/* Below the header, on the right, over the page. Full width on a phone. */
.ask-panel {
    position: fixed;
    top: 62px;
    right: 0;
    bottom: 0;
    z-index: 31;
    width: 400px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #ece8f3;
    box-shadow: -12px 0 32px -18px rgba(36, 16, 51, .28);
}

.ask-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f0edf5;
}

.ask-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1a1626;
}

.ask-title i { color: #8b5cf6; font-size: 18px; }

.ask-head-actions { display: flex; gap: 4px; }

.ask-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6f677f;
    cursor: pointer;
}

.ask-icon:hover:not(:disabled) { background: #f4f1f9; color: #3b3547; }
.ask-icon:disabled { opacity: .45; cursor: default; }
.ask-icon.is-chosen { background: #f1eafe; color: #6d28d9; }

/* Reversed so the newest text stays in view while it streams in, without any script. */
.ask-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
}

.ask-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px;
}

.ask-intro {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #4a4358;
}

.ask-suggestions { display: flex; flex-direction: column; gap: 7px; }

.ask-suggestion {
    text-align: left;
    padding: 9px 12px;
    border: 1px solid #e6e1ef;
    border-radius: 10px;
    background: #fbfaff;
    font: inherit;
    font-size: 13px;
    color: #3b3547;
    cursor: pointer;
}

.ask-suggestion:hover:not(:disabled) { border-color: #c4b5fd; color: #6d28d9; }

.ask-turn { display: flex; flex-direction: column; gap: 8px; }
.ask-turn.is-user { align-items: flex-end; }

.ask-text {
    max-width: 92%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #2f2838;
    overflow-wrap: anywhere;
}

.ask-turn.is-user .ask-text { background: #6d28d9; color: #fff; border-bottom-right-radius: 4px; }
.ask-turn.is-assistant .ask-text { background: #f6f4fb; border-bottom-left-radius: 4px; }

.ask-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6f677f;
}

.ask-spin { animation: ask-spin 1s linear infinite; }

@keyframes ask-spin { to { transform: rotate(360deg); } }

.ask-links { display: flex; flex-wrap: wrap; gap: 6px; }

.ask-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #e2d8fb;
    border-radius: 999px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 600;
    color: #6d28d9;
    text-decoration: none;
}

.ask-link:hover { background: #f6f1ff; }

.ask-feedback {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #8a8397;
}

.ask-feedback span { margin-right: 4px; }

.ask-foot {
    padding: 12px 14px 14px;
    border-top: 1px solid #f0edf5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ask-form { display: flex; gap: 8px; }

.ask-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1.5px solid #e6e2ee;
    border-radius: 10px;
    font: inherit;
    font-size: 13.5px;
    color: #1a1626;
}

.ask-input:focus { outline: none; border-color: #a05aff; box-shadow: 0 0 0 3px rgba(160, 90, 255, .15); }

.ask-send {
    width: 40px;
    flex: none;
    border: none;
    border-radius: 10px;
    background: #a05aff;
    color: #fff;
    font-size: 17px;
    cursor: pointer;
}

.ask-send:disabled { background: #e6e2ee; color: #a9a3b8; cursor: default; }

.ask-stuck {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #6d28d9;
    text-decoration: none;
}

.ask-stuck:hover { text-decoration: underline; }

.ask-note { margin: 0; font-size: 11.5px; line-height: 1.5; color: #8a8397; }

@media (max-width: 640px) {
    .admin-ask-label { display: none; }
    .ask-panel { width: 100vw; border-left: none; }
}
