/*
 * Project Atlas — Custom theme layer
 * Works alongside Tailwind CDN + dark: class strategy.
 */

/* ── Brand palette fallback (SELF-CONTAINED) ──────────────────────────────
   Component styles in THIS file read `rgb(var(--brand-N))` (buttons, the
   wordmark's clip-text gradient, CTAs, rings, …). Those triplets are normally
   supplied by app.css's :root (compiled from static/src/input.css) and are
   rewritten at runtime by the accent picker in theme.js.

   The trap: `rgb(var(--brand-600))` with `--brand-600` UNDEFINED is an invalid
   value, and an invalid value voids the WHOLE declaration — so a gradient or a
   clip-text fill collapses to nothing (transparent), which reads as "the header,
   buttons and even the MavionMeet wordmark lost all styling". That happens
   whenever a browser pairs this (newer, var-driven) theme.css with a STALE
   cached app.css from before the triplets existed — the two files cache
   independently, so one can lag the other.

   Defining the default indigo ramp here makes theme.css self-sufficient: the UI
   renders correctly even if app.css is missing/stale. app.css's identical :root
   (loaded first) and the accent picker's inline overrides on <html> both still
   win where present, so this only fills a gap, never fights them. Keep in sync
   with static/src/input.css. */
:root {
    --brand-50:  238 242 255;
    --brand-100: 224 231 255;
    --brand-200: 199 210 254;
    --brand-300: 165 180 252;
    --brand-400: 129 140 248;
    --brand-500: 99 102 241;
    --brand-600: 79 70 229;
    --brand-700: 67 56 202;
    --brand-800: 55 48 163;
    --brand-900: 49 46 129;
    --brand: rgb(var(--brand-600));
    --brand-2: rgb(var(--brand-500));
}

/* ── Smooth theme transitions ── */
*,
*::before,
*::after {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ── Gradient backgrounds ── */
.atlas-bg-gradient {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf9 40%, #fdf2f8 100%);
}
.dark .atlas-bg-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #1a1a2e 100%);
}

