

@media (max-width: 1400px) {
    .ai-chat-grid {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .ai-chat-grid {
        flex-direction: column;
    }
}

.ai-chat-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--alpha-white-10);
}

.ai-chat-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-header {
    background: var(--gradient-secondary);
    color: var(--white);
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 22px;
    font-family: 'Outfit', sans-serif;
}

@media (max-width: 600px) {
    .modern-chat-input .input-wrapper input {
        padding: 12px 44px 12px 12px;
        font-size: 14px;
    }
    .modern-chat-input .input-wrapper button {
        font-size: 1.2em;
        right: 6px;
    }
}

.ai-chat-grid {
    display: grid;
    gap: 20px;
}

.ai-chat-container {
    min-height: 520px;
}

.ai-chat-container .chat-header {
    gap: 8px;
}

@media (max-width: 1024px) {
    .ai-chat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ai-chat-container {
        min-height: 440px;
    }
}

.auth-block {
    max-width: 370px;
    margin: 0 auto;
    border-radius: var(--radius-2xl);
    box-shadow: 0 8px 32px var(--alpha-primary-13);
    background: var(--bg-card);
    padding: 0;
}

.message {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.bot {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 18px 24px;
    border-radius: var(--radius-3xl);
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}

.message.bot .message-bubble {
    background: var(--bg-light);
    color: var(--text-primary);
    border-top-left-radius: 5px;
    box-shadow: var(--shadow-sm);
}

.message.user .message-bubble {
    background: var(--gradient-primary);
    color: var(--white);
    border-top-right-radius: 5px;
    box-shadow: 0 6px 15px var(--alpha-primary-30);
}

.chat-bubble-text {
    width: 100%;
}

.chat-message-media-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    max-width: 70%;
}

