/* Плавающий помощник АС-ПРО — glass dialog */
.aspro-asst-fab {
    position: fixed;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    right: max(1.25rem, env(safe-area-inset-right));
    z-index: 520;
    pointer-events: auto;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.85), rgba(139, 92, 246, 0.75));
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.aspro-asst-fab img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 9999px;
    object-fit: cover;
    pointer-events: none;
}
.aspro-asst-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 48px rgba(59, 130, 246, 0.45);
}
.aspro-asst-minimal .aspro-asst-tabs,
.aspro-asst-minimal .aspro-asst-roles-setup,
.aspro-asst-minimal .aspro-asst-chips,
.aspro-asst-minimal .aspro-asst-guide-bar {
    display: none !important;
}
.aspro-asst-minimal .aspro-asst-fab i {
    font-size: 1.25rem;
    line-height: 3.5rem;
}
.aspro-asst-minimal .aspro-asst-disclaimer {
    display: none !important;
}
.aspro-asst-minimal--feedback .aspro-asst-messages,
.aspro-asst-minimal--feedback .aspro-asst-footer,
.aspro-asst-minimal--feedback .aspro-asst-chips,
.aspro-asst-minimal--feedback .aspro-asst-guide-bar {
    display: none !important;
}
.aspro-asst-minimal--feedback .aspro-asst-knowledge {
    display: block !important;
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 12px;
}

body.app-workspace-host .aspro-asst-fab {
    z-index: 520;
}

.aspro-asst-backdrop {
    position: fixed;
    inset: 0;
    z-index: 510;
    background: rgba(2, 8, 23, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.aspro-asst-backdrop.hidden {
    display: none;
}

.aspro-asst-panel {
    position: fixed;
    z-index: 525;
    bottom: 5.75rem;
    right: 1.25rem;
    width: min(440px, calc(100vw - 2rem));
    height: min(72vh, 620px);
    min-width: 320px;
    min-height: 320px;
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 2rem);
    resize: both;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.15rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(110, 231, 255, 0.08) inset;
}
.aspro-asst-panel.hidden {
    display: none;
}

.aspro-asst-panel--inline {
    position: relative;
    bottom: auto;
    right: auto;
    left: auto;
    top: auto;
    z-index: 1;
    width: 100%;
    height: min(520px, 65vh);
    min-height: 360px;
    max-width: none;
    resize: vertical;
    margin-top: 0.5rem;
}

.aspro-agent-inline-mount {
    min-height: 380px;
}

.aspro-asst-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    cursor: move;
}
.aspro-asst-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #f1f5f9;
    letter-spacing: 0.01em;
}
.aspro-asst-close {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
}
.aspro-asst-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.aspro-asst-disclaimer {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.68rem;
    line-height: 1.35;
    color: #fcd34d;
}

.aspro-asst-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.aspro-asst-tab {
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
}
.aspro-asst-tab.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(96, 165, 250, 0.45);
    color: #e2e8f0;
}

.aspro-asst-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.aspro-asst-msg-user {
    align-self: flex-end;
    max-width: 88%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.85rem 0.85rem 0.15rem 0.85rem;
    background: rgba(59, 130, 246, 0.35);
    color: #f8fafc;
    font-size: 0.85rem;
    white-space: pre-wrap;
}
.aspro-asst-msg-bot {
    align-self: flex-start;
    max-width: 92%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.85rem 0.85rem 0.85rem 0.15rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.85rem;
    white-space: pre-wrap;
    line-height: 1.45;
}
.aspro-asst-msg-sys {
    align-self: center;
    font-size: 0.7rem;
    color: #64748b;
}

.aspro-asst-footer {
    flex-shrink: 0;
    padding: 0.65rem 0.75rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}
.aspro-asst-input {
    width: 100%;
    min-height: 2.75rem;
    max-height: 6rem;
    resize: vertical;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.65);
    color: #f1f5f9;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    font-family: inherit;
}
.aspro-asst-send {
    margin-top: 0.45rem;
    width: 100%;
    border: none;
    border-radius: 0.55rem;
    padding: 0.55rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(99, 102, 241, 0.85));
    color: #fff;
}
.aspro-asst-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aspro-asst-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.75rem 0.5rem;
}
.aspro-asst-chip {
    font-size: 0.68rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}
