#mrt-ai-coach-preview {
    width: 100%;
    margin: 0 auto 20px;
}

/* Widget Card */
#mrt-ai-coach-preview .mrt-ai-coach-widget {
    border-radius: 18px;
    padding: 20px;
    background: #ffffff;
    border: none;
    position: relative;
    box-shadow: none;
    transition: border 0.3s ease;
}

#mrt-ai-coach-preview .mrt-ai-coach-widget.active {
    background: #ffffff;
    box-shadow: none;
    animation: aiCoachBreathing 3s ease-in-out infinite;
}

/* Phase-specific breathing */
#mrt-ai-coach-preview .mrt-ai-coach-widget.active.phase-strength {
    box-shadow: none;
    animation: aiBreathingStrength 3s ease-in-out infinite;
}

#mrt-ai-coach-preview .mrt-ai-coach-widget.active.phase-hypertrophy {
    box-shadow: none;
    animation: aiBreathingHypertrophy 3s ease-in-out infinite;
}

#mrt-ai-coach-preview .mrt-ai-coach-widget.active.phase-endurance {
    box-shadow: none;
    animation: aiBreathingEndurance 3s ease-in-out infinite;
}

@keyframes aiCoachBreathing {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes aiBreathingStrength {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes aiBreathingHypertrophy {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes aiBreathingEndurance {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

/* Clickable Header */
#mrt-ai-coach-preview .mrt-ai-coach-header {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

#mrt-ai-coach-preview .mrt-ai-coach-title-section {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

#mrt-ai-coach-preview .mrt-ai-coach-title-content {
    flex: 1;
    min-width: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-title-content h3 {
    margin: 0 0 5px 3px;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 1.25em;
    color: #667eea;
    line-height: 1.3;
}

/* Status Indicator */
#mrt-ai-coach-preview .mrt-ai-coach-status-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

#mrt-ai-coach-preview .mrt-ai-coach-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-ready {
    margin-left: 3px;
    background: #4caf50;
    box-shadow: none;
}

#mrt-ai-coach-preview .mrt-ai-coach-analyzing {
    margin-left: 3px;
    background: #667eea;
    box-shadow: none;
    animation: coachPulse 1.2s ease-in-out infinite;
}

#mrt-ai-coach-preview .mrt-ai-coach-tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

#mrt-ai-coach-preview
    .mrt-ai-coach-status-tooltip:hover
    .mrt-ai-coach-tooltip-text {
    display: block;
}

/* Context Badge */
#mrt-ai-coach-preview .mrt-ai-coach-context-badge {
    margin-top: 2px;
    padding-left: 4px;
}

#mrt-ai-coach-preview .mrt-ai-coach-context-badge small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #667eea;
    font-size: 0.8em;
}

#mrt-ai-coach-preview .mrt-ai-coach-context-badge svg {
    color: #0082fc;
    flex-shrink: 0;
}

/* Toggle Icon */
#mrt-ai-coach-preview .mrt-ai-coach-toggle-icon {
    color: #667eea;
    font-size: 0.9em;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 4px;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-widget.active .mrt-ai-coach-toggle-icon {
    transform: rotate(0deg);
    color: #764ba2;
    opacity: 1;
}

.mrt-ai-coach-toggle-icon svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
}

#mrt-ai-coach-preview
    .mrt-ai-coach-widget.active
    .mrt-ai-coach-toggle-icon
    svg {
    transform: rotate(0deg);
}

/* Mode Tabs */
#mrt-ai-coach-preview .mrt-ai-coach-tabs {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    padding: 8px 4px 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 10px,
        black 90%,
        transparent
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 10px,
        black 90%,
        transparent
    );
}

#mrt-ai-coach-preview .mrt-ai-coach-tab::before {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #667eea;
    opacity: 0;
    transition: all 0.3s ease;
}

#mrt-ai-coach-preview .mrt-ai-coach-tab.open::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

#mrt-ai-coach-preview .mrt-ai-coach-tab:first-child {
    margin-left: auto;
}

#mrt-ai-coach-preview .mrt-ai-coach-tab:last-child {
    margin-right: auto;
}

#mrt-ai-coach-preview .mrt-ai-coach-tabs::-webkit-scrollbar {
    display: none;
}

