/* VCM Widget CSS — standalone embed stylesheet */
.xmla-widget-wrapper {
    --w-primary: #00d4ff;
    --w-bg: #111827;
    --w-card: rgba(255,255,255,0.06);
    --w-border: rgba(0,212,255,0.2);
    --w-text: #f9fafb;
    --w-muted: #9ca3af;
    --w-success: #10b981;
    --w-danger: #ef4444;
    --w-radius: 16px;
    --w-btn-radius: 50px;
    --w-panel-width: 380px;
    --w-panel-max-height: 520px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
}

.xmla-widget-wrapper *, .xmla-widget-wrapper *::before, .xmla-widget-wrapper *::after {
    box-sizing: border-box;
}

/* SVG Icons */
.xmla-icon-mic {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
}

.xmla-icon-video {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Launcher Button */
.xmla-launcher {
    position: fixed;
    z-index: 9998;
    bottom: 24px;
    right: 24px;
}

.xmla-launcher.pos-bottom-left   { bottom: 24px; right: auto; left: 24px; }
.xmla-launcher.pos-top-right     { bottom: auto; top: 24px; right: 24px; }
.xmla-launcher.pos-top-left      { bottom: auto; top: 24px; right: auto; left: 24px; }

.xmla-launcher-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, var(--w-primary), #0050ff);
    color: #fff;
    border: none;
    border-radius: var(--w-btn-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
    white-space: nowrap;
}

.xmla-launcher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.xmla-launcher-icon { font-size: 18px; }
.xmla-launcher-pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--w-success);
    border-radius: 50%;
    border: 2px solid var(--w-bg);
}

.xmla-launcher-pulse::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: var(--w-success);
    border-radius: 50%;
    opacity: 0.4;
    animation: xmla-w-pulse 2s infinite;
}

@keyframes xmla-w-pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* Panel */
.xmla-panel {
    position: fixed;
    z-index: 9999;
    bottom: 90px;
    right: 24px;
    width: var(--w-panel-width, 380px);
    max-height: var(--w-panel-max-height, 520px);
    background: var(--w-bg);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: xmla-w-slide-up 0.25s ease;
    backdrop-filter: blur(20px);
}

.xmla-panel.open { display: flex; }
.xmla-panel.pos-bottom-left  { right: auto; left: 24px; }
.xmla-panel.pos-top-right    { bottom: auto; top: 90px; }
.xmla-panel.pos-top-left     { bottom: auto; top: 90px; right: auto; left: 24px; }

@keyframes xmla-w-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.xmla-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(0,80,255,0.08));
    border-bottom: 1px solid var(--w-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.xmla-panel-title { font-size: 15px; font-weight: 700; color: var(--w-text); }
.xmla-panel-close {
    background: none;
    border: none;
    color: var(--w-muted);
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.xmla-panel-close:hover { background: rgba(255,255,255,0.1); color: var(--w-text); }

.xmla-panel-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-width: 0;
}

/* Steps */
.xmla-step { display: none; min-width: 0; overflow: hidden; }
.xmla-step.active { display: block; }

/* Mode Selector */
.xmla-mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.xmla-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 14px 18px;
    background: rgba(15, 23, 42, 0.55);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    cursor: pointer;
    color: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
}

.xmla-mode-btn .xmla-mode-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,212,255,0.1);
    color: var(--w-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 2px;
}

.xmla-mode-btn .xmla-mode-icon::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background: currentColor;
}

.xmla-mode-btn .xmla-mode-icon.xmla-icon-mic::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
}

.xmla-mode-btn .xmla-mode-icon.xmla-icon-video::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E") no-repeat center / contain;
}