.aspro-asst-chip:hover {
    border-color: rgba(96, 165, 250, 0.55);
    color: #e2e8f0;
}

.aspro-asst-hint {
    font-size: 0.68rem;
    color: #64748b;
    padding: 0 0.75rem 0.35rem;
}

.aspro-asst-knowledge.hidden,
.aspro-asst-context.hidden,
.aspro-asst-toolbar.hidden,
.aspro-asst-caps.hidden,
.aspro-asst-legal.hidden,
.hidden {
    display: none !important;
}

.aspro-asst-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}
.aspro-asst-table th,
.aspro-asst-table td {
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 0.25rem 0.35rem;
}

.aspro-asst-mini {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.aspro-asst-roles-setup {
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aspro-asst-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    opacity: 0.35;
}
    margin: 0;
    line-height: 1.35;
}

.aspro-asst-legal {
    margin: 0 0.75rem 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(100, 116, 139, 0.35);
    background: rgba(15, 23, 42, 0.5);
}

.aspro-asst-legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.aspro-asst-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #a5b4fc;
}

.aspro-asst-legal-result {
    font-size: 0.65rem;
    max-height: 140px;
    overflow: auto;
    white-space: pre-wrap;
    color: #cbd5e1;
    margin: 0.35rem 0 0;
    padding: 0.35rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0.35rem;
}

.aspro-asst-context {
    margin: 0 0.75rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.72rem;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 0.5rem;
    border-left: 3px solid #6366f1;
    max-height: 4.5rem;
    overflow-y: auto;
    white-space: pre-wrap;
}
.aspro-asst-context.hidden {
    display: none;
}

.aspro-asst-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 120px;
    max-height: 280px;
}
.aspro-asst-msg-user {
    align-self: flex-end;
    max-width: 92%;
    background: #1d4ed8;
    padding: 0.45rem 0.65rem;
    border-radius: 0.75rem 0.75rem 0.15rem 0.75rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
}
.aspro-asst-msg-bot {
    align-self: flex-start;
    max-width: 92%;
    background: #1e293b;
    padding: 0.45rem 0.65rem;
    border-radius: 0.75rem 0.75rem 0.75rem 0.15rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
}
.aspro-asst-msg-sys {
    align-self: center;
    font-size: 0.72rem;
    color: #64748b;
    text-align: center;
}