.chat-media-square {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: var(--bg-light);
    border: 1px solid var(--alpha-black-08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.chat-media-square.image-square {
    padding: 0;
}

.dark-theme .chat-media-square {
    background: var(--alpha-white-04);
    border-color: var(--alpha-white-08);
}

.chat-media-square-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.chat-media-square span.material-icons-round {
    font-size: 24px;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.chat-media-square-filename {
    font-size: 9px;
    text-align: center;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    line-height: 1.25;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 2px;
}

.chat-media-square.chapter-square {
    background: var(--alpha-37-99-235-05);
    border-color: var(--alpha-37-99-235-15);
}

.dark-theme .chat-media-square.chapter-square {
    background: var(--alpha-37-99-235-10);
    border-color: var(--alpha-color-37-99-235-25);
}

.scope-plus-btn span {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.scope-plus-btn.active span {
    transform: rotate(135deg);
}

.modern-chat-input {
    position: relative;
    width: 100%;
}

.modern-chat-input .input-wrapper {
    background: var(--bg-light);
    border: 2px solid var(--bg-light);
    border-radius: 28px;
    padding: 8px 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    display: grid;
    box-sizing: border-box;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.modern-chat-input .input-wrapper.single-line {
    grid-template-areas: "left main right";
    grid-template-columns: auto 1fr auto;
    align-items: center;
}

.modern-chat-input .input-wrapper.single-line.has-preview {
    grid-template-areas: 
        "preview preview preview"
        "left main right";
}

.modern-chat-input .input-wrapper.multi-line {
    grid-template-areas: "main main" "left right";
    grid-template-columns: 1fr auto;
    align-items: end;
    border-radius: 20px;
}

.modern-chat-input .input-wrapper.multi-line.has-preview {
    grid-template-areas: 
        "preview preview"
        "main main"
        "left right";
}

.modern-chat-input .input-wrapper.focused {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--alpha-37-99-235-15);
    background: var(--white);
}

.dark-theme .modern-chat-input .input-wrapper.focused {
    background: var(--slate-950);
}

.modern-chat-input .input-main-row {
    grid-area: main;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.modern-chat-input .controls-left {
    grid-area: left;
    display: flex;
    align-items: center;
}

.modern-chat-input .controls-right {
    grid-area: right;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-chat-input textarea {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 6px 0;
    margin: 0;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    resize: none;
    max-height: 150px;
    overflow-y: hidden;
    line-height: 1.5;
    display: block;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--alpha-slate-400-55) transparent;
}

.modern-chat-input textarea::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modern-chat-input textarea::-webkit-scrollbar-track {
    background: transparent;
}

.modern-chat-input textarea::-webkit-scrollbar-thumb {
    background: var(--alpha-slate-400-55);
    border-radius: 4px;
}

.modern-chat-input textarea::-webkit-scrollbar-thumb:hover {
    background: var(--alpha-slate-400-75);
}

.selected-badge {
    display: inline-flex;
    align-items: center;
    background: var(--alpha-37-99-235-08);
    border: 1px solid var(--alpha-color-37-99-235-18);
    color: var(--accent-blue);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
    max-width: 180px;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
}

.selected-badge .badge-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.selected-badge.hidden {
    display: none;
}

.selected-badge .remove-badge-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--accent-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.modern-chat-input .input-wrapper button {
    position: static;
    transform: none;
    right: auto;
    top: auto;
    z-index: auto;
    background: none;
    border: none;
    padding: 6px;
    margin: 0;
    color: var(--accent-blue);
    font-size: 1.35em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
    outline: none;
}

.modern-chat-input .input-wrapper button:hover {
    background: var(--alpha-37-99-235-08);
}

.modern-chat-input .input-wrapper #tutor-live-btn {
    color: var(--accent-green);
}

.modern-chat-input .input-wrapper #tutor-live-btn:hover {
    background: var(--alpha-22-163-74-08);
}

.scope-popup {
    position: absolute;
    bottom: 84px;
    left: 20px;
    width: 240px;
    background: var(--alpha-255-255-255-85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--alpha-255-255-255-50);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px var(--alpha-black-15);
    z-index: 1000;
    padding: 10px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.scope-popup.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.scope-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--alpha-black-08);
    padding-bottom: 6px;
}

.scope-popup-header span {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.scope-popup-header .close-popup-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
}

.scope-popup-header .close-popup-btn:hover {
    background: var(--shadow-sm);
}

.scope-popup-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.scope-popup-body::-webkit-scrollbar {
    width: 6px;
}

.scope-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.scope-popup-body::-webkit-scrollbar-thumb {
    background: var(--alpha-black-15);
    border-radius: 3px;
}

.scope-popup-body::-webkit-scrollbar-thumb:hover {
    background: var(--shadow-2xl);
}

.dark-theme .scope-popup-body::-webkit-scrollbar-thumb {
    background: var(--alpha-white-20);
}

.dark-theme .scope-popup-body::-webkit-scrollbar-thumb:hover {
    background: var(--alpha-255-255-255-35);
}

.popup-selector-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-selector-group.hidden-block {
    display: none;
}

.popup-selector-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.popup-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--alpha-black-12);
    background: var(--white);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.popup-select:focus {
    border-color: var(--accent-blue);
}

.popup-select:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

.dark-theme .scope-popup {
    background: var(--alpha-30-41-59-85);
    border: 1px solid var(--alpha-white-10);
    box-shadow: 0 10px 30px var(--alpha-black-30);
}

.dark-theme .scope-popup-header {
    border-bottom: 1px solid var(--alpha-white-10);
}

.dark-theme .scope-popup-header span {
    color: var(--white);
}

.dark-theme .popup-select {
    background: var(--slate-950);
    border-color: var(--alpha-white-15);
    color: var(--white);
}

.dark-theme .popup-select:disabled {
    background: var(--slate-800);
    color: var(--slate-500);
}

.selector-block {
    margin-bottom: 16px;
}

.selector-title {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.hidden-block {
    display: none !important;
}

.msg-heading {
    font-weight: 800;
    margin: 6px 0;
    color: var(--slate-950);
}

.msg-heading.h1 {
    font-size: 1.05rem;
}

.msg-heading.h2 {
    font-size: 1.02rem;
}

.msg-heading.h3 {
    font-size: 1rem;
}

.msg-list {
    margin: 6px 0 10px 14px;
    padding: 0 0 0 8px;
}

.msg-list li {
    margin: 4px 0;
    line-height: 1.4;
}

.msg-paragraph {
    margin: 4px 0;
    line-height: 1.5;
}

.dark-theme .selector-title {
    color: var(--slate-200);
    font-weight: 600;
}

.tutor-feature-card { min-height: 100%; }

.tutor-intro-p { margin-bottom: 14px; }

.tutor-action-row { display: flex; gap: 12px; margin-top: 18px; }

.tutor-disclaimer { margin-top: 18px; }

.live-tutor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--alpha-241-245-249-85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.live-tutor-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.live-tutor-container {
    background: var(--bg-sidebar);
    border: 1px solid var(--alpha-black-08);
    box-shadow: 0 24px 50px var(--alpha-black-15);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 700px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    position: relative;
}

.live-status-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--shadow-sm);
    border: 1px solid var(--alpha-black-08);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}

