/* ==========================================================================
   ECF MEMBER PORTAL - PREMIUM DESIGN SYSTEM
   Principles: Restraint, Strong Hierarchy, Deliberate Spacing, Calm Data
   ========================================================================== */

:root {
    /* Muted, Restrained Neutral Base */
    --bg-app: #f4f5f7;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f9fafb;

    /* Typography Colors (High Contrast) */
    --text-primary: #111827;
    /* Deepest Slate/Ink */
    --text-secondary: #4b5563;
    /* Calm metadata */
    --text-tertiary: #9ca3af;
    /* Disabled/Placeholders */

    /* Brand & Accent (Controlled) */
    --brand-navy: #0d3a5c;
    --brand-navy-hover: #0a2d47;
    --brand-teal: #0091aa;
    --brand-teal-light: rgba(0, 145, 170, 0.1);

    /* Structural Elements */
    --border-light: #e5e7eb;
    --border-input: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);

    /* Spacing System */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* --- RESET & TYPOGRAPHY --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

a {
    color: var(--brand-teal);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

/* --- TOP NAVIGATION --- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.nav-profile-link:hover {
    background-color: var(--bg-surface-hover);
    text-decoration: none;
}

.nav-divider {
    color: var(--border-input);
    font-weight: 300;
}

/* --- REALISTIC COMPONENTS: BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background-color: var(--brand-navy);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn.primary:hover:not(:disabled) {
    background-color: var(--brand-navy-hover);
}

.btn.secondary {
    background-color: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-input);
    box-shadow: var(--shadow-sm);
}

.btn.secondary:hover:not(:disabled) {
    background-color: var(--bg-surface-hover);
}

.btn.text-only {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
}

.btn.text-only:hover:not(:disabled) {
    background-color: var(--border-light);
    color: var(--text-primary);
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* --- AVATARS --- */
img {
    object-fit: cover;
}

.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}

.avatar-medium {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}

.avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

/* --- MAIN LAYOUTS --- */
/* The Feed (Centered, 640px max width) */
.feed-container {
    max-width: 640px;
    margin: 32px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Admin & Profile (Wider, Data-Dense) */
.admin-container,
.profile-container,
.auth-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.auth-container {
    max-width: 400px;
    margin-top: 10vh;
}

/* --- CARDS (Posts, Panels, Forms) --- */
.composer-card,
.post-card,
.admin-card,
.profile-form,
.profile-header-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

/* --- THE FEED POSTS --- */
.composer-header,
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.post-org-subtitle,
#composer-name {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.rich-text-input {
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rich-text-input:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px var(--brand-teal-light);
}

.rich-text-input[contenteditable="false"] {
    background-color: var(--bg-app);
    color: var(--text-secondary);
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.post-body {
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: normal;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    margin-bottom: 16px;
}

.post-body p,
.post-body li,
.post-body h1,
.post-body h2,
.ql-editor,
.ql-editor p,
.ql-editor li,
.ql-editor h1,
.ql-editor h2 {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
}

.post-body a,
.ql-editor a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-body img,
.post-body iframe,
.post-body video,
.ql-editor img,
.ql-editor iframe,
.ql-editor video {
    max-width: 100%;
}

.post-body p {
    margin-bottom: 12px;
}

.post-body p:last-child {
    margin-bottom: 0;
}

.post-body ul,
.post-body ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.post-body li {
    margin-bottom: 4px;
}

.post-body h1,
.post-body h2 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.post-actions {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* --- FORMS & INPUTS (Realistic Component Design) --- */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background-color: var(--bg-surface);
    transition: all 0.15s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px var(--brand-teal-light);
}

input:disabled,
select:disabled {
    background-color: var(--bg-app);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

fieldset {
    border: none;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

fieldset:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

legend {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    width: 100%;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.error-text {
    font-size: 0.85rem;
    color: #dc2626;
    margin-top: 6px;
    font-weight: 500;
}

/* --- DATA TABLES (Data-Dense but Calm) --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-light);
    padding: 12px 16px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:hover td {
    background-color: var(--bg-surface-hover);
}

/* --- UTILITIES --- */
.hidden {
    display: none !important;
}

.success-box {
    background-color: var(--brand-teal-light);
    border: 1px solid var(--brand-teal);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 20px;
    text-align: center;
}

.success-box h2 {
    color: var(--brand-navy);
    margin-top: 8px;
    font-family: monospace;
    letter-spacing: 2px;
}

/* Profile Layout specific */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 24px;
}

.avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
/* --- DROPDOWNS & COMMENTS --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-surface);
    min-width: 120px;
    box-shadow: var(--shadow-md);
    z-index: 10;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content button {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dropdown-content button:hover {
    background-color: var(--bg-surface-hover);
}

.dropdown-content button.danger {
    color: #dc2626;
}

.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.comment-card {
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-app);
}

.comment-card:last-child {
    border-bottom: none;
}

.comment-card.reply {
    margin-left: 36px;
    border-left: 2px solid var(--border-light);
    padding-left: 12px;
}

.comment-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    background: var(--bg-app);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.comment-composer .rich-text-input {
    min-height: 40px;
    background: var(--bg-surface);
}
/* ==========================================================================
   PHASE 8: SAAS SIDEBAR LAYOUT & SPACING FIXES
   ========================================================================== */

/* 1. App Layout Shell */
.app-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 2. The Left Sidebar */
.side-nav {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    /* Keeps the sidebar fixed while the main feed scrolls */
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    margin-left: 12px;
    margin-bottom: 8px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background-color: var(--brand-teal-light);
    color: var(--brand-navy);
    font-weight: 600;
}

/* 3. Main Content Area */
.main-content {
    flex: 1;
    padding: 32px 40px;
}

/* 4. THE SQUISH FIXES */
/* Fixes the Feed Posts */
#feed-stream {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Fixes the Sign In Page */
.auth-container input {
    margin-bottom: 16px;
}

.auth-container button {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 12px;
}

/* --- COMMENTS UI UPGRADES --- */
.comments-wrapper {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.btn-show-more {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: color 0.15s ease;
    width: 100%;
    text-align: left;
}

.btn-show-more:hover {
    color: var(--brand-teal);
    text-decoration: underline;
}

.reply-tag {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--brand-navy);
    background-color: var(--brand-teal-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-right: 4px;
    pointer-events: none;
}

/* Small tweak to make Quill fit our UI */
.ql-toolbar {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-surface-hover);
}

.ql-container {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-surface);
    min-height: 100px;
}

/* --- PHASE B: FEED QUILL & IMAGE CAROUSEL --- */
#post-content {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-surface);
    min-height: 80px;
}

.composer-card .ql-toolbar {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-surface-hover);
}

