/* Page Guide (Ask AI) — dashboard pilot */

.ai-guide-root[hidden] {
    display: none !important;
}

.ai-guide-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 999px;
    background: var(--accent-color, #4caf50);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.ai-guide-fab:hover,
.ai-guide-fab:focus-visible {
    background: var(--accent-hover, #45a049);
    color: #fff;
    transform: translateY(-1px);
}

.ai-guide-fab-label {
    line-height: 1;
}

.ai-guide-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: rgba(0, 0, 0, 0.35);
}

.ai-guide-backdrop[hidden],
.ai-guide-panel[hidden] {
    display: none !important;
}

.ai-guide-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1050;
    width: min(400px, 100vw);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #2d3142);
    border-left: 1px solid var(--border-color, #e4e6eb);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(0);
}

.ai-guide-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #e4e6eb);
    flex-shrink: 0;
}

.ai-guide-panel-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.ai-guide-panel-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
}

.ai-guide-close {
    color: var(--text-secondary, #6c757d);
    text-decoration: none;
    padding: 0.25rem;
}

.ai-guide-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-guide-intro {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
    line-height: 1.45;
}

.ai-guide-section-label {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary, #6c757d);
}

.ai-guide-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
}

.ai-guide-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-guide-chip {
    border: 1px solid var(--border-color, #e4e6eb);
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #2d3142);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ai-guide-chip:hover:not(:disabled),
.ai-guide-chip:focus-visible:not(:disabled) {
    border-color: var(--accent-color, #4caf50);
    background: #fff;
}

.ai-guide-chip:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-guide-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.ai-guide-msg {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-guide-msg-user {
    align-self: flex-end;
    background: var(--accent-color, #4caf50);
    color: #fff;
    border-bottom-right-radius: 0.2rem;
}

.ai-guide-msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 92%;
}

.ai-guide-msg-wrap-user {
    align-self: flex-end;
}

.ai-guide-msg-wrap-assistant {
    align-self: flex-start;
}

.ai-guide-msg-assistant {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #2d3142);
    border: 1px solid var(--border-color, #e4e6eb);
    border-bottom-left-radius: 0.2rem;
}

.ai-guide-msg-user {
    align-self: flex-end;
}

.ai-guide-msg-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ai-guide-listen {
    border: none;
    background: transparent;
    color: var(--accent-color, #4caf50);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ai-guide-listen:hover:not(:disabled),
.ai-guide-listen:focus-visible:not(:disabled) {
    text-decoration: underline;
}

.ai-guide-listen:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ai-guide-listen.is-speaking {
    color: #c0392b;
}

.ai-guide-thinking {
    opacity: 0.75;
    font-style: italic;
}

.ai-guide-compose-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

.ai-guide-input {
    font-size: 0.9rem;
    resize: vertical;
    min-height: 4.5rem;
}

@media (max-width: 767.98px) {
    .ai-guide-panel {
        width: 100vw;
    }

    .ai-guide-fab {
        right: 1rem;
        bottom: 1rem;
        padding: 0.75rem;
        border-radius: 50%;
        width: 3.25rem;
        height: 3.25rem;
        justify-content: center;
    }

    .ai-guide-fab-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }
}