.xmla-mode-btn .xmla-mode-label {
    color: #f9fafb;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.xmla-mode-btn .xmla-mode-sub {
    color: var(--w-muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
}

.xmla-mode-btn:hover {
    border-color: rgba(0,212,255,0.5);
    background: rgba(15,23,42,0.75);
}

.xmla-mode-btn:hover .xmla-mode-icon { color: var(--w-primary); }

.xmla-mode-btn.active {
    border-color: var(--w-primary);
    background: rgba(15,23,42,0.75);
    box-shadow: 0 0 0 1px var(--w-primary), 0 0 18px rgba(0,212,255,0.25);
}

.xmla-mode-btn.active .xmla-mode-icon {
    background: rgba(0,212,255,0.18);
    color: var(--w-primary);
}

.xmla-mode-btn.active .xmla-mode-label { color: #ffffff; }

.xmla-mode-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.xmla-mode-icon {
    font-size: 22px;
    color: #f9fafb;
    display: block;
    width: 22px;
    height: 22px;
}

.xmla-mode-label {
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Text mode icon */
.xmla-icon-text {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Recording Controls */
.xmla-recorder-area {
    background: rgba(8, 11, 24, 0.55);
    border: 1px solid rgba(0,212,255,0.18);
    border-radius: 14px;
    padding: 28px 22px 22px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: auto;
    max-height: none;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Ready-to-record idle state */
.xmla-ready-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex: 1;
    color: var(--w-muted);
}
.xmla-ready-icon {
    color: var(--w-muted);
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xmla-ready-icon svg { display: block; }
.xmla-ready-text {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.xmla-video-preview {
    width: 100%;
    border-radius: 8px;
    display: none;
    background: #000;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
    z-index: 1;
}

.xmla-video-preview.visible { display: block; }

/* Ensure timer/controls stay above video preview */
.xmla-recorder-area .xmla-timer,
.xmla-recorder-area .xmla-timer-limit,
.xmla-recorder-area .xmla-rec-controls,
.xmla-recorder-area .xmla-audio-visualizer,
.xmla-recorder-area .xmla-watermark {
    position: relative;
    z-index: 2;
}
.xmla-recorder-area .xmla-settings-btn,
.xmla-recorder-area .xmla-flip-btn {
    z-index: 3;
}

.xmla-audio-visualizer {
    width: 100%;
    max-width: 320px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    margin: 10px auto 14px;
    padding: 0 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    opacity: 0.85;
    transition: opacity 0.3s;
}

.xmla-audio-visualizer.active { opacity: 1; }

.xmla-audio-bar {
    width: 4px;
    height: 4px;
    background: var(--w-primary);
    border-radius: 50%;
    transition: transform 0.08s ease-out;
    will-change: transform;
    flex-shrink: 0;
}

.xmla-timer {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--w-text);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.xmla-timer-limit { font-size: 11px; color: var(--w-muted); margin-bottom: 16px; }

.xmla-rec-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }

.xmla-rec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 48px;
    min-width: 180px;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
    user-select: none;
}
.xmla-rec-controls { margin-top: 6px; }

.xmla-rec-btn-start {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}
.xmla-rec-btn-start:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(239,68,68,0.55); }

.xmla-rec-btn-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}
.xmla-rec-btn-stop:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(239,68,68,0.55); }

.xmla-rec-btn.recording { animation: xmla-w-rec-pulse 1.2s infinite; }
@keyframes xmla-w-rec-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 4px 28px rgba(239,68,68,0.7); }
}

.xmla-rec-btn-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #fff;
    flex-shrink: 0;
}
.xmla-rec-btn-icon-dot { border-radius: 50%; }
.xmla-rec-btn-icon-square { border-radius: 2px; }

.xmla-rec-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Recording Actions (Next + Re-record) */
.xmla-rec-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}

/* Playback */
.xmla-playback {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    display: none;
}

.xmla-playback.visible { display: block; }

.xmla-playback audio, .xmla-playback video {
    width: 100%;
    border-radius: 6px;
    outline: none;
}

