/* 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 { display: flex; align-items: center; justify-content: center; }
.xmla-launcher-icon svg { width: 20px; height: 20px; flex-shrink: 0; }
.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: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.xmla-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    cursor: pointer;
    color: rgba(255,255,255,0.55);
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    outline: none;
    text-align: center;
}

.xmla-mode-btn:focus { outline: none; }
.xmla-mode-btn:focus-visible { box-shadow: 0 0 0 2px var(--w-primary); }

.xmla-mode-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--w-primary);
    color: #f9fafb;
}

.xmla-mode-btn.active {
    background: rgba(255,255,255,0.07);
    border-color: var(--w-primary);
    color: #f9fafb;
    box-shadow: 0 0 0 3px rgba(0,212,255,0.08);
}

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

/* Circular icon badge — matches demo widget */
.xmla-mode-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    transition: background 0.18s;
    flex-shrink: 0;
}

.xmla-mode-btn.active .xmla-mode-icon-wrap {
    background: rgba(0,212,255,0.15);
}

/* Icon mask renders via background — force white */
.xmla-mode-icon {
    display: block;
    width: 20px;
    height: 20px;
    background: #ffffff !important;
    flex-shrink: 0;
}

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

.xmla-mode-sub {
    font-size: 11px;
    opacity: 0.6;
    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 */

/* Outer wrapper: horizontal flex — video viewport left, controls panel right */
.xmla-recorder-area {
    background: #0c0e1a;
    border: 1px solid rgba(0,212,255,0.18);
    border-radius: 12px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 220px;
}

/* Left: the video viewport — square, constrained */
.xmla-recorder-viewport {
    position: relative;
    flex: 0 0 auto;
    width: 220px;
    height: 220px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

/* When no video mode, viewport collapses so controls fill full width */
.xmla-recorder-area.mode-audio .xmla-recorder-viewport,
.xmla-recorder-area.mode-text .xmla-recorder-viewport {
    display: none;
}
.xmla-recorder-area.mode-audio,
.xmla-recorder-area.mode-text {
    min-height: 240px;
}
.xmla-recorder-area.mode-audio .xmla-recorder-overlay,
.xmla-recorder-area.mode-text .xmla-recorder-overlay {
    flex: 1 1 100%;
    width: 100%;
    padding: 28px 20px 44px;
}

.xmla-video-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: none;
    background: #000;
    object-fit: cover;
    z-index: 1;
}

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

/* Watermark inside viewport */
.xmla-recorder-viewport .xmla-watermark {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 9px;
    color: rgba(255,255,255,0.4);
    pointer-events: none;
    z-index: 3;
}

/* Right: controls panel — centered */
.xmla-recorder-overlay {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    gap: 6px;
    min-width: 0;
}

/* Idle state — mic/camera icon + text before recording starts */
.xmla-rec-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}
.xmla-rec-idle svg { opacity: 0.45; }
.xmla-rec-idle.hidden { display: none; }

/* Settings/flip buttons: absolute inside recorder-area */
.xmla-settings-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    top: auto;
    right: auto;
    z-index: 4;
}
.xmla-flip-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    bottom: auto;
    right: auto;
    z-index: 4;
}

/* REC pill — shows when recording */
.xmla-rec-pill {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    align-items: center;
    gap: 5px;
    background: rgba(220,38,38,0.85);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 100px;
    z-index: 5;
}
.xmla-rec-pill.visible { display: flex; }
.xmla-rec-pill-dot {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    animation: xmla-w-blink 1s ease-in-out infinite;
}
@keyframes xmla-w-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.xmla-audio-visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 52px;
    margin-bottom: 4px;
    display: none;
}
.xmla-audio-visualizer.visible { display: flex; }

.xmla-audio-bar {
    display: inline-block;
    width: 3px;
    height: 4px;
    min-height: 4px;
    background: linear-gradient(180deg, var(--w-primary), #0050ff);
    border-radius: 2px;
    transition: height 0.06s ease;
    opacity: 0.7;
}

/* Timer row — hidden until recording */
.xmla-timer-row {
    display: none;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 2px;
}
.xmla-timer-row.visible { display: flex; }

.xmla-timer {
    font-size: 42px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    letter-spacing: 0.04em;
    line-height: 1;
}

.xmla-timer-limit {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* Progress bar */
.xmla-prog-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 14px;
}
.xmla-prog {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--w-primary), #0050ff);
    border-radius: 100px;
    transition: width 0.25s linear;
}
.xmla-prog.danger { background: linear-gradient(90deg, #f59e0b, #ef4444); }

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

/* Unified Record/Stop toggle button — pill style */
.xmla-rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
    font-family: inherit;
    user-select: none;
    color: #fff;
}
.xmla-rec-btn-start {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    box-shadow: 0 4px 18px rgba(185,28,28,0.4);
}
.xmla-rec-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(185,28,28,0.55);
}
.xmla-rec-btn-stop {
    background: linear-gradient(135deg, #374151, #1f2937);
    box-shadow: 0 4px 18px rgba(31,41,55,0.4);
    color: #fff;
}
.xmla-rec-btn-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(31,41,55,0.55);
}
.xmla-rec-btn.recording {
    animation: xmla-w-rec-pulse 1.2s ease-in-out infinite;
}
@keyframes xmla-w-rec-pulse {
    0%, 100% { box-shadow: 0 4px 18px rgba(185,28,28,0.4); }
    50% { box-shadow: 0 4px 32px rgba(185,28,28,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: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--w-primary);
    background: rgba(0,212,255,0.15);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: background 0.15s, transform 0.1s;
}
.xmla-player-play:hover {
    background: rgba(0,212,255,0.3);
    transform: scale(1.08);
}
.xmla-player-seek {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
    margin: 0 4px;
}
.xmla-player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--w-primary);
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(0,212,255,0.25);
    margin-top: -5.5px;
}
.xmla-player-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--w-primary);
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(0,212,255,0.25);
}
.xmla-player-seek::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.15);
}
.xmla-player-seek::-moz-range-track {
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.15);
}
.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-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    padding: 9px 12px;
    color: var(--w-text);
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

.xmla-form-input:focus {
    outline: none;
    border-color: var(--w-primary);
    background: rgba(0,212,255,0.05);
}

.xmla-form-input::placeholder { color: #4b5563; }

.xmla-form-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    padding: 9px 12px;
    color: var(--w-text);
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

/* 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; }
.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; }
.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 svg { width: 24px; height: 24px; }

/* 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; }
.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);
}

/* ── 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 svg { width: 24px; height: 24px; }
.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;
}

.xmla-widget-inline .xmla-recorder-viewport {
    width: 200px;
    height: 200px;
}

.xmla-widget-inline .xmla-timer {
    font-size: 22px;
}


/* Settings & Flip buttons — visual styling (position set above) */
.xmla-settings-btn, .xmla-flip-btn {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.6); border: 1px solid rgba(0,0,0,0.15);
    color: #111827; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: all 0.2s;
}
.xmla-settings-btn:hover, .xmla-flip-btn:hover {
    background: #fff; color: var(--w-primary); border-color: var(--w-primary);
}
.xmla-settings-btn svg, .xmla-flip-btn svg {
    width: 16px; height: 16px; display: block;
}

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

/* Device selection panel */
.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;
}

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

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 360px) {
    .xmla-recorder-area {
        flex-direction: column;
        align-items: center;
    }
    .xmla-recorder-viewport {
        width: 100% !important;
        height: 180px !important;
    }
}

@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;
    }
}
