/* =========================================================
   Meezan Smart Consultation v14 — same visual identity as v13
   ========================================================= */
.mlic-app-wrapper { max-width: 900px; width: 100%; margin: 24px auto; background: #FAF8F5; border-radius: 24px; box-shadow: 0 12px 40px rgba(0,0,0,0.08); font-family: 'Cairo', 'Tajawal', sans-serif; border: 1px solid #EAE3D2; overflow: hidden; display: flex; flex-direction: column; height: 820px; max-height: calc(100vh - 40px); color: #333; text-align: right; position: relative; }
.mlic-app-wrapper *, .mlic-app-wrapper *::before, .mlic-app-wrapper *::after { box-sizing: border-box; }
.mlic-app-wrapper button, .mlic-app-wrapper input, .mlic-app-wrapper textarea { font-family: inherit; text-transform: none; letter-spacing: normal; line-height: 1.5; min-height: 0; box-shadow: none; }

.mlic-top-bar { background: #FAF6ED; padding: 16px 24px; border-bottom: 1px solid #EAE3D2; display: flex; justify-content: space-between; align-items: center; }
.mlic-brand { font-size: 16px; font-weight: 800; color: #444; display: flex; align-items: center; gap: 8px; }
.mlic-top-actions { display: flex; align-items: center; gap: 12px; }
.mlic-live-status { font-size: 12px; color: #555; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.mlic-green-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; display: inline-block; animation: mlicPulse 2s infinite; }
.mlic-reset-btn { background: #fff !important; border: 1px solid #EAE3D2 !important; border-radius: 50% !important; width: 32px !important; min-width: 32px !important; max-width: 32px !important; height: 32px !important; min-height: 32px !important; max-height: 32px !important; aspect-ratio: 1 / 1 !important; cursor: pointer !important; color: #777 !important; padding: 0 !important; margin: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; flex: 0 0 32px !important; line-height: 1 !important; box-shadow: none !important; box-sizing: border-box !important; transition: .2s !important; }
.mlic-reset-btn svg { display: block !important; margin: auto !important; pointer-events: none !important; }
.mlic-reset-btn:hover { color: #C99A3C !important; border-color: #C99A3C !important; transform: rotate(-90deg) !important; }

.mlic-progress-line-wrap { padding: 8px 24px; background: #fff; border-bottom: 1px solid #EAE3D2; display: flex; align-items: center; gap: 12px; }
.mlic-step-indicator { font-size: 12px; color: #888; font-weight: bold; min-width: 34px; }
.mlic-line-bar { flex: 1; height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.mlic-line-fill { height: 100%; background: #C99A3C; width: 14%; transition: width .4s; }

.mlic-main-chat-box { flex: 1; padding: 22px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.mlic-main-chat-box::-webkit-scrollbar { width: 6px; }
.mlic-main-chat-box::-webkit-scrollbar-thumb { background: #E3D7BC; border-radius: 3px; }

.mlic-msg-row { display: flex; align-items: flex-start !important; gap: 12px; max-width: 92%; animation: mlicIn .3s ease both; }
.mlic-bot-row { align-self: flex-start; }
.mlic-user-row { align-self: flex-end; flex-direction: row-reverse; }
.mlic-ico-frame { width: 38px !important; min-width: 38px !important; max-width: 38px !important; height: 38px !important; min-height: 38px !important; max-height: 38px !important; aspect-ratio: 1 / 1 !important; border-radius: 50% !important; background: #F4EEDC !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; flex: 0 0 38px !important; border: 1px solid #EAE3D2 !important; box-sizing: border-box !important; padding: 0 !important; margin: 0 !important; }
.mlic-ico-frame svg { display: block !important; margin: auto !important; }
.mlic-user-row .mlic-ico-frame { background: #444; color: #fff; }
.mlic-msg-bubble { padding: 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.7; background: #fff; border: 1px solid #EAE3D2; color: #333; box-shadow: 0 2px 6px rgba(0,0,0,0.02); min-width: 0; overflow-wrap: anywhere; }
.mlic-user-row .mlic-msg-bubble { background: #444; color: #fff; border: none; }
.mlic-msg-bubble small { color: #888; font-size: 12px; }
.mlic-msg-bubble p { margin: 0 0 8px; }
.mlic-msg-bubble p:last-child { margin-bottom: 0; }
.mlic-msg-bubble ul, .mlic-msg-bubble ol { margin: 6px 0 8px; padding-inline-start: 20px; padding-right: 20px; }
.mlic-msg-bubble h4 { margin: 10px 0 4px; font-size: 14px; color: #C99A3C; }
.mlic-report-row, .mlic-wide-row { max-width: 100%; width: 100%; }
.mlic-report-row .mlic-msg-bubble, .mlic-wide-row .mlic-msg-bubble { flex: 1; }

/* Topic cards (unchanged look) */
.mlic-grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; padding-right: 48px; }
.mlic-card-item { background: #fff; border: 1px solid #EAE3D2; border-radius: 16px; padding: 18px 12px; text-align: center; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.03); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 125px; }
.mlic-card-item:hover, .mlic-card-item.selected { border-color: #C99A3C; background: #FFFDF9; transform: translateY(-3px); }
.mlic-card-icon { margin-bottom: 8px; pointer-events: none; }
.mlic-card-text { pointer-events: none; }
.mlic-card-text strong { display: block; font-size: 14px; color: #333; font-weight: 700; margin-bottom: 3px; }
.mlic-card-text span { display: block; font-size: 10px; color: #777; line-height: 1.3; }

/* Najiz-style option chips */
.mlic-q strong { color: #222; }
.mlic-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mlic-opt { background: #FAF8F5 !important; border: 1px solid #EAE3D2 !important; border-radius: 20px !important; padding: 8px 16px !important; font-size: 13px !important; cursor: pointer; color: #444 !important; transition: .2s; text-align: right; }
.mlic-opt:hover:not(:disabled) { border-color: #C99A3C !important; color: #C99A3C !important; background: #fff !important; }
.mlic-opt.selected { background: #C99A3C !important; border-color: #C99A3C !important; color: #fff !important; }
.mlic-opt.selected::before { content: '✓ '; }
.mlic-done .mlic-opt:not(.selected) { opacity: .45; }
.mlic-opt:disabled { cursor: default; }
.mlic-hint { display: block; margin-top: 8px; font-size: 11px; color: #999; }

/* Buttons */
.mlic-action-btn { display: block; width: 100%; background: #C99A3C !important; color: #fff !important; border: none !important; padding: 12px !important; border-radius: 8px !important; font-weight: bold; font-size: 14px; cursor: pointer; margin-top: 10px; text-align: center; text-decoration: none !important; transition: .2s; }
.mlic-action-btn:hover:not(:disabled) { filter: brightness(.95); transform: translateY(-1px); }
.mlic-action-btn:disabled { opacity: .55; cursor: default; transform: none; }
.mlic-action-btn.secondary { background: #eee !important; color: #444 !important; }
.mlic-action-btn.mlic-wa-btn { background: #25D366 !important; }
.mlic-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mlic-actions-row .mlic-action-btn { flex: 1 1 170px; width: auto; margin-top: 0; }
.mlic-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mlic-suggest .mlic-opt { font-size: 12px !important; padding: 6px 12px !important; }

/* Typing / analyzing */
.mlic-typing { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
.mlic-typing i { display: inline-block; width: 7px; height: 7px; background: #C99A3C; border-radius: 50%; animation: mlicBlink 1.2s infinite both; }
.mlic-typing i:nth-child(2) { animation-delay: .2s; }
.mlic-typing i:nth-child(3) { animation-delay: .4s; }
.mlic-analyzing-status { display: block; margin-top: 6px; font-size: 13px; color: #666; }
.mlic-error { color: #b42318; }

/* Contact form */
.mlic-contact-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mlic-contact-form input[type=text], .mlic-contact-form input[type=tel], .mlic-contact-form input[type=email] { width: 100%; border: 1px solid #EAE3D2 !important; border-radius: 10px !important; padding: 10px 14px !important; font-size: 14px; background: #FAF8F5 !important; outline: none; color: #333; margin: 0; height: auto; }
.mlic-contact-form input:focus { border-color: #C99A3C !important; background: #fff !important; }
.mlic-consent { font-size: 12px; color: #555; display: flex; gap: 6px; align-items: flex-start; cursor: pointer; }
.mlic-consent input { margin-top: 4px; }
.mlic-form-error { color: #b42318; font-size: 12px; min-height: 0; }
.mlic-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

/* Input bar */
.mlic-file-tag { padding: 6px 16px; background: #FAF6ED; font-size: 12px; color: #C99A3C; font-weight: bold; border-top: 1px solid #EAE3D2; display: flex; flex-wrap: wrap; gap: 6px; }
.mlic-chip { background: #fff; border: 1px solid #EAE3D2; border-radius: 14px; padding: 2px 6px 2px 10px; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.mlic-chip-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlic-chip-x { background: none !important; border: none !important; color: #999 !important; cursor: pointer; font-size: 15px; padding: 0 4px !important; line-height: 1 !important; }
.mlic-chip-x:hover { color: #b42318 !important; }
.mlic-bottom-input-bar { padding: 14px 20px; background: #fff; border-top: 1px solid #EAE3D2; display: flex; align-items: center; gap: 12px; }
.mlic-attach-ico { cursor: pointer; color: #777; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; flex-shrink: 0; }
.mlic-attach-ico:hover { color: #C99A3C; }
.mlic-attach-ico.mlic-disabled { opacity: .35; pointer-events: none; }
.mlic-user-msg { flex: 1; border: 1px solid #EAE3D2 !important; padding: 10px 18px !important; border-radius: 22px !important; font-size: 14px; outline: none; background: #FAF8F5 !important; resize: none; height: 44px; max-height: 120px; overflow-y: auto; color: #333; margin: 0 !important; box-sizing: border-box !important; }
.mlic-user-msg:focus { border-color: #C99A3C !important; background: #fff !important; }
.mlic-submit-msg { width: 44px !important; min-width: 44px !important; max-width: 44px !important; height: 44px !important; min-height: 44px !important; max-height: 44px !important; aspect-ratio: 1 / 1 !important; border-radius: 50% !important; background: #C99A3C !important; border: none !important; cursor: pointer !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; transition: 0.2s !important; flex: 0 0 44px !important; padding: 0 !important; margin: 0 !important; box-sizing: border-box !important; line-height: 1 !important; box-shadow: 0 2px 8px rgba(201, 154, 60, 0.25) !important; }
.mlic-submit-msg svg { display: block !important; margin: auto !important; transform: scaleX(-1); pointer-events: none !important; }
.mlic-submit-msg:disabled { opacity: .5 !important; cursor: default !important; }

/* =========================================================
   Report
   ========================================================= */
.mlic-report { font-size: 13.5px; line-height: 1.8; color: #222; }
.mlic-r-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; border-bottom: 2px solid #C99A3C; padding-bottom: 10px; margin-bottom: 12px; }
.mlic-r-title { font-size: 16px; font-weight: 800; color: #111; }
.mlic-r-id { font-size: 12px; background: #fdfaf5; border: 1px solid #EAE3D2; padding: 4px 10px; border-radius: 6px; color: #444; }
.mlic-r-info { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 12.5px; }
.mlic-r-info th, .mlic-r-info td { border: 1px solid #EFE8D8; padding: 6px 8px; text-align: right; vertical-align: top; }
.mlic-r-info th { background: #FAF6ED; color: #555; font-weight: 700; white-space: nowrap; width: 1%; }
.mlic-r-score { display: flex; align-items: center; gap: 14px; border: 1px solid #EAE3D2; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: #FFFDF9; }
.mlic-r-score-num { font-size: 30px; font-weight: 800; min-width: 74px; text-align: center; color: #C99A3C; }
.mlic-score-high .mlic-r-score-num { color: #15803d; }
.mlic-score-mid .mlic-r-score-num { color: #C99A3C; }
.mlic-score-low .mlic-r-score-num { color: #b42318; }
.mlic-r-score-info { flex: 1; }
.mlic-r-score-label { font-size: 13px; margin-bottom: 6px; }
.mlic-r-bar { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.mlic-r-bar span { display: block; height: 100%; background: #C99A3C; border-radius: 4px; }
.mlic-score-high .mlic-r-bar span { background: #16a34a; }
.mlic-score-low .mlic-r-bar span { background: #dc2626; }
.mlic-r-sec { margin-bottom: 12px; }
.mlic-r-sec-title { font-size: 14px !important; font-weight: 800; color: #C99A3C !important; margin: 0 0 6px !important; padding-bottom: 4px; border-bottom: 1px solid #F0EADB; display: flex; align-items: center; gap: 6px; }
.mlic-r-sec-body p { margin: 0 0 6px; text-align: justify; }
.mlic-r-list { margin: 0; padding-right: 20px; padding-inline-start: 20px; }
.mlic-r-list li { margin-bottom: 4px; }
.mlic-law { border: 1px solid #EAE3D2; border-right: 4px solid #C99A3C; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.mlic-law-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.mlic-law-name { font-weight: 800; color: #222; }
.mlic-law-art { background: #C99A3C; color: #fff; font-size: 12px; font-weight: 700; padding: 1px 10px; border-radius: 12px; white-space: nowrap; }
.mlic-law-meta { font-size: 12px; color: #666; margin: 2px 0 6px; }
.mlic-law-year { display: inline-block; background: #FAF6ED; border: 1px solid #EAE3D2; border-radius: 10px; padding: 0 8px; margin-right: 4px; color: #8a6a26; font-weight: 700; }
.mlic-law-row { font-size: 13px; margin-top: 4px; }
.mlic-law-row b { color: #444; }
.mlic-r-verify { font-size: 12px; background: #FFF8E6; border: 1px dashed #C99A3C; border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.mlic-r-disclaimer { margin-top: 14px; padding: 10px 12px; border: 1px solid #C99A3C; background: #fdfaf5; color: #333; font-size: 11.5px; line-height: 1.7; border-radius: 8px; text-align: justify; }

/* LTR support (French / English) */
.mlic-app-wrapper[dir="ltr"] { text-align: left; direction: ltr; }
.mlic-app-wrapper[dir="ltr"] .mlic-top-bar { direction: ltr; }
.mlic-app-wrapper[dir="ltr"] .mlic-grid-cards { padding-right: 0; padding-left: 48px; }
.mlic-app-wrapper[dir="ltr"] .mlic-card-text { text-align: center; }
.mlic-app-wrapper[dir="ltr"] .mlic-opt { text-align: left; }
.mlic-app-wrapper[dir="ltr"] .mlic-submit-msg svg { transform: none !important; }
.mlic-app-wrapper[dir="ltr"] .mlic-r-info th, .mlic-app-wrapper[dir="ltr"] .mlic-r-info td { text-align: left; }
.mlic-app-wrapper[dir="ltr"] .mlic-law { border-right: 1px solid #EAE3D2; border-left: 4px solid #C99A3C; }
.mlic-app-wrapper[dir="ltr"] .mlic-r-list { padding-right: 0; padding-left: 20px; }
@media (max-width: 768px) {
    .mlic-app-wrapper[dir="ltr"] .mlic-grid-cards { padding-left: 0; }
}

/* Print window */
.mlic-print-body { background: #fff; margin: 0; font-family: 'Cairo', 'Tajawal', sans-serif; direction: rtl; }
.mlic-print { max-width: 800px; margin: 0 auto; padding: 30px 36px; color: #222; }
.mlic-print-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #C99A3C; padding-bottom: 14px; margin-bottom: 14px; }
.mlic-print-logo { max-height: 60px; max-width: 240px; }
.mlic-print-brand { font-weight: 800; font-size: 18px; color: #C99A3C; }
.mlic-print-title { text-align: center; font-size: 21px; margin: 6px 0 2px; }
.mlic-print-sub { text-align: center; font-size: 12px; color: #666; margin-bottom: 16px; }
.mlic-print .mlic-r-head { display: none; }
.mlic-print-footer { margin-top: 24px; text-align: center; font-size: 10.5px; color: #777; border-top: 1px solid #ddd; padding-top: 12px; line-height: 1.8; }
@media print {
    @page { size: A4; margin: 12mm; }
    .mlic-print { padding: 0; }
    .mlic-print-body, .mlic-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .mlic-law, .mlic-r-score, .mlic-r-disclaimer { break-inside: avoid; }
    .mlic-r-sec-title { break-after: avoid; }
}

/* Admin report preview */
.mlic-admin-report .mlic-report { max-width: 900px; }

/* Animations */
@keyframes mlicBlink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes mlicIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mlicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); } }

/* Mobile */
@media (max-width: 768px) {
    .mlic-app-wrapper { margin: 10px auto; border-radius: 18px; height: 85vh; height: 85dvh; max-height: none; }
    .mlic-grid-cards { grid-template-columns: repeat(2, 1fr); padding-right: 0; }
    .mlic-msg-row { max-width: 100%; }
    .mlic-main-chat-box { padding: 14px; }
    .mlic-top-bar { padding: 14px 16px; }
    .mlic-bottom-input-bar { padding: 10px 12px; gap: 8px; }
    .mlic-ico-frame { width: 30px; height: 30px; }
    .mlic-r-score-num { font-size: 24px; min-width: 60px; }
}