/* Custom Player */
.xmla-player {
    background: var(--w-card);
    border: 1px solid var(--w-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.xmla-player-video {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
.xmla-player-video video {
    width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: contain;
    background: #000;
}
.xmla-player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    min-width: 0;
}
.xmla-player-play {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--w-primary);
    color: var(--w-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    transition: opacity 0.15s;
}
.xmla-player-play:hover { opacity: 0.85; }
.xmla-player-seek {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
}
.xmla-player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--w-primary);
    border: none;
    cursor: pointer;
}
.xmla-player-seek::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--w-primary);
    border: none;
    cursor: pointer;
}
.xmla-player-seek::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
}
.xmla-player-seek::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
}
.xmla-player-time {
    font-size: 10px;
    color: var(--w-muted);
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
}
.xmla-player-volume {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    color: var(--w-muted);
    font-size: 12px;
}
.xmla-player-vol-slider {
    width: 40px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
}
.xmla-player-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--w-muted);
    border: none;
    cursor: pointer;
}
.xmla-player-vol-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--w-muted);
    border: none;
    cursor: pointer;
}
.xmla-player-vol-slider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
}

/* Form Fields */
.xmla-form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    min-width: 0;
    width: 100%;
}

.xmla-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.xmla-form-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--w-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xmla-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    min-width: 0;
}
.xmla-form-row .xmla-form-field { min-width: 0; }

.xmla-widget-wrapper input.xmla-form-input,
.xmla-widget-wrapper textarea.xmla-form-input,
.xmla-widget-wrapper select.xmla-form-input,
.xmla-widget-wrapper .xmla-form-input {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 9px !important;
    padding: 10px 12px !important;
    color: var(--w-text) !important;
    -webkit-text-fill-color: var(--w-text) !important;
    caret-color: var(--w-text) !important;
    font-size: 13px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box !important;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit !important;
    resize: vertical;
    box-shadow: none !important;
}
.xmla-widget-wrapper textarea.xmla-form-input { min-height: 96px; }
.xmla-widget-wrapper .xmla-form-input:focus,
.xmla-widget-wrapper .xmla-form-input:hover,
.xmla-widget-wrapper .xmla-form-input:active {
    background: rgba(0,212,255,0.06) !important;
    border-color: var(--w-primary) !important;
    color: var(--w-text) !important;
    -webkit-text-fill-color: var(--w-text) !important;
    outline: none !important;
}
.xmla-widget-wrapper .xmla-form-input:-webkit-autofill,
.xmla-widget-wrapper .xmla-form-input:-webkit-autofill:hover,
.xmla-widget-wrapper .xmla-form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--w-text) !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(12,18,30,0.95) inset !important;
    caret-color: var(--w-text) !important;
}

.xmla-widget-wrapper .xmla-form-input::placeholder { color: #6b7280 !important; opacity: 1; }

.xmla-widget-wrapper select.xmla-form-select,
.xmla-widget-wrapper .xmla-form-select {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 9px !important;
    padding: 0 32px 0 12px !important;
    height: 40px !important;
    line-height: 40px !important;
    color: var(--w-text) !important;
    -webkit-text-fill-color: var(--w-text) !important;
    font-size: 13px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box !important;
    cursor: pointer;
    font-family: inherit !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 12px !important;
}

/* Honeypot */
.xmla-hp-field { opacity: 0; position: absolute; height: 0; overflow: hidden; pointer-events: none; }

/* Status Messages */
.xmla-status {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    display: none;
    margin-bottom: 12px;
}

.xmla-status.visible { display: block; }
.xmla-status.success { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.xmla-status.error   { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* Submit Button */
.xmla-submit-btn {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--w-primary), #0050ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    box-sizing: border-box;
}

.xmla-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.xmla-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Link-style buttons */
.xmla-btn-link {
    background: none;
    border: none;
    color: var(--w-muted);
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 8px;
    font-family: inherit;
    transition: color 0.2s;
}

.xmla-btn-link:hover { color: var(--w-text); }

/* Re-record — secondary button style */
.xmla-rerecord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 6px;
    background: rgba(255,255,255,0.06);
    color: var(--w-text);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.xmla-rerecord-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--w-primary);
    color: var(--w-primary);
}