.dark-theme .live-tutor-overlay {
    background: var(--alpha-15-23-42-85);
}

.dark-theme .live-tutor-container {
    background: var(--alpha-30-41-59-70);
    border: 1px solid var(--alpha-white-10);
    box-shadow: 0 24px 50px var(--alpha-0-0-0-50);
}

.dark-theme .live-status-badge {
    background: var(--alpha-white-08);
    border: 1px solid var(--alpha-white-10);
    color: var(--white);
}

.live-status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-red);
}

.live-status-badge.connected .live-status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.live-audio-waves {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
}

.live-wave {
    width: 3px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 3px;
    animation: waveBounce 0.8s ease-in-out infinite alternate;
}

.live-wave:nth-child(2) {
    animation-delay: 0.15s;
}

.live-wave:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes waveBounce {
    0% { height: 3px; }
    100% { height: 14px; }
}

.live-video-viewport {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--alpha-241-245-249-90);
    border: 1px solid var(--alpha-black-08);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-theme .live-video-viewport {
    background: var(--alpha-slate-950-60);
    border: 1px solid var(--alpha-white-08);
}

.live-video-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-video-viewport video.mirrored {
    transform: scaleX(-1);
}

.live-video-placeholder, .live-paused-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-secondary);
    background: var(--alpha-248-250-252-95);
    z-index: 2;
}

.dark-theme .live-video-placeholder,
.dark-theme .live-paused-overlay {
    color: var(--alpha-255-255-255-40);
    background: var(--alpha-15-23-42-85);
}

.live-video-placeholder i, .live-paused-overlay i {
    font-size: 48px;
}