/* ── Card styles ── */
.atlas-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 24px rgba(0, 0, 0, 0.04);
}
.dark .atlas-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* ── Glass navbar ── */
.atlas-navbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.dark .atlas-navbar {
    background: rgba(15, 23, 42, 0.78);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ── Task row hover ── */
.atlas-task-row {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
.atlas-task-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.dark .atlas-task-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ── Animated entrance ── */
@keyframes atlas-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes atlas-slide-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.atlas-animate-in {
    animation: atlas-fade-in 0.35s ease-out backwards;
}
/* Consistent page-in transition (broader-menu: global polish). Every page's
   main content fades in on load so navigating between full-page (MPA) views
   feels smooth and premium app-wide — not just the pages that happened to add
   .atlas-animate-in to an inner wrapper. Opacity-only, so it layers gently with
   any inner rise/stagger without double-moving the content. */
#main-content { animation: atlas-page-in 0.3s ease-out both; }
@keyframes atlas-page-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #main-content { animation: none; } }
.atlas-slide-in {
    animation: atlas-slide-in 0.3s ease-out both;
}

/* stagger children */
.atlas-stagger > *:nth-child(1)  { animation-delay: 0.03s; }
.atlas-stagger > *:nth-child(2)  { animation-delay: 0.06s; }
.atlas-stagger > *:nth-child(3)  { animation-delay: 0.09s; }
.atlas-stagger > *:nth-child(4)  { animation-delay: 0.12s; }
.atlas-stagger > *:nth-child(5)  { animation-delay: 0.15s; }
.atlas-stagger > *:nth-child(6)  { animation-delay: 0.18s; }
.atlas-stagger > *:nth-child(7)  { animation-delay: 0.21s; }
.atlas-stagger > *:nth-child(8)  { animation-delay: 0.24s; }
.atlas-stagger > *:nth-child(9)  { animation-delay: 0.27s; }
.atlas-stagger > *:nth-child(10) { animation-delay: 0.30s; }

/* ── Button hover glow ── */
.atlas-btn-primary {
    background: linear-gradient(135deg, #3b82f6, rgb(var(--brand-500)));
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.atlas-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgb(var(--brand-500) / 0.4);
}
.atlas-btn-primary:active {
    transform: translateY(0);
}

/* ── Checkbox ── */
.atlas-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.atlas-checkbox:hover {
    border-color: rgb(var(--brand-500));
    box-shadow: 0 0 0 3px rgb(var(--brand-500) / 0.15);
}
.atlas-checkbox.checked {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
}
.dark .atlas-checkbox {
    border-color: #4b5563;
}

/* ── Badge pills ── */
.atlas-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

/* ── Toast / message animation ── */
@keyframes atlas-toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.atlas-toast {
    animation: atlas-toast-in 0.3s ease-out both;
}

/* ── Input / Select / Textarea ── */
.atlas-input,
select.atlas-input,
textarea.atlas-input {
    background: rgba(255, 255, 255, 0.6);
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.3s;
}
.atlas-input::placeholder { color: #94a3b8; }
.atlas-input:focus {
    outline: none;
    border-color: rgb(var(--brand-500));
    box-shadow: 0 0 0 3px rgb(var(--brand-500) / 0.15);
    background: rgba(255, 255, 255, 0.85);
}
.dark .atlas-input,
.dark select.atlas-input,
.dark textarea.atlas-input {
    background: rgba(30, 41, 59, 0.6);
    border-color: #374151;
    color: #e2e8f0;
}
.dark .atlas-input::placeholder { color: #64748b; }
.dark .atlas-input:focus {
    border-color: rgb(var(--brand-400));
    box-shadow: 0 0 0 3px rgb(var(--brand-400) / 0.2);
    background: rgba(30, 41, 59, 0.8);
}

/* ── Scrollbar (webkit) ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* ── Details/summary ── */
details summary {
    cursor: pointer;
    user-select: none;
}
details[open] > summary {
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════
   Sticky Notes (vNote) View — Premium Design
   ═══════════════════════════════════════════════ */

/* ── Note card ── */
.atlas-note {
    position: relative;
    border-radius: 2px 2px 2px 2px;
    padding: 1.6rem 1rem 1.25rem;
    min-height: 140px;
    break-inside: avoid;
    margin-bottom: 1.25rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    border-left: 3px solid rgba(0,0,0,0.08);
    /* Ruled paper lines + color via CSS custom properties */
    --note-bg-start: #fffbeb;
    --note-bg-end: #fef3c7;
    background:
        repeating-linear-gradient(
            transparent,
            transparent 26px,
            rgba(0,0,0,0.025) 26px,
            rgba(0,0,0,0.025) 27px
        ),
        linear-gradient(145deg, var(--note-bg-start), var(--note-bg-end));
    background-position: 0 18px, 0 0;
    /* Layered 3D shadow */
    box-shadow:
        0 1px 1px rgba(0,0,0,0.04),
        0 2px 4px rgba(0,0,0,0.04),
        0 4px 8px rgba(0,0,0,0.04),
        0 8px 16px rgba(0,0,0,0.04);
}
.dark .atlas-note {
    background:
        repeating-linear-gradient(
            transparent,
            transparent 26px,
            rgba(255,255,255,0.018) 26px,
            rgba(255,255,255,0.018) 27px
        ),
        linear-gradient(145deg, var(--note-bg-start), var(--note-bg-end));
    background-position: 0 18px, 0 0;
    box-shadow:
        0 1px 1px rgba(0,0,0,0.12),
        0 2px 4px rgba(0,0,0,0.12),
        0 4px 8px rgba(0,0,0,0.10),
        0 8px 16px rgba(0,0,0,0.10);
}

/* ── Push pin (::before) ── */
.atlas-note::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 13px;
    height: 13px;
    background: radial-gradient(circle at 38% 32%,
        #ff8a8a 0%, #ef4444 32%, #dc2626 62%, #991b1b 100%);
    border-radius: 50%;
    box-shadow:
        0 2px 5px rgba(0,0,0,0.28),
        0 1px 2px rgba(0,0,0,0.15),
        inset 0 1px 3px rgba(255,255,255,0.4),
        inset 0 -1px 2px rgba(0,0,0,0.18);
    z-index: 3;
}
/* Stagger pin positions for natural feel */
.atlas-note:nth-child(3n)::before   { left: 38%; }
.atlas-note:nth-child(3n+2)::before { left: 62%; }

/* ── Corner fold (::after) ── */
.atlas-note::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(
        225deg,
        rgba(255,255,255,0.7) 0%,
        rgba(255,255,255,0.6) 42%,
        rgba(0,0,0,0.04) 46%,
        rgba(0,0,0,0.09) 100%
    );
    border-bottom-right-radius: 2px;
}
.dark .atlas-note::after {
    background: linear-gradient(
        225deg,
        rgba(15,23,42,0.6) 0%,
        rgba(15,23,42,0.5) 42%,
        rgba(255,255,255,0.02) 46%,
        rgba(255,255,255,0.05) 100%
    );
}

/* ── Hover lift with 3D depth ── */
.atlas-note:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow:
        0 2px 2px rgba(0,0,0,0.03),
        0 4px 4px rgba(0,0,0,0.03),
        0 8px 8px rgba(0,0,0,0.03),
        0 16px 32px rgba(0,0,0,0.06),
        0 24px 48px rgba(0,0,0,0.04);
    z-index: 10;
}
.dark .atlas-note:hover {
    box-shadow:
        0 2px 2px rgba(0,0,0,0.10),
        0 4px 4px rgba(0,0,0,0.10),
        0 8px 8px rgba(0,0,0,0.08),
        0 16px 32px rgba(0,0,0,0.12),
        0 24px 48px rgba(0,0,0,0.08);
}

/* ── Natural rotations ── */
.atlas-note:nth-child(6n+1) { transform: rotate(-0.8deg); }
.atlas-note:nth-child(6n+2) { transform: rotate(1deg); }
.atlas-note:nth-child(6n+3) { transform: rotate(-1.2deg); }
.atlas-note:nth-child(6n+4) { transform: rotate(0.6deg); }
.atlas-note:nth-child(6n+5) { transform: rotate(-0.4deg); }
.atlas-note:nth-child(6n)   { transform: rotate(1.1deg); }

/* ── Note color themes — light (via CSS custom properties) ── */
.note-yellow    { --note-bg-start: #fefce8; --note-bg-end: #fef9c3; border-left-color: #eab308; }
.note-pink      { --note-bg-start: #fdf2f8; --note-bg-end: #fce7f3; border-left-color: #ec4899; }
.note-green     { --note-bg-start: #ecfdf5; --note-bg-end: #d1fae5; border-left-color: #10b981; }
.note-blue      { --note-bg-start: #eff6ff; --note-bg-end: #dbeafe; border-left-color: #3b82f6; }
.note-lavender  { --note-bg-start: #f5f3ff; --note-bg-end: #ede9fe; border-left-color: #8b5cf6; }
.note-peach     { --note-bg-start: #fff7ed; --note-bg-end: #ffedd5; border-left-color: #f97316; }

/* ── Note color themes — dark ── */
.dark .note-yellow    { --note-bg-start: rgba(234,179,8,0.13); --note-bg-end: rgba(245,158,11,0.08); border-left-color: #eab308; }
.dark .note-pink      { --note-bg-start: rgba(236,72,153,0.13); --note-bg-end: rgba(219,39,119,0.08); border-left-color: #ec4899; }
.dark .note-green     { --note-bg-start: rgba(16,185,129,0.13); --note-bg-end: rgba(5,150,105,0.08); border-left-color: #10b981; }
.dark .note-blue      { --note-bg-start: rgba(59,130,246,0.13); --note-bg-end: rgba(37,99,235,0.08); border-left-color: #3b82f6; }
.dark .note-lavender  { --note-bg-start: rgba(139,92,246,0.13); --note-bg-end: rgba(124,58,237,0.08); border-left-color: #8b5cf6; }
.dark .note-peach     { --note-bg-start: rgba(249,115,22,0.13); --note-bg-end: rgba(234,88,12,0.08); border-left-color: #f97316; }

/* ── Masonry grid ── */
.atlas-notes-grid {
    columns: 4;
    column-gap: 1.25rem;
    padding-top: 0.5rem;
}
@media (max-width: 1280px) { .atlas-notes-grid { columns: 3; } }
@media (max-width: 768px)  { .atlas-notes-grid { columns: 2; } }
@media (max-width: 480px)  { .atlas-notes-grid { columns: 1; } }

/* ── Note completion fade ── */
@keyframes atlas-note-complete {
    0%   { opacity: 1; transform: scale(1); }
    50%  { opacity: 0.5; transform: scale(0.96); }
    100% { opacity: 0; transform: scale(0.9); }
}
.atlas-note-completing {
    animation: atlas-note-complete 0.4s ease-out forwards;
    pointer-events: none;
}

/* ── Flutter & Settle — wind-blown entrance for sticky notes ── */
@keyframes atlas-flutter {
    0% {
        opacity: 0;
        transform: perspective(800px) rotateZ(-3deg) rotateX(0deg)
                   translateX(-6px) translateY(8px);
    }
    18% {
        opacity: 0.85;
        transform: perspective(800px) rotateZ(-1.5deg) rotateX(4deg)
                   translateX(-3px) translateY(3px);
    }
    38% {
        opacity: 0.94;
        transform: perspective(800px) rotateZ(2.5deg) rotateX(6deg)
                   translateX(4px) translateY(-2px);
    }
    58% {
        opacity: 0.98;
        transform: perspective(800px) rotateZ(-1.2deg) rotateX(2deg)
                   translateX(-2px) translateY(1px);
    }
    78% {
        opacity: 1;
        transform: perspective(800px) rotateZ(0.5deg) rotateX(0.5deg)
                   translateX(0.5px) translateY(-0.5px);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}
.atlas-note.atlas-note-flutter {
    animation: atlas-flutter var(--flutter-dur, 1.8s) var(--flutter-delay, 0s)
               cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    will-change: transform, opacity;
}
.atlas-note.atlas-note-flutter:hover {
    animation-play-state: paused;
}
/* Respect reduced-motion: skip flutter, use simple fade */
@media (prefers-reduced-motion: reduce) {
    .atlas-note.atlas-note-flutter {
        animation: atlas-fade-in 0.35s ease-out both;
        will-change: auto;
    }
}

/* ── View toggle buttons ── */
.atlas-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 500;
}
.atlas-view-btn.active {
    background: white;
    color: rgb(var(--brand-600));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.atlas-view-btn:hover:not(.active) {
    color: #374151;
    background: rgba(0, 0, 0, 0.04);
}
.dark .atlas-view-btn {
    color: #9ca3af;
}
.dark .atlas-view-btn.active {
    background: rgb(var(--brand-500) / 0.2);
    color: rgb(var(--brand-300));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dark .atlas-view-btn:hover:not(.active) {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════
   Settings Page — Checkbox & Toggle polish
   ═══════════════════════════════════════════════ */
.atlas-toggle-wrap input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.25rem;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    accent-color: rgb(var(--brand-500));
}
.dark .atlas-toggle-wrap input[type="checkbox"] {
    border-color: #4b5563;
}
.atlas-toggle-wrap input[type="checkbox"]:checked {
    border-color: rgb(var(--brand-500));
}
.dark .atlas-toggle-wrap input[type="checkbox"]:checked {
    border-color: rgb(var(--brand-400));
}

/* ═══════════════════════════════════════════════
   Bucket System — Sticky Headers, Pagination,
   Skeletons, Collapse, Infinite Scroll
   ═══════════════════════════════════════════════ */

/* ── Bucket sticky header ── */
.atlas-bucket-header {
    background: rgba(240, 244, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 0.5rem;
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.5rem;
}
.dark .atlas-bucket-header {
    background: rgba(15, 23, 42, 0.88);
}

/* ── Bucket body collapse ── */
.atlas-bucket-body {
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}
.atlas-bucket-body.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}
.atlas-bucket-chevron {
    transition: transform 0.25s ease;
}
.atlas-bucket-chevron.rotated {
    transform: rotate(-90deg);
}

/* ── Load-more button ── */
.atlas-load-more {
    position: relative;
}
.atlas-load-more .htmx-indicator {
    display: none;
}
.atlas-load-more.htmx-request .atlas-load-more-label {
    opacity: 0.4;
}
.atlas-load-more.htmx-request .htmx-indicator {
    display: block;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Skeleton shimmer ── */
@keyframes atlas-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.atlas-bucket-skeleton [class*="animate-pulse"] {
    animation: atlas-shimmer 1.5s ease-in-out infinite;
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%
    );
    background-size: 400px 100%;
}
.dark .atlas-bucket-skeleton [class*="animate-pulse"] {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.06) 50%,
        transparent 100%
    );
}

/* ── Infinite scroll sentinel ── */
.atlas-io-sentinel {
    visibility: hidden;
    pointer-events: none;
}

/* ── Rendered (organizer-edited) Minutes of Meeting rich content ── */
.mom-rich :first-child { margin-top: 0; }
.mom-rich h2 { font-size: 16px; font-weight: 800; color: #111827; margin: 16px 0 8px; }
.dark .mom-rich h2 { color: #f3f4f6; }
.mom-rich h3 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin: 14px 0 5px; }
.dark .mom-rich h3 { color: #9aa3b2; }
.mom-rich h4 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; }
.mom-rich p { margin: 0 0 9px; }
.mom-rich ul, .mom-rich ol { margin: 0 0 10px; padding-left: 20px; }
.mom-rich ul { list-style: disc; }
.mom-rich ol { list-style: decimal; }
.mom-rich li { margin-bottom: 3px; }
.mom-rich blockquote { border-left: 3px solid rgb(var(--brand-200)); padding-left: 12px; margin: 0 0 10px; color: #4b5563; }
.dark .mom-rich blockquote { border-color: rgb(var(--brand-600)); color: #9aa3b2; }
.mom-rich code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #f1f5f9; padding: 1px 5px; border-radius: 5px; }
.dark .mom-rich code { background: rgba(255,255,255,.1); }
.mom-rich a { color: rgb(var(--brand-700)); text-decoration: underline; }
.dark .mom-rich a { color: rgb(var(--brand-300)); }
.mom-rich h1 { font-size: 20px; font-weight: 800; margin: 16px 0 8px; }
.mom-rich pre { background: #f1f5f9; border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-family: ui-monospace, Consolas, monospace; font-size: .9em; margin: 0 0 10px; }
.dark .mom-rich pre { background: rgba(255,255,255,.06); }
.mom-rich table { border-collapse: collapse; width: 100%; margin: 4px 0 14px; font-size: .95em; }
.mom-rich th, .mom-rich td { border: 1px solid #cbd5e1; padding: 7px 10px; text-align: left; vertical-align: top; }
.dark .mom-rich th, .dark .mom-rich td { border-color: rgba(255,255,255,.16); }
.mom-rich th { background: rgb(var(--brand-50)); font-weight: 700; }
.dark .mom-rich th { background: rgb(var(--brand-500) / .15); }
.mom-rich table caption { caption-side: top; font-size: 12px; color: #6b7280; text-align: left; margin-bottom: 4px; }

/* ── Task buckets: balanced multi-column masonry on wide screens ──
   Cuts vertical scrolling by flowing buckets into columns; break-inside-avoid
   (on .atlas-bucket-section) keeps each bucket intact within a column. */
.atlas-buckets-masonry {
    column-gap: 1.5rem;
}
@media (min-width: 1024px) {
    .atlas-buckets-masonry { column-count: 2; }
}
@media (min-width: 1600px) {
    .atlas-buckets-masonry { column-count: 3; }
}
/* A bucket must never be split across columns. */
.atlas-bucket-section { break-inside: avoid; }

/* Compact filter / quick-add controls so they form a neat inline bar instead
   of each full-width select stacking onto its own row on wide layouts. */
@media (min-width: 640px) {
    .atlas-filter-bar select.mv-input-modern,
    .atlas-filter-bar input.mv-input-modern { width: auto; min-width: 8.5rem; flex: 0 0 auto; }
    .atlas-quick-add input[type="date"].mv-input-modern { width: auto; min-width: 9.5rem; flex: 0 0 auto; }
    .atlas-quick-add > .mv-btn-submit { flex: 0 0 auto; width: auto; }
    /* Title input takes the remaining space; keep it to a sensible max. */
    .atlas-quick-add > .relative.flex-1 { flex: 1 1 auto; max-width: 620px; }
}

/* ── Bucket section spacing ── */
.atlas-bucket-section + .atlas-bucket-section {
    margin-top: 0.5rem;
}

/* ── Count badge ── */
.atlas-bucket-count {
    transition: all 0.3s ease;
    min-width: 3rem;
    text-align: center;
}

/* ═══════════════════════════════════════════════
   Wallboard — Horizontal Slide Carousel for
   Sticky Notes View (study-room corkboard)
   ═══════════════════════════════════════════════ */

/* ── Cork-board frame (light) ── */
.atlas-wallboard {
    position: relative;
    border-radius: 12px;
    padding: 1.5rem 3rem;
    min-height: 420px;
    /* Full-bleed: break out of narrow parent */
    width: calc(100vw - 3rem);
    max-width: 72rem;
    margin-left: 50%;
    transform: translateX(-50%);
    /* Cork grain: layered radial grain over warm base */
    background:
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 25% 40%, rgba(180,140,70,0.10) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 65%, rgba(160,120,55,0.08) 0%, transparent 55%),
        linear-gradient(145deg, #c4a265 0%, #d4b87e 28%, #caad6e 52%, #c0a060 78%, #b89858 100%);
    /* Recessed inner shadow + outer frame depth */
    box-shadow:
        inset 0 3px 12px rgba(0,0,0,0.30),
        inset 0 -2px 8px rgba(0,0,0,0.18),
        inset 3px 0 8px rgba(0,0,0,0.14),
        inset -3px 0 8px rgba(0,0,0,0.14),
        0 2px 4px rgba(0,0,0,0.10),
        0 6px 20px rgba(0,0,0,0.08);
    /* Wood frame border */
    border: 3px solid #8B6F47;
    outline: 1px solid rgba(0,0,0,0.08);
}

/* ── Chalkboard frame (dark) ── */
.dark .atlas-wallboard {
    background:
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 25% 40%, rgba(100,116,139,0.10) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 65%, rgba(71,85,105,0.08) 0%, transparent 55%),
        linear-gradient(145deg, #1e293b 0%, #253347 28%, #1f2d40 52%, #1a2435 78%, #182030 100%);
    box-shadow:
        inset 0 3px 14px rgba(0,0,0,0.55),
        inset 0 -2px 10px rgba(0,0,0,0.40),
        inset 3px 0 10px rgba(0,0,0,0.30),
        inset -3px 0 10px rgba(0,0,0,0.30),
        0 2px 4px rgba(0,0,0,0.25),
        0 6px 20px rgba(0,0,0,0.18);
    border-color: #475569;
    outline-color: rgba(255,255,255,0.04);
}

/* ── Viewport: clips overflow, shows one slide ── */
.atlas-wb-viewport {
    overflow: hidden;
    position: relative;
    border-radius: 6px;
}

/* ── Track: flex row of slides, animates via translateX ── */
.atlas-wb-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ── Individual slide: CSS Grid for note layout ── */
.atlas-wb-slide {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(210px, calc(25% - 0.75rem)), 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
    min-height: 380px;
    align-content: start;
}

/* ── Arrow buttons ── */
.atlas-wb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.88);
    color: #374151;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.atlas-wb-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    transform: translateY(-50%) scale(1.1);
}
.atlas-wb-arrow:active {
    transform: translateY(-50%) scale(0.94);
}
.atlas-wb-arrow--prev { left: 6px; }
.atlas-wb-arrow--next { right: 6px; }
.atlas-wb-arrow[disabled] {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}
.dark .atlas-wb-arrow {
    background: rgba(30,41,59,0.88);
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.40);
}
.dark .atlas-wb-arrow:hover {
    background: rgba(30,41,59,0.96);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

/* ── Dot indicators ── */
.atlas-wb-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding-top: 0.85rem;
}
.atlas-wb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
    background: rgba(0,0,0,0.18);
}
.atlas-wb-dot:hover {
    background: rgba(0,0,0,0.35);
    transform: scale(1.25);
}
.atlas-wb-dot.active {
    background: rgb(var(--brand-500));
    transform: scale(1.3);
    box-shadow: 0 0 0 2.5px rgb(var(--brand-500) / 0.30);
}
.dark .atlas-wb-dot {
    background: rgba(255,255,255,0.18);
}
.dark .atlas-wb-dot:hover {
    background: rgba(255,255,255,0.35);
}
.dark .atlas-wb-dot.active {
    background: rgb(var(--brand-400));
    box-shadow: 0 0 0 2.5px rgb(var(--brand-400) / 0.30);
}
.atlas-wb-dots:empty,
.atlas-wb-dots[data-single] {
    display: none;
}

/* ── Note overrides inside wallboard ── */
.atlas-wallboard .atlas-note {
    break-inside: auto;
    margin-bottom: 0;
}

/* ── Day-card note (one note = one day's grouped tasks) ── */
.atlas-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(0,0,0,0.12);
}
.atlas-day-header .day-name {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    line-height: 1.3;
}
.atlas-day-header .day-count {
    font-size: 10px;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    color: #6b7280;
    padding: 1px 6px;
    border-radius: 9999px;
    flex-shrink: 0;
}

.atlas-day-tasks {
    list-style: none;
    margin: 0;
    padding: 0;
}
.atlas-day-tasks li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 12px;
    line-height: 1.4;
}
.atlas-day-tasks li:last-child { border-bottom: none; }
.atlas-day-tasks li.done a {
    text-decoration: line-through;
    opacity: 0.4;
}
.atlas-day-tasks li a {
    color: #374151;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.atlas-day-tasks li a:hover {
    color: var(--brand-600, rgb(var(--brand-600)));
}

/* Priority pips inside day-cards */
.priority-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.priority-pip.priority-3 { background: #f97316; }
.priority-pip.priority-4 { background: #ef4444; }

/* Day-card dark mode */
.dark .atlas-day-header { border-bottom-color: rgba(255,255,255,0.08); }
.dark .atlas-day-header .day-name { color: #e5e7eb; }
.dark .atlas-day-header .day-count { background: rgba(255,255,255,0.1); color: #9ca3af; }
.dark .atlas-day-tasks li { border-bottom-color: rgba(255,255,255,0.04); }
.dark .atlas-day-tasks li a { color: #d1d5db; }
.dark .atlas-day-tasks li a:hover { color: var(--brand-400, rgb(var(--brand-400))); }

/* ── Responsive: mobile wallboard ── */
@media (max-width: 768px) {
    .atlas-wallboard {
        padding: 1rem 0.75rem;
        min-height: 360px;
        width: calc(100vw - 1rem);
        border-radius: 8px;
    }
    .atlas-wb-arrow { display: none; }
    .atlas-wb-slide { min-height: 340px; }
}
@media (max-width: 480px) {
    .atlas-wallboard {
        padding: 0.75rem 0.5rem;
        border-width: 2px;
        min-height: 300px;
    }
    .atlas-wb-slide {
        grid-template-columns: 1fr;
        min-height: 280px;
    }
}

/* ── Reduced motion: instant slide transitions ── */
@media (prefers-reduced-motion: reduce) {
    .atlas-wb-track {
        transition-duration: 0.01s;
    }
}

/* ══════════════════════════════════════════════════════════
   CALENDAR VIEW — Corporate Design System
   Sidebar (always dark) + Main Calendar (theme-responsive)
   ═══════════════════════════════════════════════════════ */

/* ───────────────────────────────────────
   SIDEBAR — Always dark, never changes
   ─────────────────────────────────────── */
.atlas-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #1E1F2E;
    color: #C8CAD8;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.atlas-sidebar::-webkit-scrollbar { width: 4px; }
.atlas-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Profile */
.atlas-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
}
.atlas-sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7C5CFC, #6C63FF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.atlas-sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.atlas-sidebar-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atlas-sidebar-role {
    font-size: 0.7rem;
    color: #8B8CA7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atlas-sidebar-notif {
    position: relative;
    flex-shrink: 0;
    color: #8B8CA7;
    cursor: pointer;
    transition: color 0.15s;
    margin-left: auto;
    padding: 4px;
}
.atlas-sidebar-notif:hover { color: #fff; }
.atlas-sidebar-notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #7C5CFC;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar sections */
.atlas-sidebar-section {
    padding: 0 20px 16px;
}
.atlas-sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    user-select: none;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
}
.atlas-sidebar-section-header:hover {
    color: #c5bfff;
}
.atlas-sidebar-chevron {
    transition: transform 0.2s ease;
}
.atlas-sidebar-section-header[aria-expanded="false"] .atlas-sidebar-chevron {
    transform: rotate(-90deg);
}
.atlas-sidebar-collapsible {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}
.atlas-sidebar-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
}

/* Mini calendar */
.atlas-sidebar-minical-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 10px;
}
.atlas-sidebar-minical-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}
.atlas-sidebar-minical-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: #8B8CA7;
    transition: all 0.12s;
}
.atlas-sidebar-minical-nav:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.atlas-sidebar-minical-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.atlas-sidebar-minical-dow {
    font-size: 0.65rem;
    font-weight: 600;
    color: #8B8CA7;
    padding: 4px 0;
    text-transform: uppercase;
}
.atlas-sidebar-minical-day {
    font-size: 0.72rem;
    font-weight: 500;
    color: #C8CAD8;
    padding: 5px 0;
    border-radius: 8px;
    transition: all 0.12s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}
.atlas-sidebar-minical-day:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.atlas-sidebar-minical-day.other-month {
    color: #4A4B65;
}
.atlas-sidebar-minical-day.is-today {
    background: #7C5CFC;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(124,92,252,0.35);
}
.atlas-sidebar-minical-day.is-anchor:not(.is-today) {
    background: rgba(124,92,252,0.2);
    color: #C4B5FD;
    font-weight: 600;
}

/* Next event card */
.atlas-sidebar-event-card {
    background: #282A3A;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.06);
}
.atlas-sidebar-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.atlas-sidebar-event-time {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
}
.atlas-sidebar-event-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    color: #FF6B6B;
    background: rgba(255,107,107,0.12);
    padding: 2px 8px;
    border-radius: 10px;
}
.atlas-sidebar-event-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #E2E4F0;
    line-height: 1.4;
    margin-bottom: 14px;
}
.atlas-sidebar-event-actions {
    display: flex;
    gap: 8px;
}
.atlas-sidebar-btn-outline {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 0;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #C8CAD8;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    text-decoration: none;
    transition: all 0.15s;
}
.atlas-sidebar-btn-outline:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.atlas-sidebar-btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 0;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: #7C5CFC;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.atlas-sidebar-btn-primary:hover {
    background: #6C4FE0;
    box-shadow: 0 2px 10px rgba(124,92,252,0.3);
}

/* My Calendars */
.atlas-sidebar-cal-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.atlas-sidebar-cal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.78rem;
    color: #C8CAD8;
}
.atlas-sidebar-cal-item:hover {
    background: rgba(255,255,255,0.04);
}
.atlas-sidebar-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #4A4B65;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.atlas-sidebar-checkbox:checked {
    border-color: #7C5CFC;
    background: #7C5CFC;
}
.atlas-sidebar-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
}
.atlas-sidebar-cal-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    background: rgba(124,92,252,0.2);
    color: #C4B5FD;
}

/* Categories */
.atlas-sidebar-cat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.atlas-sidebar-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.15s, opacity 0.2s;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
}
.atlas-sidebar-cat-item:hover {
    background: rgba(255,255,255,0.06);
}
.atlas-sidebar-cat-item:not(.active) {
    opacity: 0.4;
}
.atlas-sidebar-cat-item:not(.active) .atlas-sidebar-cat-bar > div {
    width: 0% !important;
}
.atlas-sidebar-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.atlas-sidebar-cat-name {
    font-size: 0.78rem;
    color: #C8CAD8;
    min-width: 65px;
}
.atlas-sidebar-cat-bar {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}
.atlas-sidebar-cat-bar > div {
    height: 100%;
    border-radius: 3px;
    background: currentColor;
    transition: width 0.3s ease;
}
.atlas-sidebar-cat-item:nth-child(1) .atlas-sidebar-cat-bar > div { background: #FFB547; }
.atlas-sidebar-cat-item:nth-child(2) .atlas-sidebar-cat-bar > div { background: #22CAAD; }
.atlas-sidebar-cat-item:nth-child(3) .atlas-sidebar-cat-bar > div { background: #FF6B6B; }


/* ───────────────────────────────────────
   MAIN CALENDAR AREA — Theme responsive
   ─────────────────────────────────────── */

/* Calendar container */
.atlas-cal-wrapper {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.02);
    overflow: hidden;
}
.dark .atlas-cal-wrapper {
    background: #252636;
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Calendar main area wrapper */
.atlas-cal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    overflow: hidden;
    background: #f8f9fc;
}
.dark .atlas-cal-main {
    background: #1E1F2E;
}

/* Calendar flex layout (sidebar + main) */
.atlas-cal-layout {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
    border-radius: 0;
}

/* Navigation header bar */
.atlas-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
}
.dark .atlas-cal-nav {
    background: rgba(37,38,54,0.6);
    border-bottom-color: rgba(255,255,255,0.07);
}

.atlas-cal-header-label {
    font-size: 1.35rem;
    font-weight: 400;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.dark .atlas-cal-header-label {
    color: #f1f5f9;
}

.atlas-cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #64748b;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.atlas-cal-nav-btn:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
.dark .atlas-cal-nav-btn {
    color: #94a3b8;
}
.dark .atlas-cal-nav-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.08);
}

.atlas-cal-today-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: all 0.15s ease;
}
.atlas-cal-today-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .atlas-cal-today-btn {
    color: #94a3b8;
    border-color: rgba(255,255,255,0.08);
    background: transparent;
}
.dark .atlas-cal-today-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}

/* Time gutter */
.atlas-cal-time-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-align: right;
    padding: 0 12px 0 4px;
    height: 60px;
    line-height: 1;
    margin-top: -6px;
    user-select: none;
}
.dark .atlas-cal-time-label {
    color: #475569;
}

/* Grid cells (clickable time slots) */
.atlas-cal-cell {
    height: 60px;
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.1s ease;
    position: relative;
}
.atlas-cal-cell:hover {
    background: rgba(124,92,252,0.03);
}
.atlas-cal-cell:hover::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 1.1rem;
    color: rgba(124,92,252,0.22);
    font-weight: 300;
    pointer-events: none;
}
.dark .atlas-cal-cell {
    border-color: rgba(255,255,255,0.07);
}
.dark .atlas-cal-cell:hover {
    background: rgba(124,92,252,0.05);
}
.dark .atlas-cal-cell:hover::after {
    color: rgba(124,92,252,0.3);
}

/* Half-hour dashed line */
.atlas-cal-cell::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    border-top: 1px dashed #e5e7eb;
    pointer-events: none;
}
.dark .atlas-cal-cell::before {
    border-top-color: rgba(255,255,255,0.025);
}

/* Day column headers */
.atlas-cal-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 4px 10px;
    border-left: 1px solid #e2e8f0;
    gap: 4px;
    background: #fafbfc;
}
.dark .atlas-cal-day-header {
    border-color: rgba(255,255,255,0.06);
    background: rgba(37,38,54,0.4);
}

.atlas-cal-day-header .atlas-cal-dow {
    font-size: 0.67rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.dark .atlas-cal-day-header .atlas-cal-dow {
    color: #475569;
}

.atlas-cal-day-header .atlas-cal-daynum {
    font-size: 1.35rem;
    font-weight: 300;
    color: #334155;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
}
.dark .atlas-cal-day-header .atlas-cal-daynum {
    color: #cbd5e1;
}

/* Today: dark circle with white text — refined */
.atlas-cal-day-header.atlas-cal-today .atlas-cal-dow {
    color: rgb(var(--brand-600));
    font-weight: 600;
    letter-spacing: 0.07em;
}
.dark .atlas-cal-day-header.atlas-cal-today .atlas-cal-dow {
    color: rgb(var(--brand-400));
}
.atlas-cal-day-header.atlas-cal-today .atlas-cal-daynum {
    background: rgb(var(--brand-600));
    color: #fff;
    font-weight: 400;
    box-shadow: 0 2px 8px rgb(var(--brand-600) / 0.35);
}
.dark .atlas-cal-day-header.atlas-cal-today .atlas-cal-daynum {
    background: rgb(var(--brand-600));
    color: #fff;
    box-shadow: 0 2px 8px rgb(var(--brand-600) / 0.4);
}

/* Today column background */
.atlas-cal-today {
    background: rgba(124,92,252,0.015);
}
.dark .atlas-cal-today {
    background: rgba(124,92,252,0.03);
}

/* Day column (relative container for meeting blocks) */
.atlas-cal-day-col {
    position: relative;
    border-left: 1px solid #e2e8f0;
    min-height: 100%;
    pointer-events: none;
}
.dark .atlas-cal-day-col {
    border-color: rgba(255,255,255,0.04);
}

/* Meeting block */
.atlas-cal-meeting-block {
    position: absolute;
    left: 3px;
    right: 4px;
    border-radius: 10px;
    padding: 6px 10px;
    overflow: hidden;
    cursor: pointer;
    z-index: 5;
    transition: box-shadow 0.15s ease, transform 0.12s ease;
    text-decoration: none;
    display: block;
    min-height: 22px;
    pointer-events: auto;
}
.atlas-cal-meeting-block:hover {
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.dark .atlas-cal-meeting-block:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15);
}

/* Meeting text */
.atlas-cal-meeting-title {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atlas-cal-meeting-time {
    font-size: 0.65rem;
    opacity: 0.72;
    line-height: 1.3;
    font-weight: 500;
}
.atlas-cal-meeting-organizer {
    font-size: 0.6rem;
    opacity: 0.5;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ──────────────────────────────────────
   Meeting Palette Colors (7 pastel colors)
   ────────────────────────────────────── */

/* Color 0 — Lavender Purple */
.atlas-cal-color-0 { background: #EDE9FE; color: #5B21B6; }
.dark .atlas-cal-color-0 { background: rgba(139,92,246,0.18); color: #C4B5FD; }

/* Color 1 — Mint Green */
.atlas-cal-color-1 { background: #D1FAE5; color: #065F46; }
.dark .atlas-cal-color-1 { background: rgba(16,185,129,0.18); color: #6EE7B7; }

/* Color 2 — Rose Pink */
.atlas-cal-color-2 { background: #FCE7F3; color: #9D174D; }
.dark .atlas-cal-color-2 { background: rgba(236,72,153,0.18); color: #F9A8D4; }

/* Color 3 — Warm Amber */
.atlas-cal-color-3 { background: #FEF3C7; color: #92400E; }
.dark .atlas-cal-color-3 { background: rgba(245,158,11,0.18); color: #FCD34D; }

/* Color 4 — Sky Blue */
.atlas-cal-color-4 { background: #DBEAFE; color: #1E40AF; }
.dark .atlas-cal-color-4 { background: rgba(59,130,246,0.18); color: #93C5FD; }

/* Color 5 — Teal */
.atlas-cal-color-5 { background: #CCFBF1; color: #134E4A; }
.dark .atlas-cal-color-5 { background: rgba(20,184,166,0.18); color: #5EEAD4; }

/* Color 6 — Peach Orange */
.atlas-cal-color-6 { background: #FFEDD5; color: #9A3412; }
.dark .atlas-cal-color-6 { background: rgba(249,115,22,0.18); color: #FDBA74; }

/* Month event pill colors */
.atlas-cal-month-event.atlas-cal-color-0 { background: #EDE9FE; color: #5B21B6; border-left-color: #8B5CF6; }
.atlas-cal-month-event.atlas-cal-color-1 { background: #D1FAE5; color: #065F46; border-left-color: #34D399; }
.atlas-cal-month-event.atlas-cal-color-2 { background: #FCE7F3; color: #9D174D; border-left-color: #F472B6; }
.atlas-cal-month-event.atlas-cal-color-3 { background: #FEF3C7; color: #92400E; border-left-color: #FBBF24; }
.atlas-cal-month-event.atlas-cal-color-4 { background: #DBEAFE; color: #1E40AF; border-left-color: #60A5FA; }
.atlas-cal-month-event.atlas-cal-color-5 { background: #CCFBF1; color: #134E4A; border-left-color: #2DD4BF; }
.atlas-cal-month-event.atlas-cal-color-6 { background: #FFEDD5; color: #9A3412; border-left-color: #FB923C; }

.dark .atlas-cal-month-event.atlas-cal-color-0 { background: rgba(139,92,246,0.14); color: #C4B5FD; border-left-color: #8B5CF6; }
.dark .atlas-cal-month-event.atlas-cal-color-1 { background: rgba(16,185,129,0.14); color: #6EE7B7; border-left-color: #34D399; }
.dark .atlas-cal-month-event.atlas-cal-color-2 { background: rgba(236,72,153,0.14); color: #F9A8D4; border-left-color: #F472B6; }
.dark .atlas-cal-month-event.atlas-cal-color-3 { background: rgba(245,158,11,0.14); color: #FCD34D; border-left-color: #FBBF24; }
.dark .atlas-cal-month-event.atlas-cal-color-4 { background: rgba(59,130,246,0.14); color: #93C5FD; border-left-color: #60A5FA; }
.dark .atlas-cal-month-event.atlas-cal-color-5 { background: rgba(20,184,166,0.14); color: #5EEAD4; border-left-color: #2DD4BF; }
.dark .atlas-cal-month-event.atlas-cal-color-6 { background: rgba(249,115,22,0.14); color: #FDBA74; border-left-color: #FB923C; }

/* ── Next-event card: colour wash for the ALWAYS-DARK sidebar ──
   The calendar sidebar never switches to a light theme (see the partial), and
   the card's text is light (#fff time, #E2E4F0 title). The generic
   .atlas-cal-color-N sets a PALE background meant for dark text — so in light
   mode the card became light text on a near-white fill: the washed-out,
   unreadable card. Force a subtle dark-tinted accent wash + an accent border in
   BOTH themes, so the card is always a premium dark card that simply takes on
   the meeting's colour. Two-class specificity (0,2,0) + later source order wins
   over both the base and the `.dark` colour rules above. */
.atlas-sidebar-event-card.atlas-cal-color-0 { background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(139,92,246,0.08)); border-color: rgba(139,92,246,0.42); }
.atlas-sidebar-event-card.atlas-cal-color-1 { background: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(16,185,129,0.08)); border-color: rgba(16,185,129,0.42); }
.atlas-sidebar-event-card.atlas-cal-color-2 { background: linear-gradient(135deg, rgba(236,72,153,0.22), rgba(236,72,153,0.08)); border-color: rgba(236,72,153,0.42); }
.atlas-sidebar-event-card.atlas-cal-color-3 { background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(245,158,11,0.08)); border-color: rgba(245,158,11,0.42); }
.atlas-sidebar-event-card.atlas-cal-color-4 { background: linear-gradient(135deg, rgba(59,130,246,0.22), rgba(59,130,246,0.08)); border-color: rgba(59,130,246,0.42); }
.atlas-sidebar-event-card.atlas-cal-color-5 { background: linear-gradient(135deg, rgba(20,184,166,0.22), rgba(20,184,166,0.08)); border-color: rgba(20,184,166,0.42); }
.atlas-sidebar-event-card.atlas-cal-color-6 { background: linear-gradient(135deg, rgba(249,115,22,0.22), rgba(249,115,22,0.08)); border-color: rgba(249,115,22,0.42); }

/* Status overrides */
.atlas-cal-meeting-block.atlas-cal-status-LIVE,
.atlas-cal-meeting-block.atlas-cal-status-live,
.atlas-cal-month-event.atlas-cal-status-LIVE,
.atlas-cal-month-event.atlas-cal-status-live {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
    border-left-color: #EF4444 !important;
    animation: atlas-cal-live-pulse 2.5s ease-in-out infinite;
}
.dark .atlas-cal-meeting-block.atlas-cal-status-LIVE,
.dark .atlas-cal-meeting-block.atlas-cal-status-live,
.dark .atlas-cal-month-event.atlas-cal-status-LIVE,
.dark .atlas-cal-month-event.atlas-cal-status-live {
    background: rgba(239,68,68,0.18) !important;
    color: #FCA5A5 !important;
}

.atlas-cal-meeting-block.atlas-cal-status-CANCELED,
.atlas-cal-meeting-block.atlas-cal-status-canceled,
.atlas-cal-month-event.atlas-cal-status-CANCELED,
.atlas-cal-month-event.atlas-cal-status-canceled {
    background: #F8FAFC !important;
    color: #94A3B8 !important;
    text-decoration: line-through;
    opacity: 0.55;
}
.dark .atlas-cal-meeting-block.atlas-cal-status-CANCELED,
.dark .atlas-cal-meeting-block.atlas-cal-status-canceled {
    background: rgba(148,163,184,0.08) !important;
}

@keyframes atlas-cal-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.82; }
}

/* Current time indicator (red line + dot — scoped to today's column) */
.atlas-cal-now-line {
    position: absolute;
    left: -1px; right: 0;
    height: 2px;
    background: #EF4444;
    z-index: 8;
    pointer-events: none;
}
.atlas-cal-now-line::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #EF4444;
}

/* Scroll container */
.atlas-cal-scroll-container {
    max-height: 700px;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.atlas-cal-scroll-container::-webkit-scrollbar { width: 6px; }
.atlas-cal-scroll-container::-webkit-scrollbar-track { background: transparent; }
.atlas-cal-scroll-container::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.atlas-cal-scroll-container::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }
.dark .atlas-cal-scroll-container { scrollbar-color: rgba(255,255,255,0.08) transparent; }
.dark .atlas-cal-scroll-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); }

/* Month view */
.atlas-cal-month-header {
    background: #fafbfc;
    border-bottom: 1px solid #e2e8f0;
}
.dark .atlas-cal-month-header {
    background: rgba(37,38,54,0.4);
    border-bottom-color: rgba(255,255,255,0.07);
}
.atlas-cal-month-header > div {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 10px 0;
}
.dark .atlas-cal-month-header > div {
    color: #475569;
}

.atlas-cal-month-cell {
    min-height: 110px;
    padding: 6px 8px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.1s ease;
}
.atlas-cal-month-cell:hover {
    background: rgba(124,92,252,0.02);
}
.dark .atlas-cal-month-cell {
    border-color: rgba(255,255,255,0.07);
}
.dark .atlas-cal-month-cell:hover {
    background: rgba(124,92,252,0.04);
}

.atlas-cal-month-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background-color 0.12s ease;
}
.dark .atlas-cal-month-day-num {
    color: #94a3b8;
}
.atlas-cal-month-cell.atlas-cal-today .atlas-cal-month-day-num {
    background: #1E1F2E;
    color: #fff;
    box-shadow: 0 2px 6px rgba(30,31,46,0.2);
}
.dark .atlas-cal-month-cell.atlas-cal-today .atlas-cal-month-day-num {
    background: #e2e8f0;
    color: #1E1F2E;
}

.atlas-cal-month-event {
    display: flex;
    align-items: center;
    font-size: 0.67rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.5;
    border-left: 2.5px solid transparent;
    transition: transform 0.1s ease;
    cursor: pointer;
}
.atlas-cal-month-event:hover {
    transform: translateX(1px);
}

/* ──────────────────────────────────────
   All-Day Tasks Row (Week/Day views)
   ────────────────────────────────────── */

.atlas-cal-allday-row {
    border-bottom: 2px solid #e2e8f0;
    background: #fafbfc;
    max-height: 120px;
    overflow-y: auto;
}
.dark .atlas-cal-allday-row {
    border-bottom-color: rgba(255,255,255,0.07);
    background: rgba(37,38,54,0.3);
}

.atlas-cal-allday-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 6px 8px 4px;
    text-align: right;
    justify-content: flex-end;
}
.dark .atlas-cal-allday-label {
    color: #475569;
}

.atlas-cal-allday-cell {
    padding: 4px 4px;
    border-left: 1px solid #e2e8f0;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dark .atlas-cal-allday-cell {
    border-color: rgba(255,255,255,0.07);
}

.atlas-cal-allday-day {
    /* Day view: single column gets more horizontal space */
}

/* ──────────────────────────────────────
   Task Block (all-day row in week/day)
   ────────────────────────────────────── */

.atlas-cal-task-block {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2.5px dashed transparent;
    background: #EFF6FF;
    color: #1E40AF;
    border-left-color: #60A5FA;
}
.atlas-cal-task-block:hover {
    transform: translateX(1px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.dark .atlas-cal-task-block {
    background: rgba(59,130,246,0.12);
    color: #93C5FD;
    border-left-color: #60A5FA;
}

.atlas-cal-task-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.7;
}

.atlas-cal-task-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

/* Task priority variants */
.atlas-cal-task-block.atlas-cal-task-priority-none {
    background: #F1F5F9;
    color: #475569;
    border-left-color: #94A3B8;
}
.dark .atlas-cal-task-block.atlas-cal-task-priority-none {
    background: rgba(100,116,139,0.12);
    color: #94A3B8;
    border-left-color: #64748B;
}

.atlas-cal-task-block.atlas-cal-task-priority-low {
    background: #EFF6FF;
    color: #1E40AF;
    border-left-color: #60A5FA;
}
.dark .atlas-cal-task-block.atlas-cal-task-priority-low {
    background: rgba(59,130,246,0.12);
    color: #93C5FD;
    border-left-color: #60A5FA;
}

.atlas-cal-task-block.atlas-cal-task-priority-medium {
    background: #FEF3C7;
    color: #92400E;
    border-left-color: #FBBF24;
}
.dark .atlas-cal-task-block.atlas-cal-task-priority-medium {
    background: rgba(245,158,11,0.12);
    color: #FCD34D;
    border-left-color: #FBBF24;
}

.atlas-cal-task-block.atlas-cal-task-priority-high {
    background: #FEF2F2;
    color: #991B1B;
    border-left-color: #F87171;
}
.dark .atlas-cal-task-block.atlas-cal-task-priority-high {
    background: rgba(239,68,68,0.12);
    color: #FCA5A5;
    border-left-color: #F87171;
}

.atlas-cal-task-block.atlas-cal-task-priority-urgent {
    background: #FEF2F2;
    color: #7F1D1D;
    border-left-color: #EF4444;
    font-weight: 600;
}
.dark .atlas-cal-task-block.atlas-cal-task-priority-urgent {
    background: rgba(239,68,68,0.18);
    color: #FCA5A5;
    border-left-color: #EF4444;
}

/* ──────────────────────────────────────
   Task in Month View (event pill style)
   ────────────────────────────────────── */

.atlas-cal-month-task {
    border-left-style: dashed !important;
}

.atlas-cal-month-task-icon {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    margin-right: 2px;
    opacity: 0.65;
}

/* Month task priority colors */
.atlas-cal-month-task.atlas-cal-task-priority-none {
    background: #F1F5F9;
    color: #475569;
    border-left-color: #94A3B8;
}
.dark .atlas-cal-month-task.atlas-cal-task-priority-none {
    background: rgba(100,116,139,0.1);
    color: #94A3B8;
    border-left-color: #64748B;
}

.atlas-cal-month-task.atlas-cal-task-priority-low {
    background: #EFF6FF;
    color: #1E40AF;
    border-left-color: #60A5FA;
}
.dark .atlas-cal-month-task.atlas-cal-task-priority-low {
    background: rgba(59,130,246,0.1);
    color: #93C5FD;
    border-left-color: #60A5FA;
}

.atlas-cal-month-task.atlas-cal-task-priority-medium {
    background: #FEF3C7;
    color: #92400E;
    border-left-color: #FBBF24;
}
.dark .atlas-cal-month-task.atlas-cal-task-priority-medium {
    background: rgba(245,158,11,0.1);
    color: #FCD34D;
    border-left-color: #FBBF24;
}

.atlas-cal-month-task.atlas-cal-task-priority-high {
    background: #FEF2F2;
    color: #991B1B;
    border-left-color: #F87171;
}
.dark .atlas-cal-month-task.atlas-cal-task-priority-high {
    background: rgba(239,68,68,0.1);
    color: #FCA5A5;
    border-left-color: #F87171;
}

.atlas-cal-month-task.atlas-cal-task-priority-urgent {
    background: #FEF2F2;
    color: #7F1D1D;
    border-left-color: #EF4444;
    font-weight: 600;
}
.dark .atlas-cal-month-task.atlas-cal-task-priority-urgent {
    background: rgba(239,68,68,0.14);
    color: #FCA5A5;
    border-left-color: #EF4444;
}

.atlas-cal-weekend {
    background: rgba(0,0,0,0.008);
}
.dark .atlas-cal-weekend {
    background: rgba(255,255,255,0.008);
}

/* ── Meeting Quick-View Overlay ── */
.atlas-quickview-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: transparent;
}
.atlas-quickview {
    position: fixed;
    z-index: 910;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    overflow: hidden;
    animation: atlas-quickview-in 0.18s ease-out;
    font-family: inherit;
}
.dark .atlas-quickview {
    background: #1E1F2E;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.06);
}
@keyframes atlas-quickview-in {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Color accent bar at top */
.atlas-quickview-accent {
    height: 4px;
    width: 100%;
}

/* Header */
.atlas-quickview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px 0;
    gap: 12px;
}
.atlas-quickview-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}
.dark .atlas-quickview-title { color: #f1f5f9; }

.atlas-quickview-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.12s;
}
.atlas-quickview-close:hover {
    background: #f1f5f9;
    color: #475569;
}
.dark .atlas-quickview-close:hover {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
}

/* Status badge */
.atlas-quickview-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 10px 20px 0;
}
.atlas-quickview-status.status-SCHEDULED,
.atlas-quickview-status.status-scheduled { background: #EFF6FF; color: #2563EB; }
.atlas-quickview-status.status-LIVE,
.atlas-quickview-status.status-live { background: #FEF2F2; color: #DC2626; }
.atlas-quickview-status.status-ENDED,
.atlas-quickview-status.status-ended { background: #F0FDF4; color: #16A34A; }
.atlas-quickview-status.status-DRAFT,
.atlas-quickview-status.status-draft { background: #F8FAFC; color: #64748B; }
.atlas-quickview-status.status-CANCELED,
.atlas-quickview-status.status-canceled { background: #F8FAFC; color: #94A3B8; text-decoration: line-through; }
.dark .atlas-quickview-status.status-SCHEDULED,
.dark .atlas-quickview-status.status-scheduled { background: rgba(37,99,235,0.15); color: #60A5FA; }
.dark .atlas-quickview-status.status-LIVE,
.dark .atlas-quickview-status.status-live { background: rgba(239,68,68,0.15); color: #FCA5A5; }
.dark .atlas-quickview-status.status-ENDED,
.dark .atlas-quickview-status.status-ended { background: rgba(22,163,106,0.15); color: #86EFAC; }
.dark .atlas-quickview-status.status-DRAFT,
.dark .atlas-quickview-status.status-draft { background: rgba(100,116,139,0.15); color: #94A3B8; }
.dark .atlas-quickview-status.status-CANCELED,
.dark .atlas-quickview-status.status-canceled { background: rgba(100,116,139,0.1); color: #64748B; }

/* Details section */
.atlas-quickview-details {
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.atlas-quickview-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.atlas-quickview-row svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #94a3b8;
    margin-top: 1px;
}
.dark .atlas-quickview-row svg { color: #64748b; }
.atlas-quickview-row-text {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
}
.dark .atlas-quickview-row-text { color: #94a3b8; }
.atlas-quickview-row-label {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 1px;
}
.dark .atlas-quickview-row-label { color: #64748b; }

/* Agenda preview */
.atlas-quickview-agenda {
    padding: 0 20px;
    margin-bottom: 4px;
}
.atlas-quickview-agenda-text {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.55;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    max-height: 80px;
    overflow: hidden;
    position: relative;
}
.dark .atlas-quickview-agenda-text {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
    color: #8b8ca7;
}

/* Footer with actions */
.atlas-quickview-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid #f1f5f9;
}
.dark .atlas-quickview-footer {
    border-top-color: rgba(255,255,255,0.06);
}
.atlas-quickview-btn {
    padding: 7px 18px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.atlas-quickview-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}
.atlas-quickview-btn-secondary:hover { background: #e2e8f0; color: #1e293b; }
.dark .atlas-quickview-btn-secondary { background: rgba(255,255,255,0.06); color: #94a3b8; }
.dark .atlas-quickview-btn-secondary:hover { background: rgba(255,255,255,0.1); color: #f1f5f9; }
.atlas-quickview-btn-primary {
    background: var(--brand-600, #7C3AED);
    color: #fff;
}
.atlas-quickview-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* Live pulse dot */
.atlas-quickview-live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #EF4444;
    animation: atlas-cal-live-pulse 2s ease-in-out infinite;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .atlas-sidebar { display: none; }
    .atlas-cal-layout { height: auto; }
    .atlas-cal-main { padding: 16px; }
}
@media (max-width: 768px) {
    .atlas-cal-scroll-container { max-height: 480px; }
    .atlas-cal-month-cell { min-height: 70px; padding: 3px 4px; }
    .atlas-cal-month-event { font-size: 0.6rem; padding: 1px 4px; }
    .atlas-cal-meeting-title { font-size: 0.68rem; }
    .atlas-cal-meeting-time { display: none; }
    .atlas-cal-meeting-organizer { display: none; }
    .atlas-cal-day-header .atlas-cal-daynum { font-size: 1.1rem; width: 32px; height: 32px; }
    .atlas-cal-day-header .atlas-cal-dow { font-size: 0.6rem; }
    .atlas-cal-header-label { font-size: 1rem; }
    .atlas-cal-nav { padding: 10px 12px; }
}
@media (max-width: 480px) {
    .atlas-cal-month-cell { min-height: 52px; }
    .atlas-cal-month-event { border-left: 0; padding: 1px 3px; font-size: 0.55rem; }
    .atlas-cal-month-day-num { width: 24px; height: 24px; font-size: 0.72rem; }
    .atlas-cal-cell::after { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet Restructuring
   Breakpoints: 640px (sm), 768px (md), 1024px (lg)
   ═══════════════════════════════════════════════════════════ */

/* ── Mobile-first: touches ── */
@media (max-width: 639px) {
    /* Navbar: tighter spacing */
    .atlas-navbar .max-w-6xl { padding-left: 0.75rem; padding-right: 0.75rem; }
    .atlas-navbar .h-14 { height: 3rem; }

    /* Brand name: smaller on mobile */
    .atlas-navbar .text-xl { font-size: 1rem; }

    /* Right-side navbar icons: tighter */
    .atlas-navbar .space-x-1 { gap: 0; }

    /* Main content: reduce padding */
    #main-content { padding-left: 0.75rem; padding-right: 0.75rem; padding-top: 1rem; padding-bottom: 1rem; }

    /* Cards: smaller radius on mobile */
    .atlas-card { border-radius: 0.75rem; }

    /* Page headings */
    h1.text-2xl { font-size: 1.35rem; }

    /* Filter form: stack vertically */
    .atlas-filter-form { flex-direction: column; }
    .atlas-filter-form > select,
    .atlas-filter-form > input { width: 100%; }

    /* Task row: compact */
    .atlas-task-row { padding: 0.625rem 0.75rem; margin-bottom: 0.25rem; border-radius: 0.625rem; }
    .atlas-task-row .mr-3 { margin-right: 0.5rem; }

    /* Badge: slightly smaller */
    .atlas-badge { font-size: 0.6rem; padding: 0.1rem 0.45rem; }

    /* Meeting cards: compact */
    .atlas-meeting-meta { flex-wrap: wrap; gap: 0.375rem; }

    /* Meeting detail: stack actions vertically */
    .atlas-detail-actions { flex-direction: column; gap: 0.5rem; }
    .atlas-detail-actions > * { width: 100%; text-align: center; justify-content: center; }

    /* Meeting info grid: single column */
    .atlas-meeting-info-grid { grid-template-columns: 1fr !important; gap: 0.75rem; }

    /* Settings: full-width buttons */
    .atlas-settings-save { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .atlas-settings-save button { width: 100%; justify-content: center; }

    /* Quickview: full-width on mobile */
    .atlas-quickview {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Footer: stack vertically */
    footer .flex-col { gap: 0.5rem; }
    footer .text-xs { font-size: 0.65rem; }

    /* Toast messages: full width */
    .atlas-toast { border-radius: 0.5rem; }
}

/* ── Tablet: 640px–767px ── */
@media (min-width: 640px) and (max-width: 767px) {
    /* Main content: moderate padding */
    #main-content { padding-left: 1rem; padding-right: 1rem; }

    /* Task row: slightly larger touch targets */
    .atlas-task-row { padding: 0.75rem 1rem; }

    /* Meeting info grid: 2 columns */
    .atlas-meeting-info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet landscape: 768px–1023px ── */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Calendar: force day view styles when week view is too cramped */
    .atlas-cal-scroll-container { max-height: 520px; }

    /* Meeting detail: adjust MoM column width */
    .atlas-meeting-mom-col { width: 380px; }
}

/* ── Calendar week view: horizontal scroll on tablet ── */
@media (max-width: 1024px) {
    #cal-week-grid,
    .atlas-cal-allday-row .grid,
    .atlas-cal-scroll-container > .grid {
        min-width: 700px;
    }
    .atlas-cal-scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .atlas-cal-allday-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #cal-week-grid {
        overflow-x: auto;
    }
}

/* ── Calendar: mobile-specific ── */
@media (max-width: 639px) {
    .atlas-cal-main { padding: 8px; }
    .atlas-cal-nav { padding: 10px; gap: 8px; }
    .atlas-cal-header-label { font-size: 1.1rem; }
    .atlas-cal-today-btn { padding: 4px 12px; font-size: 0.75rem; }
    .atlas-cal-nav-btn { width: 28px; height: 28px; border-radius: 8px; }
    .atlas-cal-mode-btn { padding: 3px 10px; font-size: 0.7rem; }

    /* Day headers: abbreviated */
    .atlas-cal-dow { font-size: 0.55rem; }
    .atlas-cal-daynum { font-size: 0.85rem; width: 28px; height: 28px; line-height: 28px; }
}

/* ── Notification page: mobile touch targets ── */
@media (max-width: 639px) {
    .atlas-notif-item { padding: 0.75rem; }
    .atlas-notif-actions { flex-direction: column; gap: 0.375rem; }
    .atlas-notif-actions .atlas-btn { width: 100%; text-align: center; }
}

/* ── Settings page: mobile stacking ── */
@media (max-width: 639px) {
    .atlas-settings-grid-3 { grid-template-columns: 1fr; }
    .atlas-settings-bottom-row { grid-template-columns: 1fr; }
}

/* ── Touch-friendly: increase tap targets on mobile ── */
@media (pointer: coarse) {
    .atlas-checkbox { width: 1.5rem; height: 1.5rem; }
    .atlas-task-row { min-height: 44px; }
    .atlas-btn-primary { min-height: 44px; }
    a.px-3.py-1\.5 { min-height: 44px; display: inline-flex; align-items: center; }

    /* Larger close/action buttons */
    button[aria-label="Delete task"] { padding: 0.5rem; }
    button[aria-label="Dismiss notification"] { padding: 0.5rem; }

    /* Extend the complete-checkbox tap area to ~44px without changing its look */
    .atlas-checkbox-touch { position: relative; }
    .atlas-checkbox-touch::after { content: ""; position: absolute; inset: -10px; }
}

/* Comfortable touch targets on the narrow (phone) layout — width-based so they
   apply regardless of the browser's reported pointer type. */
@media (max-width: 640px) {
    #mobile-menu .mv-nav-link { min-height: 44px; align-items: center; }
    .atlas-view-btn { min-height: 38px; display: inline-flex; align-items: center; }
}

/* ── Print media: hide nav, simplify layout ── */
@media print {
    .atlas-navbar, #mobile-menu, footer, .atlas-btn-primary { display: none !important; }
    .atlas-card { border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; }
    .atlas-task-row:hover { transform: none; box-shadow: none; }
    #main-content { max-width: 100%; padding: 0; }
}

/* ═══════════════════════════════════════════════════════════
   Premium top navigation — Phase 4 Wave 2
   Meetings-first, refined header. Plain CSS (light/dark aware),
   loaded after app.css so it composes with Tailwind utilities.
   ═══════════════════════════════════════════════════════════ */
.atlas-navbar { box-shadow: 0 1px 0 rgba(16,24,40,.04), 0 4px 20px -12px rgba(16,24,40,.18); }
.dark .atlas-navbar { box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 8px 24px -16px rgba(0,0,0,.6); }

/* Brand lockup — Mavion Meets "Ocean" gradient (indigo → blue → cyan) */
.mv-brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, rgb(var(--brand-600)) 0%, #3b82f6 55%, #22d3ee 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 3px 10px rgba(59,130,246,.4);
}
.mv-brand-mark svg { width: 62%; height: 62%; }
.mv-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.mv-brand-word {
  font-size: 1.16rem; font-weight: 800; letter-spacing: -.025em;
  white-space: nowrap;
  background: linear-gradient(90deg, rgb(var(--brand-500)), rgb(var(--brand-700)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dark .mv-brand-word { background: linear-gradient(90deg, rgb(var(--brand-200)), rgb(var(--brand-400))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Vertical separator */
.mv-nav-sep { width: 1px; height: 22px; background: rgba(16,24,40,.09); margin: 0 4px; }
.dark .mv-nav-sep { background: rgba(255,255,255,.1); }

/* Nav links (pills with icons) */
.mv-nav-link {
  /* display comes from Tailwind utilities in markup (flex / sm:inline-flex)
     so responsive hidden/visible utilities are never overridden by this class */
  align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: #4b5563; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.mv-nav-link svg { width: 16px; height: 16px; opacity: .65; }
.mv-nav-link:hover { background: rgba(16,24,40,.05); color: #111827; }
.mv-nav-link:hover svg { opacity: .9; }
.dark .mv-nav-link { color: #9aa3b2; }
.dark .mv-nav-link:hover { background: rgba(255,255,255,.06); color: #f3f4f6; }
.mv-nav-link.active { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
.mv-nav-link.active svg { opacity: 1; }
.dark .mv-nav-link.active { background: rgb(var(--brand-500) / .18); color: rgb(var(--brand-200)); }
/* Unread pill on the Chat nav entry */
.mv-nav-badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px;
  text-align: center; margin-left: 2px;
}

/* ── Premium mobile-menu nav rows (larger, touch-friendly, icon + label) ── */
.mv-msection {
  font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: #94a3b8; padding: 12px 12px 4px; margin-top: 2px;
}
.dark .mv-msection { color: #7c8db6; }
.mv-mnav {
  display: flex; align-items: center; gap: 13px; width: 100%;
  min-height: 46px; padding: 10px 12px; border-radius: 12px;
  font-size: 15px; font-weight: 600; color: #374151; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.mv-mnav svg { width: 20px; height: 20px; flex: 0 0 20px; opacity: .7; }
.mv-mnav:active { background: rgba(16,24,40,.06); }
.mv-mnav:hover { background: rgba(16,24,40,.05); color: #111827; }
.mv-mnav:hover svg { opacity: .95; }
.dark .mv-mnav { color: #cbd5e1; }
.dark .mv-mnav:hover, .dark .mv-mnav:active { background: rgba(255,255,255,.07); color: #f8fafc; }
.mv-mnav.active { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
.mv-mnav.active svg { opacity: 1; }
.dark .mv-mnav.active { background: rgb(var(--brand-500) / .20); color: rgb(var(--brand-200)); }
.mv-mnav .mv-nav-badge { margin-left: auto; }

/* Meetings gets a persistent subtle accent (meetings-first) */
.mv-nav-link.mv-accent:not(.active) { color: rgb(var(--brand-600)); }
.mv-nav-link.mv-accent:not(.active) svg { opacity: .85; }
.dark .mv-nav-link.mv-accent:not(.active) { color: rgb(var(--brand-300)); }

/* Primary CTA — New Meeting */
.mv-cta {
  /* display via utilities in markup (inline-flex / flex) */
  align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 11px;
  font-size: 13.5px; font-weight: 700; color: #fff; white-space: nowrap;
  /* Same-hue accent gradient (500→700): the CTA follows the chosen accent
     cohesively but stays understated — no fixed multi-hue rainbow. */
  background: linear-gradient(135deg, rgb(var(--brand-500)) 0%, rgb(var(--brand-600)) 55%, rgb(var(--brand-700)) 100%);
  box-shadow: 0 3px 12px rgb(var(--brand-600) / .32);
  transition: transform .15s, box-shadow .15s;
}
.mv-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgb(var(--brand-600) / .5); color: #fff; }
.mv-cta svg { width: 16px; height: 16px; }

/* Utility icon buttons */
.mv-icon-btn {
  /* display via utilities in markup (inline-flex) */
  align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; color: #6b7280; position: relative;
  transition: background-color .15s, color .15s;
}
.mv-icon-btn:hover { background: rgba(16,24,40,.05); color: #111827; }
.dark .mv-icon-btn { color: #9aa3b2; }
.dark .mv-icon-btn:hover { background: rgba(255,255,255,.06); color: #f3f4f6; }
.mv-icon-btn svg { width: 19px; height: 19px; }

/* Notification badge */
.mv-badge {
  position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
  border: 2px solid rgba(255,255,255,.9);
}
.dark .mv-badge { border-color: #0f172a; }

/* Roomy centered search wrapper — dedicated class because the compiled
   Tailwind build purges `md:flex`, so `hidden md:flex` would stay hidden. */
.mv-searchbar { display: none; }
@media (min-width: 768px) {
  .mv-searchbar { display: flex; flex: 1 1 0%; min-width: 0; justify-content: center; }
}

/* Search field in the bar */
.mv-search {
  display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 11px;
  background: rgba(16,24,40,.045); border: 1px solid transparent;
  transition: border-color .15s, background-color .15s;
}
.mv-search:focus-within { background: var(--surface, #fff); border-color: rgb(var(--brand-500)); }
.dark .mv-search { background: rgba(255,255,255,.05); }
.dark .mv-search:focus-within { background: rgba(15,23,42,.9); border-color: rgb(var(--brand-400)); }
.mv-search svg { width: 16px; height: 16px; color: #9ca3af; flex-shrink: 0; }
.mv-search input { border: none; background: none; outline: none; font-size: 13.5px; flex: 1; width: 100%; min-width: 0; color: inherit; }
.mv-search input::placeholder { color: #9ca3af; }
.mv-search-kbd {
  margin-left: auto; flex: 0 0 auto; font-size: 11px; font-weight: 600; color: #9ca3af;
  border: 1px solid rgba(16,24,40,.12); border-radius: 5px; padding: 0 6px; line-height: 17px; background: #fff;
}
.dark .mv-search-kbd { color: #94a3b8; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); }

/* ── Nav dropdowns (Tasks · + New) ── */
.mv-navdrop { position: relative; }
.mv-navdrop > button { display: inline-flex; align-items: center; gap: 7px; border: none; cursor: pointer; font: inherit; }
.mv-navdrop > .mv-nav-link { background: transparent; }
.mv-drop-chev { width: 13px !important; height: 13px !important; opacity: .55; margin-left: 1px; }
.mv-drop {
  position: absolute; top: calc(100% + 9px); z-index: 60; min-width: 194px;
  background: #fff; border: 1px solid #e6e9f0; border-radius: 14px;
  box-shadow: 0 22px 52px rgba(15,23,42,.17); padding: 6px; display: none;
}
.mv-drop.open { display: block; animation: mvDropIn .14s ease; }
@keyframes mvDropIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.dark .mv-drop { background: #151f33; border-color: #2a3852; box-shadow: 0 24px 56px rgba(0,0,0,.55); }
#tasks-drop { left: 0; }
#new-drop { right: 0; }
.mv-drop a, .mv-drop button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #374151;
  border: none; background: none; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.mv-drop > a > svg, .mv-drop > form > button > svg { width: 16px; height: 16px; opacity: .6; flex: 0 0 auto; }
.mv-drop > a:hover, .mv-drop > form > button:hover { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
.dark .mv-drop a, .dark .mv-drop button { color: #cbd5e1; }
.dark .mv-drop > a:hover, .dark .mv-drop > form > button:hover { background: rgb(var(--brand-500) / .18); color: rgb(var(--brand-200)); }
.mv-drop form { margin: 0; }

/* + New rich create menu */
.mv-drop-new { min-width: 266px; padding: 7px; }
.mv-drop-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; font-weight: 700; padding: 7px 10px 5px; }
.mv-drop-item { gap: 11px !important; padding: 8px 10px !important; align-items: center; }
.mv-drop-item:hover { background: #f4f6fb !important; color: #374151 !important; }
.dark .mv-drop-item:hover { background: rgba(255,255,255,.05) !important; color: #cbd5e1 !important; }
.mv-drop-ic {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2));
  box-shadow: 0 3px 9px color-mix(in srgb, var(--g1) 42%, transparent);
}
.mv-drop-ic svg { width: 17px !important; height: 17px !important; opacity: 1 !important; }
.mv-drop-txt { display: flex; flex-direction: column; min-width: 0; }
.mv-drop-name { font-size: 13px; font-weight: 600; color: #111827; }
.dark .mv-drop-name { color: #f1f5f9; }
.mv-drop-sub { font-size: 11px; font-weight: 500; color: #9ca3af; }
.mv-drop-div { height: 1px; background: #eef1f6; margin: 6px 8px; }
.dark .mv-drop-div { background: #2a3852; }

/* User avatar + dropdown menu */
.mv-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, rgb(var(--brand-600)) 0%, #3b82f6 55%, #22d3ee 100%);
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
  border: 2px solid rgba(255,255,255,.6); transition: transform .12s;
}
.mv-avatar:hover { transform: scale(1.05); }
.dark .mv-avatar { border-color: rgba(255,255,255,.12); }

.mv-usermenu { position: relative; }
.mv-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px;
  background: #fff; border: 1px solid rgba(16,24,40,.08); border-radius: 13px;
  box-shadow: 0 12px 34px rgba(16,24,40,.16); padding: 7px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s; z-index: 70;
}
.dark .mv-menu { background: #161b25; border-color: rgba(255,255,255,.08); box-shadow: 0 12px 34px rgba(0,0,0,.5); }
.mv-menu.open { opacity: 1; visibility: visible; transform: none; }
.mv-menu .mv-menu-head { padding: 9px 11px 11px; border-bottom: 1px solid rgba(16,24,40,.07); margin-bottom: 5px; }
.dark .mv-menu .mv-menu-head { border-bottom-color: rgba(255,255,255,.07); }
.mv-menu .mv-menu-name { font-size: 13.5px; font-weight: 700; color: #111827; }
.dark .mv-menu .mv-menu-name { color: #f3f4f6; }
.mv-menu .mv-menu-email { font-size: 11.5px; color: #6b7280; }
.mv-menu a, .mv-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  color: #374151; background: none; border: none; cursor: pointer; text-align: left; transition: background-color .12s;
}
.mv-menu a svg, .mv-menu button svg { width: 17px; height: 17px; opacity: .7; }
.mv-menu a:hover { background: rgb(var(--brand-50)); color: rgb(var(--brand-700)); }
.dark .mv-menu a { color: #d1d5db; }
.dark .mv-menu a:hover { background: rgb(var(--brand-500) / .16); color: rgb(var(--brand-200)); }
.mv-menu .mv-menu-danger:hover { background: #fef2f2; color: #dc2626; }
.dark .mv-menu .mv-menu-danger { color: #f3f4f6; }
.dark .mv-menu .mv-menu-danger:hover { background: rgba(220,38,38,.16); color: #fca5a5; }

/* ═══════════════════════════════════════════════════════════
   Toast notifications — Phase 4 Wave 4 (replaces alert())
   ═══════════════════════════════════════════════════════════ */
.mv-toast-host {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px; width: calc(100vw - 32px); pointer-events: none;
}
@media (min-width: 480px) { .mv-toast-host { width: 380px; } }
.mv-toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  background: #fff; color: #1f2937;
  border: 1px solid rgba(16,24,40,.08); border-left: 4px solid #64748b;
  border-radius: 12px; padding: 12px 12px 12px 14px;
  box-shadow: 0 12px 34px rgba(16,24,40,.18);
  font-size: 13.5px; line-height: 1.45;
  transform: translateX(120%); opacity: 0;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .28s;
}
.mv-toast.show { transform: none; opacity: 1; }
.dark .mv-toast { background: #1b2130; color: #e5e7eb; border-color: rgba(255,255,255,.08); }
.mv-toast-ic { font-weight: 800; font-size: 14px; line-height: 1.5; flex-shrink: 0; color: #64748b; }
.mv-toast-msg { flex: 1; }
.mv-toast-x {
  background: none; border: none; color: #9ca3af; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 2px; flex-shrink: 0;
}
.mv-toast-x:hover { color: #4b5563; }
.dark .mv-toast-x:hover { color: #e5e7eb; }
.mv-toast-error   { border-left-color: #ef4444; }
.mv-toast-error   .mv-toast-ic { color: #ef4444; }
.mv-toast-success { border-left-color: #22c55e; }
.mv-toast-success .mv-toast-ic { color: #22c55e; }
.mv-toast-warning { border-left-color: #f59e0b; }
.mv-toast-warning .mv-toast-ic { color: #f59e0b; }
.mv-toast-info    { border-left-color: #3b82f6; }
.mv-toast-info    .mv-toast-ic { color: #3b82f6; }

/* ═══════════════════════════════════════════════════════════
   Pre-join lobby — Phase 4 Wave 4
   ═══════════════════════════════════════════════════════════ */
.mv-lobby {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 30% 15%, #1e293b, #0b1120);
}
.mv-lobby.hidden { display: none; }
.mv-lobby-card {
  width: 100%; max-width: 460px; background: #161b25; color: #e5e7eb;
  border-radius: 20px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.06);
}
.mv-lobby-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.mv-lobby-sub { font-size: 13px; color: #9aa3b2; margin-top: 2px; }
.mv-lobby-stage {
  position: relative; margin: 16px 0; aspect-ratio: 16 / 10; background: #0b0f18;
  border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.mv-lobby-stage video { width: 100%; height: 100%; object-fit: cover; }
.mv-lobby-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--brand-600)), #22d3ee);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800;
}
.mv-lobby-meter { position: absolute; left: 12px; bottom: 12px; width: 64px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; }
.mv-lobby-meter span { display: block; height: 100%; width: 0; background: #22c55e; transition: width .06s linear; }
.mv-lobby-stage-ctrls { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.mv-lobby-mini {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.mv-lobby-mini svg { width: 20px; height: 20px; }
.mv-lobby-mini:hover { background: rgba(255,255,255,.26); }
.mv-lobby-mini.off { background: #ef4444; }
.mv-lobby-devices { display: flex; flex-direction: column; gap: 10px; }
.mv-lobby-devices label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9aa3b2; display: flex; flex-direction: column; gap: 4px; }
.mv-lobby-devices select {
  font-size: 13.5px; padding: 10px 34px 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16);
  background-color: #1a2233; color: #f1f5f9; font-weight: 500; text-transform: none; letter-spacing: 0;
  width: 100%; max-width: 100%; appearance: none; -webkit-appearance: none;
  /* Render the native option popup in dark mode (Chrome/Edge) so it isn't
     dark-text-on-dark; a light chevron via inline SVG since appearance is off. */
  color-scheme: dark; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.mv-lobby-devices select:focus { outline: none; border-color: var(--mv-accent, #6d5cff); box-shadow: 0 0 0 2px rgba(109,92,255,.35); }
.mv-lobby-devices select option { background: #1a2233; color: #f1f5f9; }
.mv-lobby-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.mv-lobby-cancel { font-size: 13.5px; color: #9aa3b2; text-decoration: none; font-weight: 600; }
.mv-lobby-cancel:hover { color: #e5e7eb; }
.mv-lobby-actions .mv-cta { display: inline-flex; font-size: 14.5px; padding: 11px 22px; }

/* ═══════════════════════════════════════════════════════════
   Reactions — Phase 4 Wave 4 (emoji palette + floating animation)
   ═══════════════════════════════════════════════════════════ */
.mv-react-wrap { position: relative; display: inline-flex; }
.mv-react-palette {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(6px);
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 8px 10px; border-radius: 14px;
  background: #1b2130; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  max-width: 272px; max-height: 208px; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s, visibility .15s; z-index: 60;
}
.mv-react-palette.open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mv-react-palette button {
  background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1;
  padding: 4px; border-radius: 8px; transition: transform .1s, background .12s;
}
.mv-react-palette button:hover { transform: scale(1.25); background: rgba(255,255,255,.08); }

.mv-reactions-layer {
  position: fixed; left: 0; right: 0; bottom: 96px; height: 42vh; z-index: 150;
  pointer-events: none; overflow: hidden;
}
.mv-reaction {
  position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  animation: mv-react-float 3.6s cubic-bezier(.25,.6,.3,1) forwards;
}
.mv-reaction-emoji {
  font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0,0,0,.45));
  animation: mv-react-wobble 1s ease-in-out infinite;
}
.mv-reaction-name {
  font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
/* Organic rise with a gentle horizontal drift (per-emoji --dx) + pop-in. */
@keyframes mv-react-float {
  0%   { transform: translate(0, 22px) scale(.4); opacity: 0; }
  10%  { transform: translate(0, 0) scale(1.15); opacity: 1; }
  35%  { transform: translate(calc(var(--dx, 0px) * .45), -13vh) scale(1); }
  65%  { transform: translate(var(--dx, 0px), -27vh) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--dx, 0px) * 1.25), -42vh) scale(.9); opacity: 0; }
}
@keyframes mv-react-wobble {
  0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; }
}
/* Confetti canvas — full-viewport, non-interactive, above the stage. */
.mv-confetti-canvas { position: fixed; inset: 0; z-index: 155; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .mv-reaction-emoji { animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   In-call device settings popover — Phase 4 Wave 4
   ═══════════════════════════════════════════════════════════ */
.mv-devset-wrap { position: relative; display: inline-flex; }
.mv-filter-wrap { position: relative; display: inline-flex; }
.mv-filter-dot { display:none; position:absolute; right:8px; top:7px; width:7px; height:7px; border-radius:999px; background:#22d3ee; box-shadow:0 0 0 2px #111827; }
.ctrl-btn.filtering { color:#67e8f9; background:rgba(8,145,178,.22); }
.ctrl-btn.filtering .mv-filter-dot { display:block; }
.mv-filter-picker { position:absolute; z-index:95; bottom:calc(100% + 14px); left:50%; width:430px; max-height:min(620px,75vh); overflow-y:auto; padding:14px; border:1px solid rgba(148,163,184,.2); border-radius:16px; background:rgba(13,18,30,.98); box-shadow:0 22px 60px rgba(0,0,0,.45); opacity:0; visibility:hidden; transform:translate(-50%,8px) scale(.97); transition:.16s ease; color:#e5e7eb; }
.mv-filter-picker.open { opacity:1; visibility:visible; transform:translate(-50%,0) scale(1); }
.mv-filter-head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:11px; font-size:14px; font-weight:800; }
.mv-filter-head small { color:#7c8db6; font-size:10px; font-weight:500; }
.mv-filter-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.mv-filter-choice { position:relative; display:flex; min-width:0; flex-direction:column; align-items:center; gap:5px; padding:9px 5px 7px; border:1px solid rgba(148,163,184,.15); border-radius:11px; background:rgba(255,255,255,.035); color:#cbd5e1; font-size:10px; font-weight:700; line-height:1.15; transition:.14s ease; }
.mv-filter-choice:hover { border-color:rgba(34,211,238,.48); background:rgba(34,211,238,.08); color:#fff; transform:translateY(-1px); }
.mv-filter-choice.active { border-color:#22d3ee; background:rgba(8,145,178,.2); color:#fff; box-shadow:inset 0 0 0 1px rgba(34,211,238,.18); }
.mv-filter-icon { display:grid; width:34px; height:34px; place-items:center; border-radius:10px; background:rgba(255,255,255,.07); font-size:22px; }
.mv-filter-choice i { position:absolute; right:5px; top:5px; overflow:hidden; width:6px; height:6px; border-radius:50%; background:#22d3ee; color:transparent; }
.mv-filter-note { margin-top:10px; color:#7c8db6; font-size:10px; line-height:1.4; }
@media (max-width: 520px) { .mv-filter-picker { position:fixed; left:12px; right:12px; bottom:82px; width:auto; transform:translateY(8px) scale(.97); } .mv-filter-picker.open { transform:none; } }
/* Centered modal overlay (dim backdrop + card) — not an awkward bottom popover */
.mv-devset-backdrop {
  position: fixed; inset: 0; background: rgba(8, 12, 22, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s; z-index: 190;
}
.mv-devset-backdrop.open { opacity: 1; visibility: visible; }
.mv-devset {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98);
  width: 620px; max-width: 94vw; max-height: 92vh; overflow-y: auto;
  padding: 18px 20px 18px; border-radius: 18px;
  background: #1b2130; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 13px;
  opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s; z-index: 200;
}
/* Two-column body so the panel stays wide, not tall (no vertical scroll) */
.mv-devset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.mv-devset-col { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
@media (max-width: 600px) {
  .mv-devset { width: 380px; gap: 9px; padding: 15px 16px 14px; max-height: 95vh; }
  .mv-devset-grid { grid-template-columns: 1fr; gap: 9px; }
  .mv-devset-col { gap: 8px; }
  .mv-devset-preview { max-height: 132px; }   /* keep the whole sheet inside the viewport */
}
.mv-devset.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.mv-devset-head { display: flex; align-items: center; justify-content: space-between; }
.mv-devset-h { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .2px; }
.mv-devset-x {
  width: 30px; height: 30px; border: none; background: rgba(255,255,255,.06); color: #9aa3b2;
  border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.mv-devset-x svg { width: 16px; height: 16px; }
.mv-devset-x:hover { background: rgba(255,255,255,.12); color: #fff; }
.mv-devset-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9aa3b2; }
/* Live self-view at the top of the settings modal */
.mv-devset-preview {
  position: relative; width: 100%; aspect-ratio: 16 / 9; flex: 0 0 auto; border-radius: 12px; overflow: hidden;
  background: #0b0f1a; border: 1px solid rgba(255,255,255,.10);
}
.mv-devset-preview video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Self-view mirror is a per-user choice (default on). Applies to the settings
   preview, the lobby preview and the in-call local tile — display only. */
.mv-devset-preview.mv-mirror video,
.mv-lobby-stage.mv-mirror video,
.av-tile.mv-mirror video { transform: scaleX(-1); }
.mv-devset-preview-off {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #7c8db6; font-size: 12px; font-weight: 600;
}
.mv-devset-preview-off svg { width: 26px; height: 26px; opacity: .85; }
/* Background-effect picker */
.mv-bg-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mv-bg-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
  background: #0f1420; color: #cbd5e1; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.mv-bg-btn svg { width: 20px; height: 20px; }
.mv-bg-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.mv-bg-btn.active { border-color: var(--brand-3, #22d3ee); background: rgba(34,211,238,.12); color: #fff; }
.mv-devset-hint { font-size: 10.5px; line-height: 1.45; color: #7c8db6; }
.mv-devset label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9aa3b2; display: flex; flex-direction: column; gap: 4px; }
.mv-devset select {
  font-size: 13px; padding: 8px 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12);
  background: #0f1420; color: #e5e7eb; font-weight: 500; text-transform: none; letter-spacing: 0; max-width: 100%;
  color-scheme: dark;   /* render the native option popup in dark chrome */
}
/* Settings toggle switch (e.g. Mirror my video) */
.mv-devset-switch {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-weight: 500;
}
.mv-devset-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mv-devset-switch-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; color: #cbd5e1; font-size: 13px; }
.mv-devset-switch-txt small { font-size: 10.5px; color: #7c8db6; font-weight: 400; }
.mv-switch {
  flex: 0 0 auto; width: 40px; height: 23px; border-radius: 999px;
  background: rgba(255,255,255,.14); position: relative; transition: background .15s ease;
}
.mv-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; transition: transform .16s cubic-bezier(.2,.8,.2,1); box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.mv-devset-switch input:checked + .mv-switch { background: var(--brand-3, #22d3ee); }
.mv-devset-switch input:checked + .mv-switch .mv-switch-thumb { transform: translateX(17px); }
.mv-devset-switch input:focus-visible + .mv-switch { box-shadow: 0 0 0 3px rgba(34,211,238,.35); }

.mv-devset select option { background: #0f1420; color: #e5e7eb; }
.mv-devset select option:checked { background: var(--brand, rgb(var(--brand-600))); color: #fff; }
/* The room renders dark without the .dark class, so the global
   .atlas-input:focus (white) would flash the select light on focus. Pin it. */
.mv-devset select:focus,
.mv-devset select.atlas-input,
.mv-devset select.atlas-input:focus {
  background: #0f1420; color: #e5e7eb; border-color: rgb(var(--brand-400) / .5);
  box-shadow: 0 0 0 3px rgb(var(--brand-400) / .18); outline: none;
}

/* Toast action button (e.g. "Switch" on a device-change prompt) */
.mv-toast-action {
  flex-shrink: 0; align-self: center; background: var(--brand, rgb(var(--brand-600))); color: #fff;
  border: none; border-radius: 8px; padding: 5px 11px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: filter .12s;
}
.mv-toast-action:hover { filter: brightness(1.1); }

/* ═══════════════════════════════════════════════════════════
   Meeting-room tiles: connection signal + grid overflow — Wave 4
   (in theme.css so it's a cache-bustable linked stylesheet)
   ═══════════════════════════════════════════════════════════ */
.av-tile.overflow-tile { background: #0f172a; }
.av-tile.overflow-tile .tile-avatar { background: rgba(255,255,255,0.08); font-size: 20px; font-weight: 800; }

.av-tile .tile-signal {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  display: flex; align-items: flex-end; gap: 2px; height: 15px;
  padding: 3px 4px; background: rgba(0,0,0,0.45); border-radius: 5px;
}
.av-tile .tile-signal i { width: 3px; border-radius: 1px; background: var(--sig, #94a3b8); }
.av-tile .tile-signal i:nth-child(1) { height: 5px; }
.av-tile .tile-signal i:nth-child(2) { height: 9px; }
.av-tile .tile-signal i:nth-child(3) { height: 13px; }
.av-tile .tile-signal.q-unknown { opacity: 0.5; }
.av-tile .tile-signal.q-good    { --sig: #22c55e; }
.av-tile .tile-signal.q-poor    { --sig: #f59e0b; }
.av-tile .tile-signal.q-bad     { --sig: #ef4444; }

/* ═══════════════════════════════════════════════════════════
   Meeting Room — Base layout, AV grid, controls, chat
   Extracted from meeting_room.html inline <style> (Phase 1).
   ═══════════════════════════════════════════════════════════ */

/* Full-width override — room page stretches edge-to-edge */
.meeting-room-page .atlas-navbar > div { max-width: 100%; padding-left: 1rem; padding-right: 1rem; }
.meeting-room-page #main-content { max-width: 100%; padding: 0.5rem 1rem; }
.meeting-room-page footer { display: none; }

/* Layout — the room fills the viewport (never scrolls the page, like Meet/Zoom)
   so the grid gets a deterministic height and layoutGrid can size tiles reliably. */
.room-container { display: flex; gap: 1rem; height: calc(100vh - 80px); }
.room-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-sidebar { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; }

/* AV tile grid — Google-Meet-style dynamic layout.
   The column/row split is computed in JS (layoutGrid) to maximise tile size
   for the current participant count and the space available, so tiles stay
   close to 16:9 and fill the stage with no dead space or stretched slivers.
   The data-count rules below are a no-JS fallback only. */
.av-grid {
    flex: 1;
    display: grid;
    gap: 0.6rem;
    padding: 0.6rem;
    align-content: stretch;
    justify-content: stretch;
    grid-auto-rows: 1fr;
    min-height: 0;
    place-items: stretch;
}
.av-grid[data-count="1"]  { grid-template-columns: 1fr; }
.av-grid[data-count="2"]  { grid-template-columns: repeat(2, 1fr); }
.av-grid[data-count="3"],
.av-grid[data-count="4"]  { grid-template-columns: repeat(2, 1fr); }
.av-grid[data-count="5"],
.av-grid[data-count="6"]  { grid-template-columns: repeat(3, 1fr); }
.av-grid[data-count="7"],
.av-grid[data-count="8"],
.av-grid[data-count="9"]  { grid-template-columns: repeat(3, 1fr); }
.av-grid[data-count="10"],
.av-grid[data-count="11"],
.av-grid[data-count="12"] { grid-template-columns: repeat(4, 1fr); }

/* AV tile — fills its grid cell (no fixed aspect so the grid can size it) */
.av-tile {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}
.av-tile video { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.av-tile .tile-name {
    position: absolute; bottom: 0.5rem; left: 0.75rem;
    font-size: 11px; font-weight: 600; color: #fff;
    background: rgba(0,0,0,0.55); padding: 2px 8px;
    border-radius: 6px; backdrop-filter: blur(4px);
}
/* Per-tile media badges (mic + camera) — status lights that double as buttons.
   See the "Per-tile media badges" JS block in meeting_room.html. */
.av-tile .tile-media {
    position: absolute; bottom: 0.5rem; right: 0.6rem;
    display: flex; gap: 6px; z-index: 4;
}
.av-tile .tile-media-btn {
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    /* ON / active state — green, so mic + camera read as "live" at a glance. */
    background: rgba(16,185,129,0.95); color: #fff;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    cursor: default; transition: background .15s ease, color .15s ease, transform .12s ease;
}
.av-tile .tile-media-btn .ic { display: flex; width: 15px; height: 15px; }
.av-tile .tile-media-btn .ic svg { width: 100%; height: 100%; }
.av-tile .tile-media-btn .ic-off { display: none; }
/* OFF state (muted / camera off) — the attention-drawing red, slashed glyph. */
.av-tile .tile-media-btn.off { background: rgba(239,68,68,0.95); color: #fff; }
.av-tile .tile-media-btn.off .ic-on { display: none; }
.av-tile .tile-media-btn.off .ic-off { display: flex; }
/* Interactive badges (your own tile; a host's mic badge on other tiles). */
.av-tile .tile-media-btn.is-btn { cursor: pointer; }
.av-tile .tile-media-btn.is-btn:hover { transform: translateY(-1px); background: #059669; }
.av-tile .tile-media-btn.is-btn.off:hover { background: #ef4444; }
.av-tile .tile-media-btn.is-btn:focus-visible {
    outline: 2px solid rgb(var(--brand-400)); outline-offset: 2px;
}
/* Compact tiles (filmstrip + speaker-view rail) get smaller badges. */
.filmstrip .av-tile .tile-media-btn,
.room-main.speaker-view #av-grid > .av-tile:not(.spotlight) .tile-media-btn {
    width: 20px; height: 20px;
}
.filmstrip .av-tile .tile-media-btn .ic,
.room-main.speaker-view #av-grid > .av-tile:not(.spotlight) .tile-media-btn .ic {
    width: 12px; height: 12px;
}
@media (prefers-reduced-motion: reduce) {
    .av-tile .tile-media-btn { transition: none; }
    .av-tile .tile-media-btn.is-btn:hover { transform: none; }
}
/* Participants-list mic/camera icons — mirror the tile badges: GREEN when the
   channel is active, RED + slashed when it's off (glyph-swap via .is-off). */
.roster-mute, .roster-cam { color: #10b981; }
.dark .roster-mute, .dark .roster-cam { color: #34d399; }
.roster-mute .ic-off, .roster-cam .ic-off { display: none; }
.roster-mute.is-off, .roster-cam.is-off { color: #ef4444; }
.dark .roster-mute.is-off, .dark .roster-cam.is-off { color: #f87171; }
.roster-mute.is-off .ic-on, .roster-cam.is-off .ic-on { display: none; }
.roster-mute.is-off .ic-off, .roster-cam.is-off .ic-off { display: inline-flex; }
.av-tile .tile-guest-badge {
    display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: #fbbf24;
    background: rgba(251,191,36,0.15); padding: 1px 5px; border-radius: 4px; vertical-align: middle;
}
.av-tile .tile-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, rgb(var(--brand-500)), rgb(var(--brand-600)));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: #fff;
}
.av-tile .hand-raised {
    position: absolute; top: 0.5rem; right: 0.75rem;
    font-size: 20px; animation: handBounce 1s ease-in-out infinite;
}
@keyframes handBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* Active speaker — a soft emerald ring plus a clean animated audio-bar badge
   (replaces the old hard green boundary). The equalizer is the primary cue. */
.av-tile.speaking { box-shadow: 0 0 0 2px rgba(16,185,129,.55); }
.av-tile .tile-speaking {
    position: absolute; top: 0.5rem; left: 0.75rem;
    display: none; align-items: flex-end; gap: 2.5px;
    height: 22px; padding: 4px 7px; border-radius: 9px;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 10px rgba(5,150,105,.45);
    z-index: 4;
}
.av-tile.speaking .tile-speaking { display: inline-flex; }
.av-tile .tile-speaking i {
    width: 3px; border-radius: 2px; background: #fff;
    transform-origin: bottom;
    animation: eqBar 0.85s ease-in-out infinite;
}
.av-tile .tile-speaking i:nth-child(1) { height: 6px;  animation-delay: 0s; }
.av-tile .tile-speaking i:nth-child(2) { height: 13px; animation-delay: .16s; }
.av-tile .tile-speaking i:nth-child(3) { height: 9px;  animation-delay: .32s; }
.av-tile .tile-speaking i:nth-child(4) { height: 14px; animation-delay: .48s; }
@keyframes eqBar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
    .av-tile .tile-speaking i { animation: none; transform: scaleY(.75); }
}

/* Gallery pager — premium pill with prev/next + "page / total" */
.grid-pager {
    position: relative; z-index: 45;   /* stay clickable above stage overlays */
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    margin: 0.5rem auto 0; padding: 0.3rem 0.4rem; width: fit-content;
    background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px; backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.grid-pager.hidden { display: none; }
.grid-pager .pager-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.10); color: #e5e7eb; transition: all 0.15s;
}
.grid-pager .pager-btn svg { width: 18px; height: 18px; }
.grid-pager .pager-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.20); transform: scale(1.08); }
.grid-pager .pager-btn:disabled { opacity: 0.35; cursor: default; }
.grid-pager .pager-label {
    min-width: 3.2rem; text-align: center; font-size: 13px; font-weight: 700;
    color: #f1f5f9; letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
    padding: 0 0.3rem; user-select: none;
}
html:not(.dark) .grid-pager {
    background: rgba(255, 255, 255, 0.95); border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}
html:not(.dark) .grid-pager .pager-btn { background: rgba(15, 23, 42, 0.06); color: #1e293b; }
html:not(.dark) .grid-pager .pager-btn:hover:not(:disabled) { background: rgba(15, 23, 42, 0.12); }
html:not(.dark) .grid-pager .pager-label { color: #1e293b; }

/* ═══════════════════════════════════════════════════════════
   On-the-spot invite (participants panel) + incoming-call modal
   ═══════════════════════════════════════════════════════════ */
.invite-block { margin-bottom: 0.6rem; }
.invite-results { display: flex; flex-direction: column; gap: 0.15rem; max-height: 240px; overflow-y: auto; }
.invite-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 0.6rem; }
.invite-row:hover { background: rgba(0, 0, 0, 0.04); }
.dark .invite-row:hover { background: rgba(255, 255, 255, 0.05); }
.invite-avatar {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #5A67BA, #434E96);
}
.invite-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.invite-name { font-size: 12px; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark .invite-name { color: #f3f4f6; }
.invite-email { font-size: 10px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-ring-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border: none; border-radius: 999px;
    font-size: 11px; font-weight: 700; cursor: pointer; background: #16a34a; color: #fff; transition: all .15s;
}
.invite-ring-btn svg { width: 13px; height: 13px; }
.invite-ring-btn:hover:not(:disabled) { background: #15803d; }
.invite-ring-btn.rang, .invite-ring-btn:disabled { background: #9ca3af; cursor: default; }
.invite-empty { font-size: 11px; color: #9ca3af; text-align: center; padding: 0.75rem 0; }
#copy-link-btn.copied { background: #16a34a !important; color: #fff !important; }

.incall-overlay {
    position: fixed; inset: 0; z-index: 100; display: none;
    align-items: center; justify-content: center; padding: 1rem;
    background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(6px);
}
.incall-overlay.show { display: flex; animation: incall-fade .2s ease; }
@keyframes incall-fade { from { opacity: 0; } to { opacity: 1; } }
.incall-card {
    width: 100%; max-width: 340px; background: #fff; border-radius: 24px;
    padding: 2rem 1.5rem 1.5rem; text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: incall-pop .25s cubic-bezier(.2, .8, .3, 1.2);
}
.dark .incall-card { background: #1e293b; }
@keyframes incall-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.incall-avatar-wrap { position: relative; width: 84px; height: 84px; margin: 0 auto 1rem; }
.incall-avatar {
    position: relative; z-index: 2; width: 84px; height: 84px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4F80B5, #3A6090);
}
.incall-pulse { position: absolute; inset: 0; border-radius: 50%; background: rgba(79, 128, 181, 0.35); animation: incall-ping 1.8s ease-out infinite; }
.incall-pulse-2 { animation-delay: .9s; }
@keyframes incall-ping { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.85); opacity: 0; } }
.incall-caller { font-size: 20px; font-weight: 800; color: #111827; }
.dark .incall-caller { color: #fff; }
.incall-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.incall-meeting { font-size: 14px; font-weight: 700; color: rgb(var(--brand-600)); margin-top: 2px; }
.dark .incall-meeting { color: rgb(var(--brand-300)); }
.incall-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.75rem; }
.incall-btn {
    flex: 1; display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
    border: none; border-radius: 16px; padding: 0.75rem 0.5rem;
    font-size: 12px; font-weight: 700; cursor: pointer; color: #fff; transition: transform .12s, filter .12s;
}
.incall-btn svg { width: 22px; height: 22px; }
.incall-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.incall-btn.decline { background: #ef4444; }
.incall-btn.accept { background: #16a34a; }

/* Presenter mode */
.room-main.presenter-mode .av-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.presenter-video {
    flex: 1; border-radius: 12px; overflow: hidden; background: #0f172a;
    min-height: 400px; position: relative; display: flex; align-items: center; justify-content: center;
}
.presenter-video video { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.presenter-video .tile-name {
    position: absolute; bottom: 0.75rem; left: 1rem; font-size: 12px; font-weight: 600;
    color: #fff; background: rgba(0,0,0,0.6); padding: 3px 10px;
    border-radius: 6px; backdrop-filter: blur(4px);
}
.filmstrip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem 0; }
.filmstrip .av-tile { width: 160px; min-width: 160px; aspect-ratio: 16/9; flex-shrink: 0; }
.filmstrip .av-tile .tile-avatar { width: 40px; height: 40px; font-size: 16px; }

/* ── Speaker view: one big spotlight tile + a filmstrip of the rest ── */
.room-main.speaker-view #av-grid {
  display: flex !important; flex-direction: row !important; flex-wrap: wrap;
  align-content: flex-start; justify-content: center; gap: 10px;
  grid-template-columns: none !important; grid-template-rows: none !important;
}
.room-main.speaker-view #av-grid > .av-tile {
  order: 2; flex: 0 0 auto; width: 150px; height: 86px;
  aspect-ratio: auto; min-height: 0; align-self: flex-start; cursor: pointer;
}
.room-main.speaker-view #av-grid > .av-tile:hover { outline: 2px solid rgba(34,211,238,.5); outline-offset: -2px; }
.room-main.speaker-view #av-grid > .av-tile.spotlight {
  order: 1; flex: 1 1 100%; width: 100%; height: 66%; min-height: 55%; cursor: default;
}
.room-main.speaker-view #av-grid > .av-tile.spotlight:hover { outline: none; }
.room-main.speaker-view #av-grid > .av-tile.spotlight .tile-avatar { width: 96px; height: 96px; font-size: 36px; }
@media (max-width: 640px) {
  .room-main.speaker-view #av-grid > .av-tile { width: 104px; height: 62px; }
  .room-main.speaker-view #av-grid > .av-tile.spotlight { height: 58%; }
}

/* Controls bar */
.controls-bar {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.75rem;
    padding: 1rem; background: rgba(15,23,42,0.85); backdrop-filter: blur(12px);
    border-radius: 16px; margin-top: 0.75rem;
}
.ctrl-btn {
    width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto;   /* never shrink below a tappable size */
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; transition: all 0.2s;
}
.ctrl-btn:hover { transform: scale(1.1); }
.ctrl-btn.active { background: #374151; color: #e5e7eb; }
.ctrl-btn.muted  { background: #ef4444; color: #fff; }
.ctrl-btn.end-call { background: #ef4444; color: #fff; width: 56px; height: 48px; border-radius: 24px; }
.ctrl-btn.end-call:hover { background: #dc2626; }
.ctrl-btn.recording { background: #ef4444; color: #fff; animation: pulse-rec 1.5s ease-in-out infinite; }
@keyframes pulse-rec { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
/* The "More" toggle is mobile-only; on desktop every control shows inline. */
.ctrl-more-toggle { display: none; }

/* Chat panel */
.chat-messages { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-msg { font-size: 12px; line-height: 1.4; }
.chat-msg .sender { font-weight: 600; color: rgb(var(--brand-500)); }
.chat-msg .time { font-size: 10px; color: #9ca3af; margin-left: 0.5rem; }
.chat-msg img { max-width: 200px; max-height: 150px; border-radius: 8px; margin-top: 4px; cursor: pointer; }

/* Captions overlay */
.caption-overlay {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
    max-width: 80%; padding: 8px 16px; background: rgba(0,0,0,0.75); color: #fff;
    font-size: 14px; line-height: 1.4; border-radius: 8px; text-align: center;
    z-index: 40; backdrop-filter: blur(4px); transition: opacity 0.3s; pointer-events: none;
}
.caption-overlay .caption-speaker { font-size: 11px; font-weight: 600; color: #a78bfa; margin-bottom: 2px; }
.caption-overlay.hidden { opacity: 0; pointer-events: none; }
.captions-indicator { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #a78bfa; }
.captions-indicator .dot {
    width: 6px; height: 6px; border-radius: 50%; background: #a78bfa;
    animation: pulse-rec 1.5s ease-in-out infinite;
}

/* ── Live captions in the control bar (tablet/desktop) ──
   When captions are on the controls slide left and this strip fills the freed
   space with premium, readable caption text. Phones keep the floating overlay. */
.controls-captions {
    display: none;               /* only shown when .captions-active on ≥768px */
    flex: 1 1 auto; min-width: 0; align-items: center; gap: 0.6rem;
    padding: 0 0.75rem 0 1.25rem; overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.12); margin-left: 0.5rem;
}
.controls-captions .cc-speaker {
    flex: 0 0 auto; font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
    color: #c4b5fd;
}
.controls-captions .cc-text {
    flex: 1 1 auto; min-width: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 17px; line-height: 1.35; font-weight: 500; letter-spacing: .003em;
    color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.controls-captions .cc-text.idle { color: #94a3b8; font-weight: 500; font-style: italic; }
html:not(.dark) .controls-captions { border-left-color: rgba(15, 23, 42, 0.12); }
html:not(.dark) .controls-captions .cc-speaker { color: #7c3aed; }
html:not(.dark) .controls-captions .cc-text { color: #0f172a; }
html:not(.dark) .controls-captions .cc-text.idle { color: #94a3b8; }

@media (min-width: 1024px) {
    /* Controls shift to the left; captions occupy the freed right-hand space.
       (Wrap is kept so a narrow laptop drops the strip to its own line rather
       than overflowing the bar.) */
    .controls-bar.captions-active { justify-content: flex-start; }
    .controls-bar.captions-active .controls-captions { display: flex; }
    /* Avoid double display — the floating overlay yields to the strip. */
    .room-main:has(.controls-bar.captions-active) .caption-overlay { display: none; }
}

/* Room responsive */
@media (max-width: 768px) {
    .room-container { flex-direction: column; height: auto; min-height: auto; }
    .room-sidebar { width: 100%; max-height: 45vh; order: 2; }
    .room-main { order: 1; min-height: 35vh; }
    .av-grid[data-count="2"] { grid-template-columns: 1fr; }
    .av-grid[data-count="3"],
    .av-grid[data-count="4"],
    .av-grid[data-count="5"],
    .av-grid[data-count="6"] { grid-template-columns: repeat(2, 1fr); }
    .room-sidebar .atlas-card { border-radius: 0.75rem; }
}
@media (max-width: 480px) {
    .room-sidebar { max-height: 35vh; }
    .room-main { min-height: 52vh; }
}

/* ═══════════════════════════════════════════════════════════
   Meeting-room polish: varied avatars + light-mode support
   ═══════════════════════════════════════════════════════════ */

/* Avatars: JS (avatarGradient) assigns a per-person colour inline; this is the
   fallback and the shared shape/typography. A soft ring lifts them off dark tiles. */
.av-tile .tile-avatar {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.10), 0 4px 14px rgba(0,0,0,0.28);
    letter-spacing: 0.01em;
    /* fluid: scales with the tile's own width so it stays proportional */
    width: clamp(38px, 26%, 76px);
    height: auto;
    aspect-ratio: 1;
    font-size: clamp(15px, 5vw, 26px);
}

/* Light mode — the stage stays dark (video contrast, exactly like Meet/Zoom),
   but the surrounding chrome adopts the light theme so nothing looks "stuck". */
html:not(.dark) .av-grid.atlas-card {
    background: #eef2f7;
    border-color: rgba(15,23,42,0.06);
}
html:not(.dark) .av-tile { background: #1e293b; }        /* keep tiles dark */
html:not(.dark) .controls-bar {
    background: rgba(255,255,255,0.92);
    box-shadow: 0 6px 24px rgba(15,23,42,0.10);
    border: 1px solid rgba(15,23,42,0.06);
}
html:not(.dark) .ctrl-btn.active { background: #e2e8f0; color: #1e293b; }
html:not(.dark) .ctrl-btn.active:hover { background: #cbd5e1; }
html:not(.dark) .conn-banner.reconnecting,
html:not(.dark) .conn-banner.lost,
html:not(.dark) .conn-banner.failed { box-shadow: 0 4px 16px rgba(15,23,42,0.12); }

/* ═══════════════════════════════════════════════════════════
   Meeting room — connection banner & audio-unlock overlays
   ═══════════════════════════════════════════════════════════ */
.room-main { position: relative; }   /* anchor for the overlays below */

.conn-banner {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    z-index: 40; display: none; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 8px;
    padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
    color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.30); max-width: calc(100% - 24px);
}
/* Only ever visible in a genuine trouble state — never when connected/idle.
   (Base is display:none so a stale '.hidden' can't be overridden into view.) */
.conn-banner.reconnecting,
.conn-banner.lost,
.conn-banner.failed { display: flex; }
.conn-banner.reconnecting { background: rgba(180,83,9,.94); backdrop-filter: blur(6px); }   /* amber */
.conn-banner.lost,
.conn-banner.failed      { background: rgba(185,28,28,.96); backdrop-filter: blur(6px); }    /* red */
.conn-banner .conn-spinner {
    width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    animation: conn-spin .8s linear infinite;
}
.conn-banner.lost .conn-spinner,
.conn-banner.failed .conn-spinner { display: none; }
@keyframes conn-spin { to { transform: rotate(360deg); } }
.conn-banner-btn {
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
    color: #fff; font-weight: 700; font-size: 12.5px; padding: 4px 12px;
    border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.conn-banner-btn:hover { background: rgba(255,255,255,.3); }

.audio-unlock {
    position: absolute; bottom: 84px; right: 12px; left: auto; transform: none;
    z-index: 40; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 7px 13px; border-radius: 999px; border: none; cursor: pointer;
    background: linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-700))); color: #fff;
    font-size: 12.5px; font-weight: 700; box-shadow: 0 6px 18px rgb(var(--brand-600) / .4);
}
.audio-unlock svg { width: 15px; height: 15px; }

/* Bottom-sheet chrome is desktop-hidden by default; the mobile block turns it on. */
.mv-sheet-btn { display: none; }
.room-sheet-backdrop { display: none; }
.room-sheet-handle-wrap { display: none; }
.ctrl-btn { position: relative; }
.ctrl-badge {
    position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
    background: #f59e0b; box-shadow: 0 0 0 2px rgba(15,23,42,.9);
}

/* ── Mobile meeting-room overhaul: overlays as thin strips, video owns the
   screen, and the participants/chat panel becomes a bottom-sheet drawer. ── */
@media (max-width: 640px) {
    /* People + Chat buttons appear only on the phone layout. */
    .mv-sheet-btn { display: flex; }

    /* Stacked, scrollable video tiles — a phone gets one clean card after another
       rather than a cramped mini-grid of postage-stamp faces. */
    .av-grid {
        display: flex; flex-direction: column; gap: .55rem;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        align-content: flex-start; justify-content: flex-start;
    }
    .av-grid .av-tile {
        width: 100%; height: auto; flex: 0 0 auto;
        aspect-ratio: 16 / 10; min-height: 200px;
    }
    .av-grid .av-tile.speaking { aspect-ratio: 16 / 11; }   /* active speaker a touch taller */
    .av-tile .tile-signal { opacity: .7; }

    /* The panel slides up over the video instead of stealing screen height. */
    .room-sheet-backdrop {
        display: block; position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.5);
        opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
    }
    .room-sheet-backdrop.show { opacity: 1; visibility: visible; }
    .room-sidebar {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 78vh;
        z-index: 120; transform: translateY(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
    }
    .room-sidebar.sheet-open { transform: translateY(0); }
    .room-sidebar .atlas-card { border-radius: 20px 20px 0 0; max-height: 78vh; }
    .room-sheet-handle-wrap { display: flex; align-items: center; justify-content: center; position: relative; padding: 10px 0 4px; }
    .room-sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: #cbd5e1; cursor: pointer; }
    .room-sheet-close {
        position: absolute; right: 8px; top: 4px; width: 34px; height: 34px; display: grid; place-items: center;
        border: none; background: transparent; color: #9ca3af; cursor: pointer; border-radius: 9px;
    }
    /* With the panel floating, the video + controls own the full column. */
    .room-main { min-height: calc(100vh - 120px); }

    /* Both prompts are thin single-line strips stacked just under the header —
       small enough that they never reach the centered video avatar. */
    .conn-banner {
        top: 50px; left: 50%; right: auto; transform: translateX(-50%);
        width: max-content; max-width: calc(100% - 20px); flex-wrap: nowrap;
        border-radius: 999px; padding: 6px 8px 6px 14px; font-size: 12px; gap: 8px;
    }
    .conn-banner-btn { padding: 4px 11px; font-size: 12px; }
    /* Enable-sound: a slim pill just below the connection strip. */
    .audio-unlock {
        top: 90px; bottom: auto; font-size: 12.5px; padding: 6px 14px;
    }
    /* Recording consent: full-width just above the safe-area bottom. */
    #consent-banner {
        left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none;
        text-align: center; font-size: 12px;
    }

    /* Video area gets the room; the panel floats over it as a sheet. */
    .room-container { gap: 0.6rem; }
    .room-main { min-height: 46vh; }
    /* Phones keep a scrollable grid (layoutGrid's fill-the-space maths runs on
       tablet/desktop only). Rows are content-sized here so tiles keep a proper
       shape and the grid scrolls past the fold instead of shrinking to slivers. */
    .av-grid { padding: 0.4rem; gap: 0.4rem; overflow-y: auto; min-height: 0; grid-auto-rows: auto; }

    /* Grid strategy for phones: solo and pairs fill the screen; three or more
       become a clean scrollable 2-up grid of 4:3 tiles — never four tiny
       columns of tall slivers, and never a single 10-tile-tall column. */
    .av-grid[data-count] { grid-template-columns: repeat(2, 1fr); }
    .av-grid[data-count="1"],
    .av-grid[data-count="2"] { grid-template-columns: 1fr; }
    .av-grid .av-tile { height: auto; aspect-ratio: 4 / 3; }
    .av-grid[data-count="1"] .av-tile { aspect-ratio: auto; min-height: 58vh; }
    .av-grid[data-count="2"] .av-tile { aspect-ratio: 16 / 10; min-height: 30vh; }

    /* Controls: a tidy, comfortable bottom tray. Phones show only the essentials
       (mic, camera, people, chat, end) plus a "More" button that reveals the
       secondary controls — never a cramped 12-button scrum. */
    .controls-bar { gap: 0.5rem; padding: 0.7rem 0.55rem; border-radius: 16px; margin-top: 0.6rem; }
    .ctrl-btn { width: 48px; height: 48px; }
    .ctrl-btn.end-call { width: 58px; }
    .ctrl-more-toggle { display: flex; }
    .controls-bar .ctrl-more { display: none; }
    .controls-bar.more-open .ctrl-more { display: flex; }
    .controls-bar .ctrl-sep { display: none; }   /* desktop-only grouping divider */
}

/* ═══════════════════════════════════════════════════════════
   Waiting-room admission — sidebar cards, dropdown toasts, badge
   ═══════════════════════════════════════════════════════════ */

/* Shared Admit / Reject buttons */
.wait-btn {
    border: none; cursor: pointer; font-size: 12px; font-weight: 700;
    padding: 6px 14px; border-radius: 8px; white-space: nowrap;
    transition: filter 120ms ease, transform 120ms ease, opacity 120ms ease;
}
.wait-btn:disabled { opacity: .5; cursor: default; }
.wait-btn.admit  { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; box-shadow: 0 4px 12px rgba(22,163,74,.28); }
.wait-btn.reject { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
.dark .wait-btn.reject { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.wait-btn.admit:hover:not(:disabled)  { filter: brightness(1.06); transform: translateY(-1px); }
.wait-btn.reject:hover:not(:disabled) { background: #fef2f2; }
.dark .wait-btn.reject:hover:not(:disabled) { background: rgba(239,68,68,.18); }

/* Sidebar waiting card */
.wait-card {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 6px 0;
    border-radius: 12px; border: 1px solid #fcd9a6;
    background: linear-gradient(180deg, #fffaf1, #fff6e6);
}
.dark .wait-card { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); }
.wait-card .wait-avatar {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: 13px; color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.wait-info { min-width: 0; flex: 1; }
.wait-name { font-size: 13px; font-weight: 700; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .wait-name { color: #f9fafb; }
.wait-sub { font-size: 11px; color: #b45309; font-weight: 600; }
.dark .wait-sub { color: #fbbf24; }
.wait-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.wait-card .wait-btn { padding: 5px 10px; font-size: 11px; }

/* Dropdown notification stack (top-right of the video area) */
.wait-toasts {
    position: absolute; top: 14px; right: 14px; z-index: 50;
    display: flex; flex-direction: column; gap: 10px; width: 320px; max-width: calc(100% - 28px);
    pointer-events: none;
}
.wait-toast {
    pointer-events: auto; display: flex; align-items: center; gap: 11px;
    padding: 12px 14px; border-radius: 14px; background: #fff;
    box-shadow: 0 16px 40px rgba(16,24,40,.22), 0 2px 8px rgba(16,24,40,.12);
    border: 1px solid rgba(16,24,40,.06);
    opacity: 0; transform: translateX(16px); transition: opacity .22s ease, transform .22s ease;
}
.wait-toast.show { opacity: 1; transform: translateX(0); }
.dark .wait-toast { background: #111827; border-color: rgba(255,255,255,.08); }
.wait-toast-avatar {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706);
}
.wait-toast-body { min-width: 0; flex: 1; }
.wait-toast-title { font-size: 14px; font-weight: 700; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .wait-toast-title { color: #f9fafb; }
.wait-toast-sub { font-size: 11.5px; color: #6b7280; }
.dark .wait-toast-sub { color: #9ca3af; }
.wait-toast-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* Pulsing dot on the Participants tab */
.wait-badge {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 5px;
    background: #f59e0b; vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(245,158,11,.6); animation: wait-badge-pulse 1.6s infinite;
}
@keyframes wait-badge-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(245,158,11,.6); }
    70%  { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

@media (max-width: 768px) {
    .wait-toasts { top: 8px; right: 8px; left: 8px; width: auto; }
}

/* ═══════════════════════════════════════════════════════════
   Guest join — premium landing (two-panel: brand hero + form)
   ═══════════════════════════════════════════════════════════ */
.guest-join {
    min-height: calc(100vh - 64px);
    display: flex; align-items: center; justify-content: center;
    padding: 32px 20px;
}
.guest-join-card {
    width: 100%; max-width: 920px;
    display: grid; grid-template-columns: 1.05fr 1fr;
    background: var(--mv-surface, #fff);
    border-radius: 22px; overflow: hidden;
    box-shadow: 0 30px 70px rgba(16, 24, 40, .16), 0 4px 12px rgba(16, 24, 40, .08);
    border: 1px solid rgba(16, 24, 40, .06);
}
.dark .guest-join-card { background: #0f172a; border-color: rgba(255,255,255,.06); }

/* ── Hero panel ── */
.guest-join-hero { position: relative; padding: 44px 40px; color: rgb(var(--brand-50)); overflow: hidden; }
.guest-hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(900px 380px at 88% -10%, rgba(34, 211, 238, .38), transparent 60%),
        radial-gradient(700px 340px at -10% 115%, rgb(var(--brand-600) / .45), transparent 60%),
        linear-gradient(150deg, rgb(var(--brand-700)) 0%, rgb(var(--brand-600)) 45%, #3b82f6 100%);
}
.guest-hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 20px 20px; opacity: .55;
}
.guest-hero-content { position: relative; display: flex; flex-direction: column; height: 100%; gap: 26px; }
.guest-hero-brand { display: flex; align-items: center; gap: 10px; }
.guest-hero-mark {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff;
}
.guest-hero-mark svg { width: 19px; height: 19px; }
.guest-hero-brandname { font-weight: 800; font-size: 16px; letter-spacing: .2px; color: #fff; }

.guest-hero-live {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    color: rgb(var(--brand-200));
}
.guest-hero-livedot {
    width: 7px; height: 7px; border-radius: 50%; background: #34d399;
    box-shadow: 0 0 0 3px rgba(52,211,153,.25);
}
.guest-hero-title { font-size: 27px; line-height: 1.15; font-weight: 800; color: #fff; margin: 12px 0 14px; letter-spacing: -.3px; }
.guest-hero-meta, .guest-hero-host { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #dbe4ff; margin: 6px 0; }
.guest-hero-meta svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .85; }
.guest-hero-avatar {
    width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; display: grid; place-items: center;
    font-size: 12px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.12));
    border: 1px solid rgba(255,255,255,.28);
}
.guest-hero-features { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.guest-hero-features li { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: #e6ecff; }
.guest-hero-features svg { width: 20px; height: 20px; flex: 0 0 20px; color: #a5f3fc; }
.guest-hero-foot { margin-top: auto; padding-top: 18px; font-size: 11.5px; color: #b9c6ec; }

/* ── Form panel ── */
.guest-join-form { display: flex; align-items: center; padding: 44px 40px; }
.guest-form-inner { width: 100%; }
.guest-form-title { font-size: 22px; font-weight: 800; color: #111827; letter-spacing: -.2px; }
.dark .guest-form-title { color: #f9fafb; }
.guest-form-sub { font-size: 13.5px; color: #6b7280; margin: 5px 0 22px; }
.dark .guest-form-sub { color: #9ca3af; }
.guest-form-error {
    display: flex; align-items: center; gap: 9px; margin-bottom: 16px;
    padding: 10px 13px; border-radius: 11px; font-size: 13px;
    background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}
.dark .guest-form-error { background: rgba(239,68,68,.1); color: #fca5a5; border-color: rgba(239,68,68,.25); }
.guest-form-error svg { width: 18px; height: 18px; flex: 0 0 18px; }
.guest-form-fields { display: flex; flex-direction: column; gap: 16px; }
.guest-label-opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: #9ca3af; font-size: .85em; }
.guest-form-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px 18px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-700))); color: #fff;
    font-size: 15px; font-weight: 700; margin-top: 2px;
    box-shadow: 0 10px 24px rgb(var(--brand-600) / .32);
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.guest-form-cta svg { width: 18px; height: 18px; }
.guest-form-cta:hover { filter: brightness(1.05); box-shadow: 0 12px 28px rgb(var(--brand-600) / .42); transform: translateY(-1px); }
.guest-form-cta:active { transform: translateY(0); }
.guest-form-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; line-height: 1.5; color: #9ca3af; margin: 2px 0 0; }
.guest-form-consent svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.guest-form-signin { margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef1f6; text-align: center; font-size: 13px; color: #6b7280; }
.dark .guest-form-signin { border-top-color: rgba(255,255,255,.07); color: #9ca3af; }
.guest-form-signin a { font-weight: 700; color: rgb(var(--brand-600)); }
.dark .guest-form-signin a { color: rgb(var(--brand-300)); }
.guest-form-signin a:hover { text-decoration: underline; }

@media (max-width: 800px) {
    .guest-join { padding: 0; align-items: stretch; }
    .guest-join-card { grid-template-columns: 1fr; max-width: 480px; border-radius: 0; box-shadow: none; border: none; }
    .guest-join-hero { padding: 30px 26px 26px; }
    .guest-hero-features { display: none; }          /* keep the fold tight on mobile */
    .guest-hero-content { gap: 16px; }
    .guest-hero-title { font-size: 22px; margin: 8px 0 10px; }
    .guest-hero-foot { display: none; }
    .guest-join-form { padding: 28px 26px 36px; }
}
@media (min-width: 801px) {
    /* Even panel heights: form dictates height, hero fills it. */
    .guest-join-card { align-items: stretch; }
}

/* ═══════════════════════════════════════════════════════════
   Meet Now — outline CTA (secondary to mv-cta primary)
   ═══════════════════════════════════════════════════════════ */
.mv-meet-now {
    align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: 11px; border: 1.5px solid rgb(var(--brand-600) / 0.4);
    font-size: 13.5px; font-weight: 700; color: rgb(var(--brand-600));
    background: transparent; cursor: pointer; white-space: nowrap;
    transition: background-color var(--mv-transition-fast, 120ms ease),
                border-color var(--mv-transition-fast, 120ms ease),
                transform var(--mv-transition-fast, 120ms ease);
}
.mv-meet-now svg { width: 15px; height: 15px; }
.mv-meet-now:hover {
    background: rgb(var(--brand-600) / 0.07);
    border-color: rgb(var(--brand-600));
    transform: translateY(-1px);
    color: rgb(var(--brand-600));
}
.dark .mv-meet-now { color: rgb(var(--brand-300)); border-color: rgb(var(--brand-300) / 0.35); }
.dark .mv-meet-now:hover { background: rgb(var(--brand-300) / 0.08); border-color: rgb(var(--brand-400)); color: rgb(var(--brand-200)); }

/* ═══════════════════════════════════════════════════════════
   Phase 3: Enhanced Design Token Styling (Forms, Auth, Tasks)
   ═══════════════════════════════════════════════════════════ */

/* ── Form Label Styling ── */
label.mv-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--mv-text-primary, #1e293b);
    margin-bottom: 0.5rem;
}
.dark label.mv-label {
    color: var(--mv-text-primary, #e2e8f0);
}

label.mv-label.mv-required::after {
    content: ' *';
    color: var(--mv-color-danger, #ef4444);
}

/* ── Form Group Wrapper ── */
.mv-form-group {
    margin-bottom: 1.25rem;
}

.mv-form-group.mv-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (max-width: 640px) {
    .mv-form-group.mv-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ── Enhanced Input Styling (Design Tokens) ── */
.mv-input-modern,
input.mv-input-modern,
textarea.mv-input-modern,
select.mv-input-modern {
    width: 100%;
    background: var(--mv-surface, #ffffff);
    color: var(--mv-text-primary, #1e293b);
    border: 1.5px solid var(--mv-border, #e2e8f0);
    border-radius: var(--mv-radius-md, 10px);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color var(--mv-transition-base, 180ms ease),
                box-shadow var(--mv-transition-base, 180ms ease),
                background-color var(--mv-transition-base, 180ms ease);
}

/* Inputs with a leading icon (e.g. the quick-add task field's + glyph at left-3)
   need extra left padding so the text/placeholder doesn't sit under the icon. */
.atlas-quick-add .relative input.mv-input-modern { padding-left: 2.5rem; }

.mv-input-modern::placeholder {
    color: var(--mv-text-muted, #94a3b8);
}

.mv-input-modern:focus {
    outline: none;
    border-color: var(--mv-color-primary, rgb(var(--brand-600)));
    box-shadow: 0 0 0 3px var(--mv-color-primary, rgb(var(--brand-600) / 0.15));
    background: var(--mv-surface, #ffffff);
}

.dark .mv-input-modern,
.dark input.mv-input-modern,
.dark textarea.mv-input-modern,
.dark select.mv-input-modern {
    background: rgba(30, 41, 59, 0.6);
    border-color: var(--mv-border, #374151);
    color: var(--mv-text-primary, #e2e8f0);
}

.dark .mv-input-modern::placeholder {
    color: var(--mv-text-muted, #64748b);
}

.dark .mv-input-modern:focus {
    border-color: var(--mv-color-primary, rgb(var(--brand-400)));
    box-shadow: 0 0 0 3px rgb(var(--brand-400) / 0.2);
    background: rgba(30, 41, 59, 0.8);
}

/* ── Input Error State ── */
.mv-input-modern.mv-error,
input.mv-input-modern.mv-error,
textarea.mv-input-modern.mv-error {
    border-color: var(--mv-color-danger, #ef4444);
    background: rgba(239, 68, 68, 0.05);
}

.mv-input-modern.mv-error:focus,
input.mv-input-modern.mv-error:focus,
textarea.mv-input-modern.mv-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.dark .mv-input-modern.mv-error {
    border-color: var(--mv-color-danger, #f87171);
    background: rgba(248, 113, 113, 0.08);
}

/* ── Field Error Message ── */
.mv-field-error {
    display: block;
    font-size: 0.8125rem;
    color: var(--mv-color-danger, #ef4444);
    margin-top: 0.375rem;
    font-weight: 500;
}

.dark .mv-field-error {
    color: var(--mv-color-danger, #fca5a5);
}

/* ── Icon-prefixed auth fields + password toggle + requirement chips ── */
.mv-field { position: relative; }
.mv-field .mv-field-ic {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: #94a3b8; pointer-events: none;
}
.dark .mv-field .mv-field-ic { color: #7c8db6; }
.mv-input-iconed { padding-left: 2.65rem !important; }
.mv-input-pw { padding-right: 2.75rem !important; }
.mv-pw-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border: none; background: none; color: #94a3b8; cursor: pointer; border-radius: 8px;
    transition: color .15s, background .15s;
}
.mv-pw-toggle:hover { color: #4b5563; background: rgba(16,24,40,.05); }
.dark .mv-pw-toggle:hover { color: #e2e8f0; background: rgba(255,255,255,.06); }
.mv-pw-toggle .mv-pw-eye { width: 18px; height: 18px; }
.mv-pw-toggle.on { color: rgb(var(--brand-700)); }
.dark .mv-pw-toggle.on { color: rgb(var(--brand-300)); }
.mv-pw-reqs {
    list-style: none; margin: 0.55rem 0 0; padding: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px;
}
.mv-pw-reqs li {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.75rem; color: #94a3b8;
}
.dark .mv-pw-reqs li { color: #7c8db6; }
.mv-pw-reqs .mv-pw-dot {
    width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; flex: 0 0 5px;
}
.dark .mv-pw-reqs .mv-pw-dot { background: #475569; }
@media (max-width: 400px) { .mv-pw-reqs { grid-template-columns: 1fr; } }

/* ── Auth Form Card ── */
.mv-auth-card {
    background: var(--mv-surface, #ffffff);
    border: 1px solid var(--mv-border, #e2e8f0);
    border-radius: var(--mv-radius-lg, 14px);
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
}

.dark .mv-auth-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* ── Auth Form Title ── */
.mv-auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--mv-text-primary, #1e293b);
    margin-bottom: 0.5rem;
}

.dark .mv-auth-title {
    color: var(--mv-text-primary, #f1f5f9);
}

/* ── Auth Form Subtitle ── */
.mv-auth-subtitle {
    font-size: 0.9375rem;
    color: var(--mv-text-secondary, #64748b);
    margin-bottom: 1.5rem;
}

.dark .mv-auth-subtitle {
    color: var(--mv-text-secondary, #cbd5e1);
}

/* ── Auth Link (sign in vs sign up) ── */
.mv-auth-link {
    color: var(--mv-color-primary, rgb(var(--brand-600)));
    text-decoration: none;
    font-weight: 600;
    transition: color var(--mv-transition-fast, 100ms ease);
}

.mv-auth-link:hover {
    color: var(--mv-color-primary-dark, rgb(var(--brand-700)));
    text-decoration: underline;
}

.dark .mv-auth-link {
    color: var(--mv-color-primary, rgb(var(--brand-300)));
}

.dark .mv-auth-link:hover {
    color: var(--mv-color-primary-light, rgb(var(--brand-200)));
}

/* ── Submit Button for Forms ── */
.mv-btn-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--mv-color-primary, rgb(var(--brand-600))), var(--mv-color-primary, rgb(var(--brand-700))));
    color: white;
    border: none;
    border-radius: var(--mv-radius-md, 10px);
    padding: 0.6rem 1.25rem;      /* trimmer than before — less block-like */
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    cursor: pointer;
    transition: transform var(--mv-transition-fast, 100ms ease),
                box-shadow var(--mv-transition-fast, 100ms ease),
                opacity var(--mv-transition-fast, 100ms ease);
}
/* Action buttons (Start / Enter Room / New Meeting …) size to their label
   instead of spanning the whole row like a form submit. */
.mv-btn-submit.mv-btn-inline { width: auto; }

.mv-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(var(--brand-600) / 0.4);
}

.mv-btn-submit:active {
    transform: translateY(0);
}

.mv-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Secondary Button ── */
.mv-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--mv-surface-secondary, #f8fafc);
    color: var(--mv-text-primary, #1e293b);
    border: 1.5px solid var(--mv-border, #e2e8f0);
    border-radius: var(--mv-radius-md, 10px);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--mv-transition-base, 180ms ease);
}

.mv-btn-secondary:hover {
    background: var(--mv-surface, #ffffff);
    border-color: var(--mv-color-primary, rgb(var(--brand-600)));
    color: var(--mv-color-primary, rgb(var(--brand-600)));
}

.dark .mv-btn-secondary {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--mv-text-primary, #e2e8f0);
}

.dark .mv-btn-secondary:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--mv-color-primary, rgb(var(--brand-400)));
    color: var(--mv-color-primary, rgb(var(--brand-200)));
}

/* ── Danger Button (delete, logout) ── */
.mv-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--mv-color-danger, #ef4444);
    border: none;
    border-radius: var(--mv-radius-md, 10px);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--mv-transition-fast, 100ms ease);
}

.mv-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--mv-color-danger, #dc2626);
}

.dark .mv-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--mv-color-danger, #fca5a5);
}

/* ── Task Card Styling ── */
.mv-task-card {
    background: var(--mv-surface, #ffffff);
    border: 1px solid var(--mv-border, #e2e8f0);
    border-radius: var(--mv-radius-md, 10px);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--mv-transition-base, 180ms ease);
    cursor: pointer;
}

.mv-task-card:hover {
    border-color: var(--mv-color-primary, rgb(var(--brand-600)));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.dark .mv-task-card {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.06);
}

.dark .mv-task-card:hover {
    border-color: var(--mv-color-primary, rgb(var(--brand-400)));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Task Status Badge ── */
.mv-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mv-badge-status.status-todo {
    background: rgba(148, 163, 184, 0.15);
    color: #475569;
}

.dark .mv-badge-status.status-todo {
    background: rgba(71, 85, 105, 0.3);
    color: #cbd5e1;
}

.mv-badge-status.status-in-progress {
    background: rgba(59, 130, 246, 0.15);
    color: #1e40af;
}

.dark .mv-badge-status.status-in-progress {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.mv-badge-status.status-done {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

.dark .mv-badge-status.status-done {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

/* ── Task Priority Badge ── */
.mv-badge-priority {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mv-badge-priority.priority-low {
    background: rgba(100, 116, 139, 0.15);
    color: #334155;
}

.dark .mv-badge-priority.priority-low {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
}

.mv-badge-priority.priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

.dark .mv-badge-priority.priority-medium {
    background: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

.mv-badge-priority.priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #7f1d1d;
}

.dark .mv-badge-priority.priority-high {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* ── Notification Item Styling ── */
.mv-notification-item {
    background: var(--mv-surface, #ffffff);
    border: 1px solid var(--mv-border, #e2e8f0);
    border-radius: var(--mv-radius-md, 10px);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--mv-transition-base, 180ms ease);
}

.mv-notification-item.unread {
    background: rgb(var(--brand-600) / 0.05);
    border-color: rgb(var(--brand-600) / 0.2);
}

.mv-notification-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dark .mv-notification-item {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.06);
}

.dark .mv-notification-item.unread {
    background: rgb(var(--brand-600) / 0.1);
    border-color: rgb(var(--brand-600) / 0.3);
}

.dark .mv-notification-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Notification Icon ── */
.mv-notification-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 700;
}

.mv-notification-icon.brand {
    background: rgb(var(--brand-600) / 0.15);
    color: var(--mv-color-primary, rgb(var(--brand-600)));
}

.mv-notification-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--mv-color-success, #10b981);
}

.mv-notification-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--mv-color-warning, #f59e0b);
}

.mv-notification-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--mv-color-danger, #ef4444);
}

/* ── Notification Text ── */
.mv-notification-content {
    flex: 1;
    min-width: 0;
}

.mv-notification-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--mv-text-primary, #1e293b);
    margin-bottom: 0.25rem;
}

.dark .mv-notification-title {
    color: var(--mv-text-primary, #f1f5f9);
}

.mv-notification-body {
    font-size: 0.875rem;
    color: var(--mv-text-secondary, #64748b);
    line-height: 1.4;
}

.dark .mv-notification-body {
    color: var(--mv-text-secondary, #cbd5e1);
}

.mv-notification-time {
    font-size: 0.75rem;
    color: var(--mv-text-muted, #94a3b8);
    margin-top: 0.25rem;
}

.dark .mv-notification-time {
    color: var(--mv-text-muted, #64748b);
}

/* ── Settings/Profile Card ── */
.mv-settings-card {
    background: var(--mv-surface, #ffffff);
    border: 1px solid var(--mv-border, #e2e8f0);
    border-radius: var(--mv-radius-lg, 14px);
    padding: 2rem;
}

.dark .mv-settings-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.06);
}

.mv-settings-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mv-text-primary, #1e293b);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dark .mv-settings-title {
    color: var(--mv-text-primary, #f1f5f9);
}

/* ── Settings Field Row ── */
.mv-settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ── Empty State Styling ── */
.mv-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.mv-empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.mv-empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mv-text-primary, #1e293b);
    margin-bottom: 0.5rem;
}

.dark .mv-empty-state-title {
    color: var(--mv-text-primary, #f1f5f9);
}

.mv-empty-state-body {
    font-size: 0.9375rem;
    color: var(--mv-text-secondary, #64748b);
}

.dark .mv-empty-state-body {
    color: var(--mv-text-secondary, #cbd5e1);
}

/* ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   Toast Notification System
   ═══════════════════════════════════════════════════════════ */

/* Toast container */
#mv-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
}

@media (max-width: 640px) {
    #mv-toast-container {
        bottom: 16px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

/* Toast item */
.mv-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    animation: mv-toast-slide-in 0.3s ease-out, mv-toast-slide-out 0.3s ease-in 4.7s forwards;
    word-wrap: break-word;
    line-height: 1.4;
    max-width: 100%;
}

.mv-toast.mv-toast-persistent {
    animation: mv-toast-slide-in 0.3s ease-out;
}

/* Slide in animation */
@keyframes mv-toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide out animation */
@keyframes mv-toast-slide-out {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    @keyframes mv-toast-slide-in {
        from {
            transform: translateY(100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    @keyframes mv-toast-slide-out {
        to {
            transform: translateY(100px);
            opacity: 0;
        }
    }
}

/* Toast types */
.mv-toast-success {
    background: rgba(34, 197, 94, 0.95);
    color: white;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.mv-toast-error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.mv-toast-warning {
    background: rgba(245, 158, 11, 0.95);
    color: #fff;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.mv-toast-info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.dark .mv-toast-success {
    background: rgba(34, 197, 94, 0.85);
    border-color: rgba(34, 197, 94, 0.5);
}

.dark .mv-toast-error {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.5);
}

.dark .mv-toast-warning {
    background: rgba(245, 158, 11, 0.85);
    border-color: rgba(245, 158, 11, 0.5);
}

.dark .mv-toast-info {
    background: rgba(59, 130, 246, 0.85);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Toast icon */
.mv-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast message */
.mv-toast-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Toast action button */
.mv-toast-action {
    flex-shrink: 0;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.mv-toast-action:hover {
    background: rgba(255,255,255,0.3);
}

/* Toast close button */
.mv-toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.mv-toast-close:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   Today hero — premium greeting banner (Top-5 #3)
   ═══════════════════════════════════════════════════════════ */
.mv-hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 22px 24px;
    margin-bottom: 20px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgb(var(--brand-500) / .14), transparent 55%),
        radial-gradient(120% 160% at 100% 0%, rgba(34,211,238,.12), transparent 52%),
        linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
    border: 1px solid rgb(var(--brand-500) / .14);
    box-shadow: 0 18px 44px -24px rgb(var(--brand-900) / .45);
}
.dark .mv-hero {
    background:
        radial-gradient(120% 140% at 0% 0%, rgb(var(--brand-500) / .22), transparent 55%),
        radial-gradient(120% 160% at 100% 0%, rgba(34,211,238,.16), transparent 52%),
        linear-gradient(135deg, #161d2e 0%, #10182a 100%);
    border-color: rgb(var(--brand-400) / .18);
    box-shadow: 0 20px 50px -26px rgba(0,0,0,.7);
}
/* Soft ambient orbs */
.mv-hero-orb { position: absolute; border-radius: 50%; filter: blur(42px); opacity: .5; pointer-events: none; }
.mv-hero-orb-1 { width: 220px; height: 220px; top: -90px; right: -40px; background: radial-gradient(circle, rgb(var(--brand-400)), transparent 70%); }
.mv-hero-orb-2 { width: 180px; height: 180px; bottom: -100px; left: 20%; background: radial-gradient(circle, #22d3ee, transparent 70%); opacity: .35; }

.mv-hero-inner {
    position: relative; z-index: 1;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    flex-wrap: wrap;
}
.mv-hero-eyebrow {
    font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: rgb(var(--brand-500)); margin: 0 0 4px;
}
.dark .mv-hero-eyebrow { color: rgb(var(--brand-300)); }
.mv-hero-title {
    font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; line-height: 1.12; margin: 0;
    color: #0f172a; letter-spacing: -.01em;
}
.dark .mv-hero-title { color: #f1f5f9; }
.mv-hero-name {
    background: linear-gradient(90deg, rgb(var(--brand-600)), #22d3ee);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dark .mv-hero-name { background: linear-gradient(90deg, rgb(var(--brand-300)), #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mv-hero-sub { margin: 7px 0 0; font-size: 13.5px; color: #64748b; max-width: 46ch; }
.dark .mv-hero-sub { color: #94a3b8; }

.mv-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.mv-hero-actions form { margin: 0; }
.mv-hero-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 40px; padding: 0 16px; border-radius: 11px;
    font-size: 13.5px; font-weight: 650; cursor: pointer; white-space: nowrap;
    border: 1px solid rgb(var(--brand-500) / .22); background: rgba(255,255,255,.7); color: rgb(var(--brand-700));
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.mv-hero-btn svg { width: 17px; height: 17px; }
.mv-hero-btn:hover { transform: translateY(-1px); background: #fff; border-color: rgb(var(--brand-500) / .4); }
.dark .mv-hero-btn { background: rgba(255,255,255,.06); color: rgb(var(--brand-200)); border-color: rgb(var(--brand-400) / .25); }
.dark .mv-hero-btn:hover { background: rgba(255,255,255,.1); border-color: rgb(var(--brand-400) / .45); }
.mv-hero-btn-primary {
    background: linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-500))); color: #fff; border-color: transparent;
    box-shadow: 0 10px 22px -10px rgb(var(--brand-600) / .7);
}
.mv-hero-btn-primary:hover { background: linear-gradient(135deg, rgb(var(--brand-700)), rgb(var(--brand-600))); color: #fff; box-shadow: 0 14px 26px -10px rgb(var(--brand-600) / .85); }

/* Stat strip */
.mv-hero-stats {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px;
}
.mv-hero-stat {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 14px; border-radius: 14px;
    background: rgba(255,255,255,.6); border: 1px solid rgba(148,163,184,.18);
    min-width: 0; text-decoration: none;
}
.dark .mv-hero-stat { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.07); }
.mv-hero-stat-ic {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
}
.mv-hero-stat-ic svg { width: 20px; height: 20px; }
.mv-hero-stat-ic-today { background: rgb(var(--brand-500) / .12); color: rgb(var(--brand-500)); }
.mv-hero-stat-ic-over  { background: rgba(239,68,68,.12); color: #ef4444; }
.mv-hero-stat-ic-done  { background: rgba(16,185,129,.12); color: #10b981; }
.mv-hero-stat-ic-next  { background: rgba(34,211,238,.14); color: #06b6d4; }
.mv-hero-stat-body { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mv-hero-stat-body b { font-size: 19px; font-weight: 800; color: #0f172a; }
.dark .mv-hero-stat-body b { color: #f1f5f9; }
.mv-hero-stat-body span { font-size: 11.5px; font-weight: 600; color: #64748b; }
.dark .mv-hero-stat-body span { color: #94a3b8; }
.mv-hero-next-title {
    font-size: 14px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}

/* Next-meeting chip is a link */
.mv-hero-next { transition: transform .12s ease, border-color .15s ease, background .15s ease; }
.mv-hero-next:hover { transform: translateY(-1px); border-color: rgba(6,182,212,.4); }
.mv-hero-next .mv-hero-next-arrow { width: 16px; height: 16px; margin-left: auto; color: #94a3b8; flex: 0 0 auto; }
.mv-hero-next.is-live { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.22); }
.dark .mv-hero-next.is-live { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.28); }
.mv-hero-next.is-live .mv-hero-stat-ic-next { background: rgba(239,68,68,.15); }
.mv-hero-live-dot {
    width: 10px; height: 10px; border-radius: 50%; background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: mvHeroPulse 1.6s infinite;
}
@keyframes mvHeroPulse {
    0% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); }
    70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* Responsive: tablet → 2 columns, phone → 1 column */
@media (max-width: 860px) {
    .mv-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .mv-hero { padding: 18px 18px; border-radius: 18px; }
    .mv-hero-inner { flex-direction: column; align-items: stretch; gap: 14px; }
    .mv-hero-actions { width: 100%; }
    .mv-hero-actions .mv-hero-btn { flex: 1 1 0; justify-content: center; }
    .mv-hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mv-hero-next { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    .mv-hero-live-dot { animation: none; }
}


/* ═══════════════════════════════════════════════════════════
   Command palette (⌘K)  — Top-5 #4
   ═══════════════════════════════════════════════════════════ */
.mv-cmdk {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 12vh 16px 16px;
}
.mv-cmdk[hidden] { display: none; }
.mv-cmdk-backdrop {
    position: absolute; inset: 0; background: rgba(8, 12, 22, .5);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    animation: mvCmdkFade .14s ease;
}
@keyframes mvCmdkFade { from { opacity: 0; } to { opacity: 1; } }
.mv-cmdk-panel {
    position: relative; width: 600px; max-width: 92vw; max-height: 66vh;
    display: flex; flex-direction: column; overflow: hidden;
    background: #ffffff; border: 1px solid rgba(148,163,184,.2); border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgba(15,23,42,.55);
    animation: mvCmdkPop .16s cubic-bezier(.2,.8,.2,1);
}
.dark .mv-cmdk-panel { background: #141b2b; border-color: rgba(255,255,255,.08); box-shadow: 0 30px 80px -18px rgba(0,0,0,.8); }
@keyframes mvCmdkPop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

.mv-cmdk-searchrow {
    display: flex; align-items: center; gap: 11px; padding: 14px 16px;
    border-bottom: 1px solid rgba(148,163,184,.16);
}
.dark .mv-cmdk-searchrow { border-color: rgba(255,255,255,.06); }
.mv-cmdk-search-ic { width: 19px; height: 19px; color: #94a3b8; flex: 0 0 auto; }
#mv-cmdk-input {
    flex: 1; border: none; outline: none; background: none; font-size: 15.5px; color: #0f172a; min-width: 0;
}
#mv-cmdk-input::placeholder { color: #94a3b8; }
.dark #mv-cmdk-input { color: #f1f5f9; }
.mv-cmdk-esc {
    flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: #64748b;
    padding: 3px 7px; border-radius: 6px; border: 1px solid rgba(148,163,184,.3); background: rgba(148,163,184,.08);
}
.dark .mv-cmdk-esc { color: #94a3b8; border-color: rgba(255,255,255,.1); }

.mv-cmdk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.mv-cmdk-section {
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: #94a3b8; padding: 10px 12px 5px;
}
.mv-cmdk-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
    color: #1e293b;
}
.dark .mv-cmdk-item { color: #e2e8f0; }
.mv-cmdk-item.is-active { background: rgb(var(--brand-500) / .1); }
.dark .mv-cmdk-item.is-active { background: rgb(var(--brand-400) / .15); }
.mv-cmdk-item.is-danger.is-active { background: rgba(239,68,68,.1); }
.mv-cmdk-ic {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(148,163,184,.12); color: rgb(var(--brand-500));
}
.dark .mv-cmdk-ic { background: rgba(255,255,255,.05); color: rgb(var(--brand-300)); }
.mv-cmdk-item.is-danger .mv-cmdk-ic { color: #ef4444; }
.mv-cmdk-ic svg { width: 18px; height: 18px; }
.mv-cmdk-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.mv-cmdk-label { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-cmdk-item.is-danger .mv-cmdk-label { color: #ef4444; }
.mv-cmdk-sub { font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-cmdk-go { flex: 0 0 auto; font-size: 12px; color: #cbd5e1; opacity: 0; }
.mv-cmdk-item.is-active .mv-cmdk-go { opacity: 1; color: rgb(var(--brand-500)); }
.dark .mv-cmdk-item.is-active .mv-cmdk-go { color: rgb(var(--brand-300)); }

.mv-cmdk-empty { padding: 26px 16px; text-align: center; font-size: 13px; color: #94a3b8; }
.mv-cmdk-foot {
    display: flex; align-items: center; gap: 16px; padding: 9px 14px;
    border-top: 1px solid rgba(148,163,184,.16); font-size: 11px; color: #94a3b8;
}
.dark .mv-cmdk-foot { border-color: rgba(255,255,255,.06); }
.mv-cmdk-foot kbd {
    font-size: 10px; font-weight: 700; padding: 1px 5px; margin-right: 2px;
    border-radius: 5px; border: 1px solid rgba(148,163,184,.3); background: rgba(148,163,184,.08); color: inherit;
}
.mv-cmdk-foot-brand { margin-left: auto; font-weight: 700; color: rgb(var(--brand-500)); }
.dark .mv-cmdk-foot-brand { color: rgb(var(--brand-300)); }
body.mv-cmdk-open { overflow: hidden; }

@media (max-width: 560px) {
    .mv-cmdk { padding: 8vh 10px 10px; }
    .mv-cmdk-panel { max-height: 76vh; }
    .mv-cmdk-foot { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   Task list progress rings (broader-menu: tasks surface)
   ────────────────────────────────────────────────────────────
   An SVG two-circle ring (static track + animated progress arc) shown per list
   on the Lists page. Chosen over a conic-gradient because SVG strokes theme
   cleanly in light/dark without having to paint an inner "hole" that matches a
   hover-changing row background. The arc length is driven by stroke-dashoffset
   computed in the view (see list_index); the -90° rotation makes 0% start at
   the 12 o'clock position and fill clockwise.
   ═══════════════════════════════════════════════════════════ */
.mv-list-ring { position: relative; width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; }
.mv-list-ring-svg { width: 38px; height: 38px; transform: rotate(-90deg); }
.mv-list-ring-track { fill: none; stroke: #e5e7eb; stroke-width: 3; }
.dark .mv-list-ring-track { stroke: #374151; }
/* Brand-tinted progress arc; smoothly animates when the offset changes. */
.mv-list-ring-prog { fill: none; stroke: rgb(var(--brand-500)); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.2,.8,.2,1); }
.dark .mv-list-ring-prog { stroke: rgb(var(--brand-400)); }
/* A finished list reads as a solid green ring + centred tick. */
.mv-list-ring-prog[data-complete] { stroke: #10b981; }
.dark .mv-list-ring-prog[data-complete] { stroke: #34d399; }
.mv-list-ring-num { position: absolute; font-size: 11px; font-weight: 700; color: #475569; }
.dark .mv-list-ring-num { color: #cbd5e1; }
.mv-list-ring-check { position: absolute; width: 15px; height: 15px; color: #10b981; }
.dark .mv-list-ring-check { color: #34d399; }

/* ═══════════════════════════════════════════════════════════
   Notifications center (bell dropdown) — broader-menu: global
   ═══════════════════════════════════════════════════════════ */
.mv-notif { position: relative; }
.mv-notif-pop { position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-width: 92vw;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 18px 44px rgba(15,23,42,.18);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
  z-index: 60; overflow: hidden; }
.mv-notif-pop.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dark .mv-notif-pop { background: #151f33; border-color: #2b3852; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.mv-notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #eef1f6; font-size: 13px; font-weight: 700; color: #0f172a; }
.dark .mv-notif-head { border-color: #2b3852; color: #e2e8f0; }
.mv-notif-allread { font-size: 11.5px; font-weight: 600; color: rgb(var(--brand-500)); background: none; border: none; cursor: pointer; padding: 0; }
.mv-notif-allread:hover { text-decoration: underline; }
.mv-notif-list { max-height: min(60vh, 420px); overflow-y: auto; }
.mv-notif-item { display: flex; gap: 10px; padding: 11px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid #f4f6fb; cursor: pointer; }
.dark .mv-notif-item { border-color: rgba(255,255,255,.05); }
.mv-notif-item:hover { background: #f8fafc; }
.dark .mv-notif-item:hover { background: rgba(255,255,255,.04); }
.mv-notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 5px; flex-shrink: 0; }
.mv-notif-item.unread .mv-notif-dot { background: rgb(var(--brand-500)); }
.mv-notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mv-notif-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.dark .mv-notif-title { color: #e2e8f0; }
.mv-notif-item.unread .mv-notif-title { font-weight: 700; }
.mv-notif-sub { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.dark .mv-notif-sub { color: #94a3b8; }
.mv-notif-when { font-size: 10.5px; color: #94a3b8; margin-top: 1px; }
.mv-notif-empty { padding: 26px 16px; text-align: center; font-size: 12.5px; color: #94a3b8; }
.mv-notif-foot { display: block; text-align: center; padding: 10px; font-size: 12.5px; font-weight: 600; color: rgb(var(--brand-500)); text-decoration: none; border-top: 1px solid #eef1f6; }
.dark .mv-notif-foot { border-color: #2b3852; color: rgb(var(--brand-300)); }
.mv-notif-foot:hover { background: #f8fafc; }
.dark .mv-notif-foot:hover { background: rgba(255,255,255,.04); }
@media (max-width: 480px) { .mv-notif-pop { position: fixed; top: 58px; right: 8px; left: 8px; width: auto; } }

/* ── Accent picker swatches (account menu) ── */
.mv-accent-row { padding: 9px 12px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #eef1f6; }
.dark .mv-accent-row { border-color: #2b3852; }
.mv-accent-label { font-size: 11px; font-weight: 600; color: #94a3b8; }
.mv-accent-swatches { display: flex; gap: 6px; }
/* Scoped under .mv-accent-swatches (specificity 0,2,0) so these WIN over the
   generic `.mv-menu a, .mv-menu button` menu-item rule (0,1,1) — otherwise the
   swatches inherit the menu-row styling (full-width, transparent background)
   and the colour discs vanish. `display:block` + fixed size overrides the
   menu-row `display:flex; width:100%`. */
.mv-accent-swatches .mv-accent-sw {
    display: block; width: 18px; height: 18px; min-width: 18px; padding: 0;
    border-radius: 50%; background: var(--sw); border: none; cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);   /* faint edge so pale hues read on any surface */
    transition: transform .12s ease, box-shadow .12s ease;
}
.mv-accent-swatches .mv-accent-sw:hover { transform: scale(1.15); }
.mv-accent-swatches .mv-accent-sw.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sw); }
.dark .mv-accent-swatches .mv-accent-sw.active { box-shadow: 0 0 0 2px #151f33, 0 0 0 4px var(--sw); }

/* ═══════════════════════════════════════════════════════════
   First-run onboarding tour (broader-menu: global)
   Spotlight = a transparent box over the target with a huge box-shadow that
   dims everything else; a tooltip card is positioned beside it. Built + moved
   by JS (mvTour in base.html). Fixed positioning so it tracks the viewport.
   ═══════════════════════════════════════════════════════════ */
.mv-tour-spot { position: fixed; z-index: 9998; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8,12,22,.66); transition: all .28s cubic-bezier(.4,0,.2,1); }
.mv-tour-card { position: fixed; z-index: 9999; width: 300px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 20px 50px rgba(8,12,22,.4);
  padding: 16px; transition: top .28s ease, left .28s ease; }
.dark .mv-tour-card { background: #151f33; border-color: #2b3852; }
.mv-tour-step { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--brand-500)); margin-bottom: 6px; }
.dark .mv-tour-step { color: rgb(var(--brand-300)); }
.mv-tour-title { font-size: 15px; font-weight: 800; color: #0f172a; margin: 0 0 5px; }
.dark .mv-tour-title { color: #f1f5f9; }
.mv-tour-body { font-size: 13px; line-height: 1.5; color: #475569; margin: 0 0 14px; }
.dark .mv-tour-body { color: #cbd5e1; }
.mv-tour-actions { display: flex; align-items: center; gap: 8px; }
.mv-tour-skip { font-size: 12px; font-weight: 600; color: #94a3b8; background: none; border: none; cursor: pointer; padding: 6px 4px; margin-right: auto; }
.mv-tour-skip:hover { color: #64748b; }
.mv-tour-btn { font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 9px; border: none; cursor: pointer; }
.mv-tour-back { background: rgba(148,163,184,.16); color: #475569; }
.dark .mv-tour-back { background: rgba(255,255,255,.08); color: #cbd5e1; }
.mv-tour-next { background: linear-gradient(135deg,rgb(var(--brand-600)),rgb(var(--brand-500))); color: #fff; }
.mv-tour-next:hover { filter: brightness(1.06); }
.mv-tour-dots { display: flex; gap: 5px; margin-top: 12px; }
.mv-tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(148,163,184,.4); }
.mv-tour-dots i.on { background: rgb(var(--brand-500)); }
@media (prefers-reduced-motion: reduce) { .mv-tour-spot, .mv-tour-card { transition: none; } }

/* ── App-wide "Return to meeting" pill (base.html) ──
   Shown on any page while this tab is in an active meeting, so the user can
   leave to Chat/Tasks and jump straight back (the room auto-reconnects). A
   premium floating pill with a pulsing "live" dot; follows the accent. */
.mv-return-meeting {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
    z-index: 90; display: inline-flex; align-items: center; gap: 9px;
    padding: 10px 16px 10px 14px; border-radius: 999px; text-decoration: none;
    font-size: 13px; font-weight: 600; color: #fff; max-width: min(92vw, 460px);
    background: linear-gradient(135deg, rgb(var(--brand-600)), rgb(var(--brand-700)));
    box-shadow: 0 10px 30px rgba(2,6,23,.32), 0 2px 10px rgb(var(--brand-600) / .40);
    animation: mvReturnIn .28s ease both;
}
.mv-return-meeting:hover { transform: translateX(-50%) translateY(-1px); filter: brightness(1.06); }
.mv-return-meeting:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mv-return-dot {
    width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(255,90,90,.7); animation: mvReturnPulse 1.7s infinite;
}
.mv-return-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-return-title { font-weight: 500; opacity: .85; }
.mv-return-arrow { width: 15px; height: 15px; flex-shrink: 0; opacity: .9; }
@keyframes mvReturnPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,90,90,.6); }
    70%  { box-shadow: 0 0 0 7px rgba(255,90,90,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,90,90,0); }
}
@keyframes mvReturnIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .mv-return-meeting, .mv-return-dot { animation: none; }
    .mv-return-meeting:hover { transform: translateX(-50%); }
}

/* Meeting-chat file attachment chip (see appendChatMessage / mtUploadFile). */
.chat-file-chip {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
    max-width: 100%; padding: 6px 10px; border-radius: 8px; text-decoration: none;
    font-size: 12px; font-weight: 600;
    background: rgb(var(--brand-50)); color: rgb(var(--brand-700));
    border: 1px solid rgb(var(--brand-200));
}
.dark .chat-file-chip { background: rgb(var(--brand-500) / .14); color: rgb(var(--brand-200)); border-color: rgb(var(--brand-500) / .30); }
.chat-file-chip:hover { filter: brightness(.97); }
.chat-file-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.chat-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-file-size { opacity: .65; font-weight: 500; flex-shrink: 0; }
.chat-file-chip.is-uploading { opacity: .6; pointer-events: none; }