/* Upload Previews */
.image-preview-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preview-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The Live Feed Carousel */
.post-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    margin-top: 12px;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.post-carousel img {
    flex: 0 0 100%;
    max-height: 400px;
    object-fit: contain;
    scroll-snap-align: center;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-light);
}

/* --- PHASE C: LINK PREVIEWS & VIDEOS --- */
.video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    background: #000;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.link-preview-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    margin-top: 12px;
    background: var(--bg-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.link-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--brand-teal);
    text-decoration: none;
}

.link-preview-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-surface-hover);
}

.link-preview-content {
    padding: 14px;
}

.link-preview-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--brand-navy);
}

.link-preview-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.link-preview-domain {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {

    .feed-container,
    .admin-container,
    .profile-container {
        padding: 0;
        margin: 0;
    }

    /* Remove card borders/radius on mobile so they bleed to the edge */
    .composer-card,
    .post-card,
    .admin-card,
    .profile-form,
    .profile-header-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        border-top: 1px solid var(--border-light);
        border-bottom: 1px solid var(--border-light);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .top-nav {
        padding: 0 16px;
    }

    #nav-user-name,
    #nav-org-name {
        display: none;
        /* Hide names, show only avatars on mobile nav */
    }
}
/* --- AI CHAT WIDGET --- */
#ai-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: inherit;
}

#ai-toggle-btn {
    background: var(--brand-teal, #00796b);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#ai-toggle-btn:hover {
    transform: scale(1.05);
}

#ai-chat-window {
    /* 🚨 CHANGED: Fixed to the viewport to take up massive space */
    position: fixed;
    top: 24px;
    bottom: 100px;
    /* Leaves space below for the toggle button */
    right: 24px;
    width: calc(100vw - 320px);
    /* 🚨 Fills screen up to the left nav bar */
    max-width: 1200px;
    /* Cap width on ultra-wide monitors */
    height: auto;

    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-light, #e0e0e0);
}

#ai-chat-window.hidden {
    display: none;
}

.ai-chat-header {
    background: var(--brand-teal, #00796b);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

#ai-chat-history {
    flex: 1;
    padding: 24px;
    /* Increased padding for the larger window */
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    max-width: 80%;
    /* Adjusted for wider screen */
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-system {
    background: white;
    border: 1px solid #e0e0e0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ai-user {
    background: var(--brand-teal, #00796b);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 121, 107, 0.2);
}

/* 🚨 FIX: Markdown Lists & Paragraph Formatting */
.ai-system ul,
.ai-system ol {
    margin: 12px 0;
    padding-left: 24px;
    /* Pulls the bullets safely inside the bubble */
    word-wrap: break-word;
}

.ai-system li {
    margin-bottom: 6px;
}

.ai-system p {
    margin-top: 0;
    margin-bottom: 12px;
}

.ai-system strong {
    color: var(--brand-navy, #0d3a5c);
}

.ai-system *:last-child {
    margin-bottom: 0;
}

.ai-chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

#ai-chat-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
}

#ai-chat-input:focus {
    outline: none;
    border-color: var(--brand-teal, #00796b);
}

#ai-send-btn {
    background: var(--brand-teal, #00796b);
    color: white;
    border: none;
    border-radius: 8px;
    width: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#ai-send-btn:hover {
    background: #005a4f;
}

#ai-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
/* --- FINAL RICH TEXT WRAP OVERRIDES --- */
.post-body,
.post-body p,
.post-body li,
.post-body h1,
.post-body h2,
.ql-editor,
.ql-editor p,
.ql-editor li,
.ql-editor h1,
.ql-editor h2 {
    white-space: pre-wrap !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: none !important;
    max-width: 100% !important;
}

.post-body a,
.ql-editor a {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.post-body img,
.post-body iframe,
.post-body video,
.ql-editor img,
.ql-editor iframe,
.ql-editor video {
    max-width: 100% !important;
}