.live-video-placeholder p, .live-paused-overlay span {
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

.live-paused-overlay {
    display: none;
}

.live-paused-overlay.active {
    display: flex;
}

.live-controls-bar {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.live-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--shadow-sm);
    border: 1px solid var(--alpha-black-08);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.live-control-btn:hover {
    background: var(--shadow-md);
    transform: translateY(-2px);
}

.dark-theme .live-control-btn {
    background: var(--alpha-white-08);
    border: 1px solid var(--alpha-white-10);
    color: var(--white);
}

.dark-theme .live-control-btn:hover {
    background: var(--alpha-white-20);
}

.live-control-btn.muted {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.live-control-btn.muted:hover {
    background: var(--danger-alt);
}

.live-control-btn.active {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.live-control-btn.active:hover {
    background: var(--success-dark);
}

.live-control-btn.btn-danger-live {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

.live-control-btn.btn-danger-live:hover {
    background: var(--danger-alt);
    border-color: var(--danger-alt);
}

.live-stream-switcher {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    background: var(--alpha-15-23-42-70);
    border: 1px solid var(--alpha-white-15);
    padding: 4px;
    border-radius: 30px;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.switch-view-btn {
    border: none;
    background: none;
    color: var(--alpha-255-255-255-60);
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
}

.switch-view-btn:hover {
    color: var(--white);
}

.switch-view-btn.active {
    background: var(--accent-blue);
    color: var(--white);
}

@media (max-width: 640px) {
    .live-stream-switcher {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .live-control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .live-controls-bar {
        gap: 10px;
    }
    .modern-chat-input textarea {
        font-size: 13px;
    }
    .modern-chat-input .input-wrapper button {
        font-size: 1.25em;
    }
    .chat-header h3 {
        font-size: 16px;
    }
    .message-bubble {
        font-size: 13px;
    }
}

.input-media-preview-row {
    grid-area: preview;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.tutor-attachments-container:empty {
    display: none;
}

.input-media-preview-row:has(.tutor-attachment-pill),
.input-media-preview-row:has(.selected-badge:not(.hidden)) {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--shadow-sm);
}

.dark-theme .input-media-preview-row:has(.tutor-attachment-pill),
.dark-theme .input-media-preview-row:has(.selected-badge:not(.hidden)) {
    border-bottom-color: var(--alpha-white-08);
}

.popup-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    text-align: left;
    outline: none;
}

.popup-menu-item:hover {
    background: var(--shadow-sm);
}

.dark-theme .popup-menu-item {
    color: var(--white);
}

.dark-theme .popup-menu-item:hover {
    background: var(--alpha-white-08);
}

.popup-menu-item .material-icons-round {
    color: var(--accent-blue);
    font-size: 18px;
}

.scope-popup-header .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-popup-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
}

.back-popup-btn:hover {
    background: var(--shadow-sm);
}

.dark-theme .back-popup-btn {
    color: var(--alpha-255-255-255-60);
}

.dark-theme .back-popup-btn:hover {
    background: var(--alpha-white-08);
}

.tutor-attachments-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-right: 4px;
}

.tutor-attachment-pill {
    display: inline-flex;
    align-items: center;
    background: var(--alpha-black-04);
    border: 1px solid var(--alpha-black-08);
    border-radius: 16px;
    padding: 4px 8px;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    gap: 6px;
    max-width: 160px;
    box-sizing: border-box;
}

.dark-theme .tutor-attachment-pill {
    background: var(--alpha-white-06);
    border-color: var(--alpha-255-255-255-12);
    color: var(--white);
}

.tutor-attachment-pill img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.tutor-attachment-pill .file-icon {
    font-size: 18px;
    color: var(--accent-blue);
}

.tutor-attachment-pill .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-weight: 500;
}

.tutor-attachment-pill .remove-file-btn,
.selected-badge .remove-badge-btn {
    background: none;
    border: none;
    padding: 2px;
    margin: 0;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tutor-attachment-pill .remove-file-btn:hover,
.selected-badge .remove-badge-btn:hover {
    background: var(--alpha-danger-12);
    color: var(--danger-dark);
}

.tutor-attachment-pill .remove-file-btn .material-icons-round,
.selected-badge .remove-badge-btn .material-icons-round {
    font-size: 13px;
}

.dark-theme .tutor-attachment-pill .remove-file-btn,
.dark-theme .selected-badge .remove-badge-btn {
    color: var(--color-fca5a5);
}

.dark-theme .tutor-attachment-pill .remove-file-btn:hover,
.dark-theme .selected-badge .remove-badge-btn:hover {
    background: var(--alpha-239-68-68-20);
    color: var(--color-fecaca);
}

.popup-menu-option-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--alpha-black-08);
    background: var(--white);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    outline: none;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.popup-menu-option-btn:hover {
    background: var(--alpha-37-99-235-05);
    border-color: var(--alpha-blue-600-20);
    color: var(--accent-blue);
}

.popup-menu-option-btn.active {
    background: var(--alpha-37-99-235-08);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.dark-theme .popup-menu-option-btn {
    background: var(--slate-950);
    border-color: var(--alpha-white-10);
    color: var(--white);
}

.dark-theme .popup-menu-option-btn:hover {
    background: var(--alpha-37-99-235-15);
    border-color: var(--accent-blue);
}

.dark-theme .popup-menu-option-btn.active {
    background: var(--alpha-blue-600-20);
    border-color: var(--accent-blue);
}

.popup-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
}

.dark-theme .popup-loading {
    color: var(--alpha-255-255-255-60);
}

@media (max-width: 768px) {
    .scope-popup {
        width: 200px;
        padding: 8px;
        max-width: calc(100vw - 32px);
    }
    
    .popup-menu-item {
        padding: 6px 10px;
        font-size: 12px;
        gap: 8px;
    }
    
    .popup-menu-item span {
        font-size: 12px;
    }
    
    .popup-menu-item .material-icons-round {
        font-size: 16px;
    }
    
    .scope-popup-header {
        padding: 6px 4px;
    }
    
    .scope-popup-header span {
        font-size: 12px;
    }
    
    .popup-menu-option-btn {
        padding: 6px 8px;
        font-size: 11px;
        margin-bottom: 4px;
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    height: 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}