/* css/mframe-autodesigner.css - Style modala Autoprojektant mFrame */
.mframe-autodesigner-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(3, 7, 18, 0.86);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.mframe-autodesigner-overlay[hidden] {
    display: none;
}
.mframe-autodesigner-modal {
    position: relative;
    width: min(840px, 96vw);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    background: #101722;
    color: #e5e7eb;
    border: 1px solid rgba(0, 210, 255, .52);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .72), 0 0 30px rgba(0, 210, 255, .12);
    overflow: hidden;
    font-family: inherit;
}
.mframe-creative-loading[hidden] { display: none; }
.mframe-creative-loading {
    position: absolute; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; background: rgba(5, 12, 22, .92); backdrop-filter: blur(6px);
}
.mframe-creative-loading-card { width: min(100%, 520px); color: #e2e8f0; }
.mframe-creative-loading-card > small { color: #5eead4; font-size: 10px; letter-spacing: .14em; }
.mframe-creative-loading-card h3 { font-size: 21px; margin: 10px 0 28px; }
.mframe-loading-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; font-size: 14px; line-height: 1.5; }
.mframe-loading-row strong { flex-shrink: 0; color: #67e8f9; font-variant-numeric: tabular-nums; }
.mframe-loading-track { height: 9px; margin-top: 10px; overflow: hidden; border-radius: 6px; background: #22364b; }
.mframe-loading-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #00e5ff, #00ffb3); transition: width .15s ease; }
.mframe-loading-detail { margin-top: 22px; font-size: 12px; color: #94a3b8; }
.mframe-loading-subtrack { height: 4px; margin-top: 8px; }
.mframe-creative-loading-card > p { margin-top: 24px; color: #94a3b8; font-size: 12px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .mframe-loading-track > span { transition: none; } }
.mframe-autodesigner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #243f68, #1c2850 58%, #16233b);
    border-bottom: 1px solid rgba(0, 210, 255, .25);
}
.mframe-autodesigner-header h2 {
    margin: 4px 0 0;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mframe-autodesigner-header small {
    color: #10b981;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-size: 10px;
}
.mframe-autodesigner-close {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.mframe-autodesigner-close:hover {
    background: #1e293b;
    color: #fff;
}
.mframe-autodesigner-body {
    overflow-y: auto;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.mframe-autodesigner-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}
.mframe-autodesigner-chips-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}
.mframe-autodesigner-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mframe-autodesigner-chip {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.mframe-autodesigner-chip:hover {
    background: #0f766e;
    color: #fff;
    border-color: #14b8a6;
    transform: translateY(-1px);
}
.mframe-autodesigner-chip-acc {
    background: #0f2038;
    color: #93c5fd;
    border-color: #1e3a8a;
}
.mframe-autodesigner-chip-acc:hover {
    background: #1e40af;
    color: #fff;
    border-color: #3b82f6;
    transform: translateY(-1px);
}
.mframe-autodesigner-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mframe-autodesigner-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.mframe-autodesigner-input-header label {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}
.mframe-assistant-toolbar, .mframe-creative-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mframe-creative-toolbar[hidden] { display: none; }
.mframe-assistant-toolbar { flex-wrap: wrap; justify-content: flex-end; }
.mframe-creative-toolbar { position: relative; }
.mframe-creative-toolbar .mframe-creative-btn {
    padding: 8px 14px;
    gap: 9px;
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}
.mframe-creative-toolbar .mframe-creative-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, #065f46, #0f766e);
    border-color: #34d399;
    color: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, .12);
}
.mframe-creative-symbol { font-size: 24px; line-height: 1; }
.mframe-creative-settings > summary {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    min-height: 60px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #1e293b;
    color: #94a3b8;
    font-size: 25px;
    cursor: pointer;
    list-style: none;
}
.mframe-creative-settings > summary::-webkit-details-marker { display: none; }
.mframe-creative-settings[open] > summary, .mframe-creative-settings > summary:hover {
    background: #0f2038;
    color: #67e8f9;
    border-color: #38bdf8;
}
.mframe-creative-settings-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;
    box-sizing: border-box;
    width: min(360px, calc(100vw - 64px));
    max-height: min(500px, calc(94vh - 340px));
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #0f172a;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
    color: #e2e8f0;
}
.mframe-creative-settings-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mframe-creative-settings-panel header small { color: #5eead4; font-size: 10px; letter-spacing: .12em; }
.mframe-creative-settings-panel h3 { margin: 5px 0 0; font-size: 18px; }
.mframe-creative-settings-close { border: 0; background: transparent; color: #94a3b8; font-size: 26px; cursor: pointer; padding: 4px 8px; }
.mframe-creative-help, .mframe-creative-settings-note p { color: #94a3b8; font-size: 12px; line-height: 1.55; margin: 8px 0 0; }
.mframe-creative-field { margin-top: 20px; }
.mframe-creative-field label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.mframe-creative-field label span { color: #94a3b8; font-weight: 400; }
.mframe-creative-field output { color: #5eead4; font-size: 11px; }
.mframe-creative-field select, .mframe-creative-field input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    background: #090e17;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font: inherit;
    font-size: 13px;
}
.mframe-creative-field input[type="range"] { width: 100%; margin: 8px 0; accent-color: #14b8a6; }
.mframe-creative-range-labels { display: flex; justify-content: space-between; color: #94a3b8; font-size: 10px; }
.mframe-creative-settings-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid #334155; font-size: 12px; color: #cbd5e1; }
.mframe-creative-toolbar button:focus-visible, .mframe-creative-settings summary:focus-visible,
.mframe-creative-field input:focus-visible, .mframe-creative-field select:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }
@media (max-width: 600px) {
    .mframe-assistant-toolbar { width: 100%; justify-content: flex-start; }
    .mframe-assistant-toolbar > .mframe-voice-btn { width: auto; flex: 1 1 180px; }
    .mframe-creative-toolbar { flex: 1 1 220px; }
    .mframe-creative-toolbar .mframe-creative-btn { width: auto; flex: 1; }
    .mframe-creative-settings-panel { max-height: max(120px, calc(94vh - 430px)); }
}
.mframe-voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #0f3c5c, #19527a);
    color: #dffaff;
    border: 1px solid rgba(0, 229, 255, .58);
    border-radius: 12px;
    padding: 6px 16px 6px 8px;
    min-height: 60px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.mframe-voice-btn:hover {
    background: #0369a1;
    color: #fff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
.mframe-voice-btn .mframe-voice-icon {
    width: 28px;
    height: 28px;
    color: #66dafd;
    position: relative;
}
.mframe-voice-orb { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; }
.mframe-voice-ring { position: absolute; inset: 0; box-sizing: border-box; border: 3px solid rgba(0, 229, 255, .16); border-radius: 50%; }
.mframe-voice-btn[data-voice-state="requesting"] .mframe-voice-ring,
.mframe-voice-btn[data-voice-state="listening"] .mframe-voice-ring,
.mframe-voice-btn[data-voice-state="waiting"] .mframe-voice-ring,
.mframe-voice-btn[data-voice-state="speaking"] .mframe-voice-ring { border-top-color: #00e5ff; border-right-color: #00ffb3; animation: mframe-voice-ring .8s linear infinite; box-shadow: 0 0 18px rgba(0, 229, 255, .25); }
.mframe-voice-btn[data-voice-state="listening"] { background: #183e5b; border-color: #00ffb3; }
@keyframes mframe-voice-ring { to { transform: rotate(360deg); } }
.mframe-voice-btn.requesting {
    background: #78350f;
    color: #fef08a;
    border-color: #f59e0b;
    cursor: wait;
}
.mframe-voice-btn.listening {
    background: #991b1b;
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: voicePulse 1.6s infinite ease-out;
}
.mframe-autodesigner-textarea.voice-active {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
@keyframes voicePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}
.mframe-autodesigner-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    background: #090e17;
    color: #f1f5f9;
    border: 1px solid #334155;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.mframe-autodesigner-textarea:focus {
    outline: none;
    border-color: #00c8ed;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, .14);
}
.mframe-autodesigner-overlay [hidden] { display: none !important; }
.mframe-assistant-modes { display: flex; gap: 6px; }
.mframe-assistant-modes button { flex: 1; padding: 12px; border: 1px solid #46576b; border-radius: 9px; background: #152131; color: #dbe6f1; cursor: pointer; font-weight: 700; }
.mframe-assistant-modes button[aria-pressed="true"] { background: linear-gradient(100deg, #183e5b, #1e3154); border-color: #00c8ed; color: white; box-shadow: inset 0 -3px #00e5ff; }
.mframe-autodesigner-header small { color: #66dafd; letter-spacing: 1.5px; }
.mframe-command-library { border: 1px solid rgba(116, 151, 190, .3); border-radius: 10px; background: #121d2d; }
.mframe-command-library summary { padding: 14px 16px; color: #dffaff; cursor: pointer; font-weight: 700; }
.mframe-command-library summary small { display: block; padding: 5px 0 0 16px; color: #8fa3b9; font-size: 11px; font-weight: 400; }
.mframe-command-library-body { padding: 0 16px 16px; font-size: 12px; line-height: 1.6; color: #b7c9dc; }
.mframe-command-library-body p { margin: 4px 0 14px; }
.mframe-command-list { margin: 0; }
.mframe-command-list > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(116, 151, 190, .18); }
.mframe-command-list dt { color: #66dafd; font-weight: 700; }
.mframe-command-list dd { margin: 0; }
.mframe-command-list button { display: inline-block; text-align: left; padding: 5px 8px; margin: 0 4px 4px 0; border: 1px solid rgba(0, 229, 255, .28); border-radius: 6px; color: #dffaff; background: #18334c; cursor: pointer; font: inherit; }
.mframe-command-library-extra { margin-top: 16px; }
.mframe-recognition { background: #101b2a; border: 1px solid rgba(116, 151, 190, .3); border-radius: 10px; padding: 14px 16px; }
.mframe-recognition h3 { margin: 0 0 10px; font-size: 12px; color: #8fa3b9; letter-spacing: .07em; text-transform: uppercase; }
#mframeRecognizedText { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: #b7c9dc; overflow-wrap: anywhere; }
.mframe-command-group { padding: 7px 10px; border: 1px solid rgba(116, 151, 190, .18); border-radius: 7px; background: #152335; line-height: 1.7; color: #c9d7e6; }
.mframe-recognized-command { color: #ff6b78; font-weight: 700; }
#mframeRecognitionHelp { margin: 10px 0 0; font-size: 11px; line-height: 1.6; color: #8fa3b9; }
#mframeAssistantStatus { margin: 0; font-size: 13px; line-height: 1.6; }
.mframe-dimension-details summary { color: #8fa3b9; cursor: pointer; font-size: 12px; font-weight: 700; }
.mframe-dimension-details:not([open]) > :not(summary) { display: none; }
.mframe-dimension-details[open] .mframe-autodesigner-preview-grid { margin-top: 12px; }
@media (max-width: 600px) {
    .mframe-autodesigner-input-header { align-items: flex-start; flex-direction: column; }
    .mframe-voice-btn { width: 100%; }
    .mframe-command-list > div { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .mframe-voice-ring { animation: none !important; } }
.mframe-autodesigner-preview-card {
    background: #0b1324;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mframe-autodesigner-preview-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mframe-autodesigner-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.mframe-autodesigner-preview-item {
    background: #111a2e;
    border: 1px solid #1e2d4a;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mframe-autodesigner-preview-item small {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}
.mframe-autodesigner-preview-item strong {
    font-size: 13px;
    color: #f8fafc;
}
.mframe-autodesigner-preview-item span.highlight {
    color: #38bdf8;
    font-size: 11px;
}
.mframe-autodesigner-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}
.mframe-autodesigner-checkbox-row input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #10b981;
}
.mframe-autodesigner-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #0b1324;
    border-top: 1px solid #1e293b;
}
.mframe-autodesigner-btn-cancel {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.mframe-autodesigner-btn-cancel:hover {
    background: #334155;
    color: #fff;
}
.mframe-autodesigner-btn-submit {
    background: linear-gradient(135deg, #0f3c5c, #19527a);
    color: #fff;
    border: 1px solid rgba(0, 229, 255, .58);
    padding: 9px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 229, 255, .18);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mframe-autodesigner-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 229, 255, .27);
}
.mframe-autodesigner-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
/* Follow-up questions remain available when microphone access is unavailable. */
.mframe-autodesigner-question { margin-top: 12px; padding: 12px; border: 1px solid #38bdf8; border-radius: 8px; color: #e5f6ff; }
.mframe-autodesigner-question[hidden] { display: none; }
.mframe-autodesigner-question label { display: block; margin-bottom: 8px; }
.mframe-autodesigner-question div { display: flex; gap: 8px; }
.mframe-autodesigner-question input { flex: 1; min-width: 0; padding: 8px; background: #101b24; color: #fff; border: 1px solid #475569; border-radius: 5px; }
.mframe-autodesigner-question button { padding: 8px 12px; color: #101b24; background: #38bdf8; border: 0; border-radius: 5px; cursor: pointer; }
.mframe-autodesigner-question p { margin: 6px 0 0; color: #fca5a5; }
.mframe-recognition-report { display: grid; gap: 6px; margin-top: 10px; font-size: 12px; }
.mframe-recognition-report[hidden], .mframe-assistant-audit[hidden] { display: none; }
.mframe-recognition-report details { border-left: 3px solid #10b981; padding: 6px 10px; background: #101b24; }
.mframe-recognition-report .recognition-defaults { border-color: #38bdf8; }
.mframe-recognition-report .recognition-questions { border-color: #fbbf24; }
.mframe-recognition-report .recognition-unsupported { border-color: #fb7185; color: #fecdd3; }
.mframe-recognition-report ul { margin: 6px 0; padding-left: 18px; }
.mframe-recognition-report li { margin: 4px 0; }
.mframe-assistant-audit { position: fixed; right: 16px; bottom: 76px; z-index: 10050; max-width: min(420px, calc(100vw - 32px)); max-height: 45vh; overflow: auto; padding: 14px; border: 1px solid #10b981; border-radius: 8px; background: #14202e; color: #e5f6ff; box-shadow: 0 5px 20px #0008; font-size: 12px; }
.mframe-assistant-audit strong { display: block; margin-bottom: 8px; }
.mframe-assistant-audit button { margin: 8px 6px 0 0; padding: 6px 10px; border: 1px solid #475569; border-radius: 4px; background: #213448; color: #e5f6ff; cursor: pointer; }