#mrt-ai-coach-preview .mrt-ai-coach-tab {
    position: relative;
    flex: 0 0 auto;
    padding: 8px 20px;
    min-height: 44px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.6);
    color: #5a6b8c;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
    outline: none;
    font-family: inherit;
    line-height: 1.2;
}

#mrt-ai-coach-preview .mrt-ai-coach-tab:hover {
    color: #667eea;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
    box-shadow: none;
}

#mrt-ai-coach-preview .mrt-ai-coach-tab:active {
    transform: scale(0.96);
}

#mrt-ai-coach-preview .mrt-ai-coach-tab.preselected {
    border-color: rgba(102, 126, 234, 0.6);
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    font-weight: 600;
}

#mrt-ai-coach-preview .mrt-ai-coach-tab.open {
    background: linear-gradient(135deg, #4f33ff 0%, #3b1fe0 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* Content Area */
#mrt-ai-coach-preview .mrt-ai-coach-content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        margin 0.3s ease;
    margin: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-widget.active .mrt-ai-coach-content {
    max-height: 900px;
    opacity: 1;
    margin: 15px 0;
}

/* Loading State */
#mrt-ai-coach-preview .mrt-ai-coach-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.08) 0%,
        rgba(118, 75, 162, 0.08) 100%
    );
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 8px;
    animation: coachFadeIn 0.3s ease;
}

@keyframes coachFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mrt-ai-coach-preview .mrt-ai-coach-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: coachPulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes coachPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.7;
    }
}

#mrt-ai-coach-preview .mrt-ai-coach-loading-text {
    font-size: 0.9em;
    color: #5a6b8c;
}

#mrt-ai-coach-preview .mrt-ai-coach-loading.retrying {
    background: linear-gradient(
        135deg,
        rgba(255, 193, 7, 0.15) 0%,
        rgba(255, 152, 0, 0.15) 100%
    );
    border-color: rgba(255, 193, 7, 0.3);
}

#mrt-ai-coach-preview .mrt-ai-coach-loading.retrying .mrt-ai-coach-spinner {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

/* Message Area */
#mrt-ai-coach-preview .mrt-ai-coach-message {
    font-size: 0.95em;
    line-height: 1.6;
    color: #334155;
}

#mrt-ai-coach-preview .mrt-ai-coach-message p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    font-size: 0.95em;
}

#mrt-ai-coach-preview .mrt-ai-coach-message p:last-child {
    margin-bottom: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-message strong {
    color: #1e293b;
    font-weight: 700;
}

#mrt-ai-coach-preview .mrt-ai-coach-message em {
    font-style: italic;
    opacity: 0.9;
}

#mrt-ai-coach-preview .mrt-ai-coach-message ol,
#mrt-ai-coach-preview .mrt-ai-coach-message ul {
    margin: 12px 0;
    padding-left: 22px;
}

#mrt-ai-coach-preview .mrt-ai-coach-message li {
    margin-bottom: 6px;
    line-height: 1.6;
    font-size: 1em;
}

#mrt-ai-coach-preview .mrt-ai-coach-message li:last-child {
    margin-bottom: 0;
}

