/* Activity Identification & Tracking (AIT) panel */
#ait-panel.ait-wrap {
    position: absolute;
    z-index: 5200;
    /* Default min footprint until JS stacks under History plot or parks BR. */
    top: auto;
    right: 93px;
    bottom: 24px;
    width: 320px;
    height: 280px;
    min-width: 320px;
    min-height: 280px;
    padding: 4px 12px 12px 6px;
    display: none;
    flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #e2e8f0;
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.72) 0%, rgba(15, 23, 42, 0.86) 100%),
        rgba(11, 17, 28, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    overflow: hidden;
}

#ait-panel.ait-open {
    display: flex;
}

/* ADR 022: shared .plot-resize-handle edge+corner grips (style.css). */
#ait-panel .plot-resize-handle {
    z-index: 6;
    pointer-events: auto;
}

#ait-panel .ait-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: start;
    margin: 0 -12px 4px;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.10), rgba(148, 163, 184, 0));
    cursor: move;
}

#ait-panel .ait-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#ait-panel .ait-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#ait-panel .ait-btn {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(51, 65, 85, 0.45);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

#ait-panel .ait-btn--icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#ait-panel .ait-toolbar-group {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#ait-panel .ait-btn--toggle {
    white-space: nowrap;
}

#ait-panel .ait-btn:hover:not(:disabled) {
    border-color: rgba(125, 211, 252, 0.45);
    background: rgba(56, 189, 248, 0.12);
}

#ait-panel .ait-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

#ait-panel .ait-close {
    appearance: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#ait-panel .ait-close:hover {
    color: #f8fafc;
    background: rgba(148, 163, 184, 0.16);
}

#ait-panel .ait-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px 4px;
    flex-shrink: 0;
}

#ait-panel .ait-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
}

#ait-panel .ait-toolbar select {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
}

#ait-panel .ait-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 0 4px 6px;
    flex-shrink: 0;
}

#ait-panel .ait-crumb-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #7dd3fc;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}

#ait-panel .ait-crumb-btn:hover {
    background: rgba(56, 189, 248, 0.12);
}

#ait-panel .ait-crumb-sep {
    color: #64748b;
    font-size: 11px;
    padding: 0 2px;
}

#ait-panel .ait-status {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 4px 6px;
    min-height: 16px;
    flex-shrink: 0;
}

#ait-panel .ait-list {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0 4px 4px;
    margin: 0;
    list-style: none;
}

#ait-panel .ait-item {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(15, 23, 42, 0.35);
    cursor: pointer;
}

#ait-panel .ait-item:hover {
    border-color: rgba(125, 211, 252, 0.35);
    background: rgba(30, 41, 59, 0.55);
}

#ait-panel .ait-item.is-active {
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.10);
}

#ait-panel .ait-item.is-dim {
    opacity: 0.45;
}

#ait-panel .ait-item-type {
    font-size: 12px;
    font-weight: 600;
    color: #7dd3fc;
}

#ait-panel .ait-item.is-active .ait-item-type {
    color: #fbbf24;
}

#ait-panel .ait-item-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

#ait-panel .ait-empty {
    font-size: 12px;
    color: #64748b;
    padding: 16px 8px;
    text-align: center;
}