/* Branding */
.xmla-branding {
    text-align: center;
    padding: 10px 20px 14px;
    font-size: 10px;
    color: var(--w-muted);
    opacity: 0.5;
}

.xmla-branding a { color: var(--w-primary); text-decoration: none; }

/* Watermark */
.xmla-watermark {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 9px;
    color: rgba(255,255,255,0.25);
    pointer-events: none;
}

/* Orientation Prompt */
.xmla-orientation-prompt {
    background: rgba(0,212,255,0.06);
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 12px;
}
.xmla-orient-icon { font-size: 24px; margin-bottom: 6px; }
.xmla-orient-text { font-size: 12px; color: var(--w-text); line-height: 1.4; }
.xmla-orient-dismiss {
    background: none;
    border: none;
    color: var(--w-muted);
    font-size: 11px;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: underline;
}
.xmla-orient-dismiss:hover { color: var(--w-primary); }

/* ── Theme Variants ─────────────────────────────────────────── */
.xmla-theme-glass-light {
    --w-bg: rgba(255,255,255,0.95);
    --w-card: rgba(0,0,0,0.04);
    --w-border: rgba(0,0,0,0.1);
    --w-text: #0f172a;
    --w-muted: #64748b;
}

.xmla-theme-glass-light .xmla-launcher-pulse { border-color: #fff; }
.xmla-theme-glass-light .xmla-panel-close:hover { background: rgba(0,0,0,0.06); }
.xmla-theme-glass-light .xmla-recorder-area { background: rgba(0,0,0,0.04); }
.xmla-theme-glass-light .xmla-playback { background: rgba(0,0,0,0.04); }
.xmla-theme-glass-light .xmla-form-input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #0f172a; -webkit-text-fill-color: #0f172a; caret-color: #0f172a; }
.xmla-theme-glass-light .xmla-form-input::placeholder { color: #94a3b8; }
.xmla-theme-glass-light .xmla-form-select { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #0f172a; }
.xmla-theme-glass-light .xmla-rec-btn-stop { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }
.xmla-theme-glass-light .xmla-rec-btn-stop::after { background: #0f172a; }
.xmla-theme-glass-light .xmla-mode-btn { border-color: rgba(0,0,0,0.08); }
.xmla-theme-glass-light .xmla-status.success { background: rgba(16,185,129,0.1); color: #059669; border-color: rgba(16,185,129,0.2); }
.xmla-theme-glass-light .xmla-status.error { background: rgba(239,68,68,0.08); color: #dc2626; border-color: rgba(239,68,68,0.15); }

.xmla-theme-minimal-white {
    --w-bg: #ffffff;
    --w-card: #f8fafc;
    --w-border: #e2e8f0;
    --w-text: #1e293b;
    --w-muted: #64748b;
    --w-primary: #1e40af;
}

.xmla-theme-minimal-white .xmla-launcher-pulse { border-color: #fff; }
.xmla-theme-minimal-white .xmla-panel-header { background: #f8fafc; }
.xmla-theme-minimal-white .xmla-panel-close:hover { background: rgba(0,0,0,0.06); }
.xmla-theme-minimal-white .xmla-recorder-area { background: #f1f5f9; }
.xmla-theme-minimal-white .xmla-playback { background: #f1f5f9; }
.xmla-theme-minimal-white .xmla-form-input { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; -webkit-text-fill-color: #1e293b; caret-color: #1e293b; }
.xmla-theme-minimal-white .xmla-form-input::placeholder { color: #94a3b8; }
.xmla-theme-minimal-white .xmla-form-select { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
.xmla-theme-minimal-white .xmla-rec-btn-stop { background: #f1f5f9; border-color: #e2e8f0; }
.xmla-theme-minimal-white .xmla-rec-btn-stop::after { background: #1e293b; }
.xmla-theme-minimal-white .xmla-mode-btn { border-color: #e2e8f0; }
.xmla-theme-minimal-white .xmla-status.success { background: rgba(16,185,129,0.08); color: #059669; border-color: rgba(16,185,129,0.2); }
.xmla-theme-minimal-white .xmla-status.error { background: rgba(239,68,68,0.06); color: #dc2626; border-color: rgba(239,68,68,0.15); }

.xmla-theme-cyber-blue {
    --w-bg: #000814;
    --w-card: rgba(0,255,255,0.04);
    --w-border: rgba(0,255,255,0.2);
    --w-text: #00ffff;
    --w-muted: #00b4b4;
    --w-primary: #00ffff;
}

.xmla-theme-corporate {
    --w-bg: #1e293b;
    --w-card: rgba(255,255,255,0.05);
    --w-border: rgba(37,99,235,0.3);
    --w-text: #f8fafc;
    --w-muted: #94a3b8;
    --w-primary: #2563eb;
}

.xmla-theme-floating-bubble .xmla-launcher-btn {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    padding: 0;
    justify-content: center;
}

.xmla-theme-floating-bubble .xmla-launcher-btn .xmla-launcher-text { display: none; }
.xmla-theme-floating-bubble .xmla-launcher-icon { font-size: 22px; }

/* Light theme */
.xmla-theme-demo-light {
    --w-bg: #f8fafc;
    --w-card: rgba(0,0,0,0.04);
    --w-border: rgba(14,165,233,0.25);
    --w-text: #0f172a;
    --w-muted: #64748b;
    --w-primary: #0284c7;
}

.xmla-theme-demo-light .xmla-launcher-pulse { border-color: #fff; }
.xmla-theme-demo-light .xmla-panel-header { background: linear-gradient(135deg, rgba(2,132,199,0.08), rgba(14,165,233,0.08)); }
.xmla-theme-demo-light .xmla-panel-close:hover { background: rgba(0,0,0,0.06); }
.xmla-theme-demo-light .xmla-recorder-area { background: #f1f5f9; }
.xmla-theme-demo-light .xmla-playback { background: #f1f5f9; }
.xmla-theme-demo-light .xmla-form-input { background: #ffffff; border-color: rgba(0,0,0,0.12); color: #0f172a; -webkit-text-fill-color: #0f172a; caret-color: #0f172a; }
.xmla-theme-demo-light .xmla-form-input::placeholder { color: #94a3b8; }
.xmla-theme-demo-light .xmla-form-select { background: #ffffff; border-color: rgba(0,0,0,0.12); color: #0f172a; }
.xmla-theme-demo-light .xmla-rec-btn-stop { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }
.xmla-theme-demo-light .xmla-rec-btn-stop::after { background: #0f172a; }
.xmla-theme-demo-light .xmla-mode-btn { border-color: rgba(0,0,0,0.08); }
.xmla-theme-demo-light .xmla-status.success { background: rgba(16,185,129,0.1); color: #059669; border-color: rgba(16,185,129,0.2); }
.xmla-theme-demo-light .xmla-status.error { background: rgba(239,68,68,0.08); color: #dc2626; border-color: rgba(239,68,68,0.15); }

/* Ocean theme */
.xmla-theme-demo-ocean {
    --w-bg: #0a1628;
    --w-card: rgba(100,200,150,0.04);
    --w-border: rgba(100,200,150,0.2);
    --w-text: #e2f0f7;
    --w-muted: #7ea8c4;
    --w-primary: #64c896;
}

.xmla-theme-demo-ocean .xmla-panel-header { background: linear-gradient(135deg, rgba(100,200,150,0.08), rgba(58,143,191,0.08)); }

/* Bold theme */
.xmla-theme-demo-bold {
    --w-bg: #1a1a2e;
    --w-card: rgba(229,9,20,0.06);
    --w-border: rgba(229,9,20,0.25);
    --w-text: #ffffff;
    --w-muted: #9ca3af;
    --w-primary: #e50914;
}

.xmla-theme-demo-bold .xmla-panel-header { background: linear-gradient(135deg, rgba(229,9,20,0.1), rgba(184,29,36,0.1)); }
.xmla-theme-demo-bold .xmla-launcher-btn { background: linear-gradient(135deg, #e50914, #b81d24); }
.xmla-theme-demo-bold .xmla-submit-btn { background: linear-gradient(135deg, #e50914, #b81d24); }

/* Custom theme (Pro/Agency users) */
.xmla-theme-custom {
    --w-bg: var(--custom-bg, #111827);
    --w-card: var(--custom-card, rgba(255,255,255,0.06));
    --w-border: var(--custom-border, rgba(0,212,255,0.2));
    --w-text: var(--custom-text, #f9fafb);
    --w-muted: var(--custom-muted, #9ca3af);
    --w-primary: var(--custom-primary, #00d4ff);
}

/* Settings & Flip buttons */
.xmla-settings-btn, .xmla-flip-btn {
    position: absolute; bottom: 10px; left: 10px;
    top: auto; right: auto;
    width: 30px; height: 22px; border-radius: 6px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: var(--w-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: all 0.2s; z-index: 2;
}
.xmla-settings-btn:hover, .xmla-flip-btn:hover {
    background: rgba(0,212,255,0.1); color: var(--w-primary); border-color: var(--w-primary);
}
.xmla-settings-btn svg, .xmla-flip-btn svg { width: 14px; height: 14px; display: block; }
.xmla-flip-btn { left: 48px; }

.xmla-desktop-only { display: flex; }
.xmla-mobile-only { display: none; }

.xmla-device-panel {
    background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; margin-bottom: 12px; overflow: hidden;
}
.xmla-device-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px; font-weight: 700; color: var(--w-text);
}
.xmla-device-header button {
    background: none; border: none; color: var(--w-muted); font-size: 18px; cursor: pointer; line-height: 1;
}
.xmla-device-header button:hover { color: var(--w-text); }
.xmla-device-body { padding: 12px 14px; }
.xmla-device-field { margin-bottom: 10px; }
.xmla-device-field:last-child { margin-bottom: 0; }
.xmla-device-field label {
    display: block; font-size: 10px; font-weight: 600; color: var(--w-muted);
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}

/* ── Bubble Launcher ───────────────────────────────────────── */
.xmla-launcher-btn-bubble {
    border-radius: 50%;
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
}
.xmla-launcher-btn-bubble .xmla-launcher-text { display: none; }
.xmla-launcher-btn-bubble .xmla-launcher-icon { font-size: 22px; }
.xmla-launcher-bubble .xmla-launcher-pulse {
    top: -4px;
    right: -4px;
}

/* ── Inline Mode ───────────────────────────────────────────── */
.xmla-widget-inline {
    position: static;
}
.xmla-widget-inline .xmla-inline-panel {
    position: static;
    width: 100%;
    max-height: none;
    background: var(--w-bg);
    border: 1px solid var(--w-border);
    border-radius: var(--w-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.xmla-widget-inline .xmla-panel-body {
    padding: 20px;
    overflow: visible;
}
.xmla-widget-inline .xmla-recorder-area {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.xmla-widget-inline .xmla-timer {
    font-size: 22px;
}

@media (hover: none) and (pointer: coarse) {
    .xmla-desktop-only { display: none !important; }
    .xmla-mobile-only { display: flex !important; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 440px) {
    .xmla-panel {
        width: calc(100vw - 24px);
        max-height: 80vh;
        right: 12px !important;
        left: 12px !important;
        bottom: 80px;
    }
    .xmla-panel.pos-top-right,
    .xmla-panel.pos-top-left {
        top: 80px;
        bottom: auto;
    }
}