/* Footer */
#mrt-ai-coach-preview .mrt-ai-coach-footer {
    font-size: 0.8em;
    color: #64748b;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.3s ease,
        opacity 0.3s ease,
        margin 0.3s ease;
    margin: 0;
    border: none;
    padding: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-widget.active .mrt-ai-coach-footer {
    max-height: 60px;
    opacity: 0.6;
    margin-top: 15px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

/* Blur Reveal Animation */
@keyframes coachBlurReveal {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(8px) scale(0.98);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

#mrt-ai-coach-preview .coach-reveal-item {
    opacity: 0;
    animation: coachBlurReveal 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Dark Mode */
html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-widget {
    background: var(--maxreptracker-dark-bg, #1a1a1a);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-widget.active {
    background: var(--maxreptracker-dark-bg, #1a1a1a) !important;
    box-shadow: none !important;
    animation: aiBreathingDarkDefault 3s ease-in-out infinite !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-widget.active.phase-strength {
    background: var(--maxreptracker-dark-bg, #1a1a1a) !important;
    box-shadow: none !important;
    animation: aiBreathingDarkStrength 3s ease-in-out infinite !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-widget.active.phase-hypertrophy {
    background: var(--maxreptracker-dark-bg, #1a1a1a) !important;
    box-shadow: none !important;
    animation: aiBreathingDarkHypertrophy 3s ease-in-out infinite !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-widget.active.phase-endurance {
    background: var(--maxreptracker-dark-bg, #1a1a1a) !important;
    box-shadow: none !important;
    animation: aiBreathingDarkEndurance 3s ease-in-out infinite !important;
}

@keyframes aiBreathingDarkDefault {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes aiBreathingDarkStrength {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes aiBreathingDarkHypertrophy {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

@keyframes aiBreathingDarkEndurance {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: none;
    }
}

html.maxreptracker-dark-mode-enabled #mrt-ai-coach-preview .mrt-ai-coach-tabs {
    color: #94a3b8;
}

html.maxreptracker-dark-mode-enabled #mrt-ai-coach-preview .mrt-ai-coach-tab {
    background: rgba(30, 30, 45, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    box-shadow: none;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-tab.preselected {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.12),
        rgba(102, 126, 234, 0.12)
    ) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    color: #a3bffa !important;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-tab.open {
    background: linear-gradient(135deg, #4f33ff 0%, #3b1fe0 100%);
    color: #fff;
    border-color: transparent;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-message {
    color: rgba(255, 255, 255, 0.8);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-message
    strong {
    color: rgba(255, 255, 255, 0.9);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-widget.active
    .mrt-ai-coach-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-loading-text {
    color: #94a3b8;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-loading.retrying {
    background: linear-gradient(
        135deg,
        rgba(255, 193, 7, 0.1) 0%,
        rgba(255, 152, 0, 0.1) 100%
    );
    border-color: rgba(255, 193, 7, 0.2);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #mrt-ai-coach-preview .mrt-ai-coach-widget.active,
    #mrt-ai-coach-preview .mrt-ai-coach-widget.active.phase-strength,
    #mrt-ai-coach-preview .mrt-ai-coach-widget.active.phase-hypertrophy,
    #mrt-ai-coach-preview .mrt-ai-coach-widget.active.phase-endurance {
        animation: none;
    }

    #mrt-ai-coach-preview .mrt-ai-coach-toggle-icon svg {
        transition: none;
        transform: none;
    }

    #mrt-ai-coach-preview
        .mrt-ai-coach-widget.active
        .mrt-ai-coach-toggle-icon
        svg {
        transform: none;
    }

    #mrt-ai-coach-preview .coach-reveal-item {
        animation: none;
        opacity: 1;
    }

    #mrt-ai-coach-preview .mrt-ai-coach-spinner {
        animation: none;
        opacity: 0.7;
    }

    #mrt-ai-coach-preview .mrt-ai-coach-content,
    #mrt-ai-coach-preview .mrt-ai-coach-footer {
        transition: none;
    }
}

/* ── Chat CTA (Try the Chat) ── */
#mrt-ai-coach-preview .mrt-ai-coach-chat-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 14px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.04);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        border-color 0.25s ease,
        background 0.25s ease;
}

#mrt-ai-coach-preview .mrt-ai-coach-chat-cta:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.08);
    box-shadow: none;
}

#mrt-ai-coach-preview .mrt-ai-coach-chat-cta:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

#mrt-ai-coach-preview .mrt-ai-coach-chat-cta svg {
    color: #667eea;
    flex-shrink: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-chat-cta-text-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

#mrt-ai-coach-preview .mrt-ai-coach-chat-cta-text {
    font-weight: 600;
    font-size: 0.9em;
    color: #667eea;
    line-height: 1.3;
}

#mrt-ai-coach-preview .mrt-ai-coach-chat-cta-hint {
    font-weight: 400;
    font-size: 0.75em;
    color: #94a3b8;
    line-height: 1.3;
}

/* ── Demo Chat Overlay ── */
.mrt-ai-coach-demo-overlay {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: none;
    background: #ffffff;
    color: #334155;
    overflow: hidden;
    box-sizing: border-box;
}

.mrt-ai-coach-demo-overlay[open] {
    display: flex;
    flex-direction: column;
    animation: mrt-coach-demo-in 0.25s ease both;
}

.mrt-ai-coach-demo-overlay[open]::backdrop {
    background: rgba(0, 0, 0, 0.5);
    animation: mrt-coach-demo-fade 0.25s ease both;
}

@keyframes mrt-coach-demo-in {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes mrt-coach-demo-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Demo header */
.mrt-ai-coach-demo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    min-height: 52px;
    flex-shrink: 0;
    background: #ffffff;
}

.mrt-ai-coach-demo-title {
    flex: 1;
    font-weight: 600;
    font-size: 1em;
    color: #334155;
}

.mrt-ai-coach-demo-session-toggle,
.mrt-ai-coach-demo-close {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mrt-ai-coach-demo-session-toggle:hover,
.mrt-ai-coach-demo-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #334155;
}

.mrt-ai-coach-demo-session-toggle:focus-visible,
.mrt-ai-coach-demo-close:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Demo body (sessions + main) */
.mrt-ai-coach-demo-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

.mrt-ai-coach-demo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.mrt-ai-coach-demo-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    gap: 8px;
    overscroll-behavior: contain;
}

/* Sessions sidebar */
.mrt-ai-coach-demo-sessions {
    width: 260px;
    flex-shrink: 0;
    background: #fafbfc;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease, min-width 0.25s ease;
}

.mrt-ai-coach-demo-sessions.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
}

.mrt-ai-coach-demo-sessions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
}

.mrt-ai-coach-demo-new-chat {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 4px;
    border-radius: 6px;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mrt-ai-coach-demo-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mrt-ai-coach-demo-session {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.mrt-ai-coach-demo-session:hover {
    background: rgba(102, 126, 234, 0.06);
}

.mrt-ai-coach-demo-session.active {
    background: rgba(102, 126, 234, 0.1);
}

.mrt-ai-coach-demo-session-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.mrt-ai-coach-demo-session-title {
    font-size: 0.85em;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrt-ai-coach-demo-session.active .mrt-ai-coach-demo-session-title {
    color: #667eea;
    font-weight: 600;
}

.mrt-ai-coach-demo-session-time {
    font-size: 0.7em;
    color: #94a3b8;
}

.mrt-ai-coach-demo-session-actions {
    display: none;
    flex-shrink: 0;
    gap: 2px;
}

.mrt-ai-coach-demo-session:hover .mrt-ai-coach-demo-session-actions,
.mrt-ai-coach-demo-session.active .mrt-ai-coach-demo-session-actions {
    display: flex;
}

.mrt-ai-coach-demo-session-action {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 4px;
    border-radius: 4px;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mrt-ai-coach-demo-session.active .mrt-ai-coach-demo-session-action {
    color: #818cf8;
}

/* Sessions backdrop (mobile only — covers main when sidebar open) */
.mrt-ai-coach-demo-sessions-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.mrt-ai-coach-demo-msg {
    max-width: 88%;
    padding: 10px 14px;
    line-height: 1.5;
    font-size: 0.9em;
    animation: mrt-coach-demo-msg-in 0.25s ease both;
}

.mrt-ai-coach-demo-msg p {
    margin: 0;
}

.mrt-ai-coach-demo-msg p + p {
    margin-top: 6px;
}

.mrt-ai-coach-demo-msg-bot {
    background: #f1f5f9;
    color: #334155;
    border-radius: 16px 16px 16px 4px;
    margin-right: auto;
}

.mrt-ai-coach-demo-msg-user {
    background: #eef2ff;
    color: #334155;
    border-radius: 16px 16px 4px 16px;
    margin-left: auto;
    text-align: right;
}

.mrt-ai-coach-demo-msg-time {
    display: block;
    font-size: 0.65em;
    color: #94a3b8;
    margin-top: 4px;
    opacity: 0.7;
}

@keyframes mrt-coach-demo-msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Demo input area */
.mrt-ai-coach-demo-input-area {
    flex-shrink: 0;
    padding: 12px 20px max(16px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.mrt-ai-coach-demo-input-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mrt-ai-coach-demo-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    min-height: 42px;
    max-height: 120px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.9em;
    color: #334155;
    resize: none;
    box-sizing: border-box;
    cursor: not-allowed;
    opacity: 0.85;
}

.mrt-ai-coach-demo-input::placeholder {
    color: #94a3b8;
}

.mrt-ai-coach-demo-input:disabled {
    cursor: not-allowed;
}

.mrt-ai-coach-demo-mic,
.mrt-ai-coach-demo-send {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.mrt-ai-coach-demo-mic {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1.5px solid #e2e8f0;
}

.mrt-ai-coach-demo-send {
    background: linear-gradient(
        135deg,
        #4f33ff 0%,
        #3b1fe0 100%
    );
    color: #ffffff;
}

.mrt-ai-coach-demo-send:disabled {
    cursor: not-allowed;
    filter: saturate(0.6);
}

.mrt-ai-coach-demo-label {
    font-size: 0.7em;
    color: #94a3b8;
    text-align: center;
    margin-top: 10px;
    letter-spacing: 0.02em;
}

/* Demo overlay dark mode */
html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-overlay {
    background: #1a1a1a;
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-header {
    background: #1a1a1a;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-title {
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-close {
    color: #64748b;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-session-toggle {
    color: #64748b;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-session-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-body {
    background: #1a1a1a;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-sessions {
    background: #0f0f0f;
    border-right-color: rgba(255, 255, 255, 0.08);
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-sessions-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-new-chat {
    color: #64748b;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-session.active {
    background: rgba(102, 126, 234, 0.15);
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-session-title {
    color: #cbd5e1;
}

html.maxreptracker-dark-mode-enabled
    .mrt-ai-coach-demo-session.active
    .mrt-ai-coach-demo-session-title {
    color: #818cf8;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-session-time {
    color: #64748b;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-session:hover {
    background: rgba(102, 126, 234, 0.08);
}

html.maxreptracker-dark-mode-enabled
    .mrt-ai-coach-demo-session.active
    .mrt-ai-coach-demo-session-action {
    color: #a5b4fc;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-msg-bot {
    background: #2a2a2a;
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-msg-user {
    background: #312e81;
    color: #e0e7ff;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-input-area {
    background: #1a1a1a;
    border-top-color: rgba(255, 255, 255, 0.08);
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-input {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e2e8f0;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-input::placeholder {
    color: #64748b;
}

html.maxreptracker-dark-mode-enabled .mrt-ai-coach-demo-mic {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #64748b;
}

/* Demo overlay reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mrt-ai-coach-demo-overlay[open],
    .mrt-ai-coach-demo-overlay[open]::backdrop {
        animation: none;
    }

    .mrt-ai-coach-demo-msg {
        animation: none;
    }
}

/* CTA dark mode */
html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-chat-cta {
    border-color: rgba(102, 126, 234, 0.35);
    background: rgba(102, 126, 234, 0.06);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-chat-cta:hover {
    border-color: rgba(102, 126, 234, 0.7);
    background: rgba(102, 126, 234, 0.12);
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-chat-cta-text {
    color: #818cf8;
}

html.maxreptracker-dark-mode-enabled
    #mrt-ai-coach-preview
    .mrt-ai-coach-chat-cta-hint {
    color: #64748b;
}

/* Demo overlay responsive */
body.mrt-coach-demo-overlay-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .mrt-ai-coach-demo-sessions {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 3;
        width: 280px;
    }

    .mrt-ai-coach-demo-sessions.collapsed {
        width: 0;
    }

    .mrt-ai-coach-demo-sessions-backdrop {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .mrt-ai-coach-demo-body:not(.sessions-collapsed)
        .mrt-ai-coach-demo-sessions-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 480px) {
    .mrt-ai-coach-demo-header {
        padding: 10px 12px;
        min-height: 48px;
    }

    .mrt-ai-coach-demo-messages {
        padding: 12px 14px;
    }

    .mrt-ai-coach-demo-input-area {
        padding: 10px 14px max(14px, env(safe-area-inset-bottom, 0px));
    }
}

/* Responsive */
@media (max-width: 768px) {
    #mrt-ai-coach-preview .mrt-ai-coach-widget {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    #mrt-ai-coach-preview .mrt-ai-coach-tab {
        font-size: 0.8em;
        padding: 8px 15px;
    }

    #mrt-ai-coach-preview .mrt-ai-coach-footer {
        font-size: 0.75em;
    }

    #mrt-ai-coach-preview .mrt-ai-coach-content {
        font-size: 0.95em;
    }
}