.aspro-asst-field label {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}
.aspro-asst-extra {
    padding: 0 0.75rem 0.5rem;
}
.aspro-asst-extra.hidden {
    display: none;
}
.aspro-asst-extra input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.aspro-asst-footer {
    padding: 0.5rem 0.75rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.aspro-asst-input {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}
.aspro-asst-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.aspro-asst-send {
    flex: 1;
    min-width: 8rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(95deg, #3b82f6, #7c3aed);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.aspro-asst-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.aspro-asst-hint {
    font-size: 0.68rem;
    color: #64748b;
    width: 100%;
}

.aspro-edit-btn {
    font-size: 0.75rem;
}

.aspro-asst-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    opacity: 0.35;
    background: linear-gradient(135deg, transparent 50%, #6366f1 50%);
    border-radius: 0 0 0.75rem 0;
}
.aspro-asst-resize:hover {
    opacity: 0.7;
}

.aspro-asst-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    padding: 0.35rem 0.75rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.aspro-asst-capabilities.hidden {
    display: none;
}
.aspro-asst-cap-item {
    font-size: 0.68rem;
    color: #94a3b8;
    cursor: pointer;
}

.aspro-asst-toolbar {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    align-items: center;
}
.aspro-asst-toolbar.hidden {
    display: none;
}
.aspro-asst-select {
    flex: 1;
    font-size: 0.72rem;
    background: #0f172a;
    border: 1px solid #475569;
    color: #e2e8f0;
    border-radius: 0.35rem;
    padding: 0.25rem;
}
.aspro-asst-mini {
    font-size: 0.68rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #475569;
    background: #1e293b;
    color: #cbd5e1;
    border-radius: 0.35rem;
    cursor: pointer;
}
.aspro-asst-mini:hover {
    border-color: #6366f1;
}

.aspro-asst-data,
.aspro-asst-knowledge {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
}
.aspro-asst-data.hidden,
.aspro-asst-knowledge.hidden {
    display: none;
}
.aspro-asst-input-sm {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 0.35rem;
    padding: 0.35rem;
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-bottom: 0.35rem;
}
.aspro-asst-preview {
    max-height: 160px;
    overflow: auto;
    font-size: 0.72rem;
    margin-top: 0.5rem;
}
.aspro-asst-preview.hidden {
    display: none;
}
.aspro-asst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}
.aspro-asst-table th,
.aspro-asst-table td {
    border: 1px solid #334155;
    padding: 0.2rem 0.35rem;
    text-align: left;
}

.aspro-asst-know-list {
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}
.aspro-asst-know-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aspro-asst-confirm {
    font-size: 0.72rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.aspro-asst-confirm.hidden {
    display: none;
}

.aspro-asst-messages {
    max-height: none;
}

.aspro-asst-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem 0;
}
.aspro-asst-chips.hidden {
    display: none;
}
.aspro-chip {
    font-size: 0.68rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    background: rgba(14, 116, 144, 0.18);
    color: #a5f3fc;
    cursor: pointer;
    transition: 0.15s;
}
.aspro-chip:hover {
    background: rgba(34, 211, 238, 0.22);
    border-color: rgba(34, 211, 238, 0.55);
}
.aspro-asst-panel {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(34, 211, 238, 0.08);
}
.aspro-asst-fab {
    background: linear-gradient(135deg, #06b6d4, #6366f1);
}

.aspro-asst-guide-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem 0;
}
.aspro-guide-here-btn {
    border-color: rgba(34, 211, 238, 0.45) !important;
    color: #a5f3fc !important;
}

.aspro-guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 12050;
    pointer-events: none;
}
.aspro-guide-overlay.hidden {
    display: none;
}
.aspro-guide-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    pointer-events: auto;
}
.aspro-guide-spotlight {
    position: fixed;
    border: 2px solid rgba(56, 189, 248, 0.95);
    border-radius: 0.65rem;
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.55), 0 0 24px rgba(56, 189, 248, 0.35);
    pointer-events: none;
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.aspro-guide-tooltip {
    position: fixed;
    z-index: 12051;
    width: min(20rem, calc(100vw - 24px));
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    pointer-events: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.aspro-guide-tooltip__step {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 0.35rem;
}
.aspro-guide-tooltip__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #7dd3fc;
}
.aspro-guide-tooltip__body {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #cbd5e1;
    margin: 0 0 0.65rem;
}
.aspro-guide-tooltip__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.aspro-guide-tooltip--has-target::after {
    content: '';
    position: absolute;
    left: 1.5rem;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid rgba(56, 189, 248, 0.85);
    top: -10px;
}
.aspro-guide-tooltip--has-target.aspro-guide-tooltip--above::after {
    top: auto;
    bottom: -10px;
    border-bottom: none;
    border-top: 10px solid rgba(56, 189, 248, 0.85);
}

.aspro-asst-msg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.15rem 0 0.65rem 0.35rem;
}

.aspro-asst-action-btn {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(110, 231, 255, 0.35);
    background: rgba(59, 130, 246, 0.18);
    color: #e2e8f0;
    cursor: pointer;
}

.aspro-asst-action-btn:hover {
    background: rgba(59, 130, 246, 0.32);
}

body.haze-workspace .aspro-asst-action-btn {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text);
}

body.haze-workspace .aspro-asst-action-btn:hover {
    background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.aspro-guide-go-btn:not(.hidden) {
    border-color: rgba(110, 231, 255, 0.45);
    background: rgba(16, 185, 129, 0.22);
}
