/* Malek AI: the pieces every Malek AI button uses (malek.js).
   .mk-work      "Malek AI is working" — a little robot, rings, dots, and messages that change
   .mk-back/.mk-win   the Malek AI window on a text (verdict, original | proposal, actions)          */

/* ---- working ------------------------------------------------------------------------------ */
.mk-work { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center;
  background: rgba(250, 248, 255, .93); border-radius: inherit; animation: mk-fade .2s ease-out; }
.mk-work[hidden] { display: none; }
.mk-work.page { position: fixed; z-index: 400; background: rgba(11, 31, 56, .45); border-radius: 0; }
.mk-work.page .mk-work-card { background: #fff; padding: 26px 34px 22px; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(20, 10, 60, .3); }
.mk-bot { position: relative; width: 92px; height: 92px; margin: 0 auto 12px; }
.mk-bot svg { position: absolute; inset: 18px; width: 56px; height: 56px; color: #6d28d9;
  animation: mk-float 2.4s ease-in-out infinite; }
.mk-bot::before, .mk-bot::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #c4b5fd; animation: mk-ring 2.2s ease-out infinite; }
.mk-bot::after { animation-delay: 1.1s; }
.mk-work-msg { font-weight: 600; color: #3b1a87; min-height: 1.4em; transition: opacity .25s; }
.mk-work-msg.out { opacity: 0; }
.mk-dots { display: inline-flex; gap: 5px; margin-top: 10px; }
.mk-dots i { width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; animation: mk-dot 1.2s infinite; }
.mk-dots i:nth-child(2) { animation-delay: .15s; }
.mk-dots i:nth-child(3) { animation-delay: .3s; }
.mk-work-sec { display: block; margin-top: 6px; font-size: 12px; color: #7c6f99; }
@keyframes mk-ring { from { transform: scale(.55); opacity: .9; } to { transform: scale(1.15); opacity: 0; } }
@keyframes mk-float { 50% { transform: translateY(-5px); } }
@keyframes mk-dot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: none; opacity: 1; } }
@keyframes mk-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .mk-bot svg, .mk-bot::before, .mk-bot::after, .mk-dots i { animation: none; }
}

/* ---- the Malek AI window ------------------------------------------------------------------ */
.mk-back { position: fixed; inset: 0; z-index: 300; background: rgba(11, 31, 56, .5); display: grid;
  place-items: center; padding: 18px; animation: mk-fade .15s ease-out; }
.mk-back[hidden] { display: none; }
.mk-win { position: relative; width: 100%; max-width: 1180px; height: min(90vh, 900px); display: flex;
  flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(20, 10, 60, .35); }
.mk-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: linear-gradient(120deg, #4c1d95, #6d28d9 55%, #2563eb); color: #fff; }
.mk-badge { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .16);
  display: grid; place-items: center; flex: none; }
.mk-badge svg { width: 24px; height: 24px; }
.mk-head h2 { margin: 0; font-size: 17px; line-height: 1.2; }
.mk-head small { display: block; opacity: .85; font-weight: 400; font-size: 12.5px; }
.mk-close { margin-left: auto; background: rgba(255, 255, 255, .15); border: 0; color: #fff; width: 34px;
  height: 34px; border-radius: 10px; font-size: 20px; cursor: pointer; }
.mk-close:hover { background: rgba(255, 255, 255, .28); }

.mk-verdict { display: flex; align-items: flex-start; gap: 10px; margin: 12px 18px 0; padding: 10px 14px;
  border-radius: 12px; border: 1px solid #e5e7eb; background: #f9fafb; font-size: 14px; }
.mk-verdict[hidden] { display: none; }
.mk-verdict b { white-space: nowrap; }
.mk-verdict .mk-pill { flex: none; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; }
.mk-verdict.ANSWERS { background: #ecfdf3; border-color: #a7f3c9; }
.mk-verdict.ANSWERS .mk-pill { background: #16a34a; color: #fff; }
.mk-verdict.PARTIAL { background: #fffbeb; border-color: #fcd98a; }
.mk-verdict.PARTIAL .mk-pill { background: #d97706; color: #fff; }
.mk-verdict.NO { background: #fef2f2; border-color: #fbc2c2; }
.mk-verdict.NO .mk-pill { background: #dc2626; color: #fff; }
.mk-lang { margin-left: auto; flex: none; font-size: 12.5px; color: #4b5563; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 99px; padding: 2px 10px; }

.mk-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 18px; }
.mk-col { display: flex; flex-direction: column; min-height: 0; border: 1px solid #e5e7eb; border-radius: 14px;
  overflow: hidden; }
.mk-col.prop { border-color: #c4b5fd; box-shadow: 0 0 0 3px #f3efff; }
.mk-col-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb; font-size: 13px; font-weight: 700; color: #334155; }
.mk-col.prop .mk-col-head { background: #f5f3ff; color: #4c1d95; border-color: #ddd6fe; }
.mk-col-head .muted { font-weight: 400; color: #6b7280; }
.mk-col-head label { margin-left: auto; font-weight: 400; display: inline-flex; gap: 5px; align-items: center; }
.mk-text { flex: 1; overflow: auto; padding: 12px 14px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.6;
  color: #1f2937; }
.mk-text.empty { color: #9ca3af; font-style: italic; }
.mk-col textarea { flex: 1; border: 0; padding: 12px 14px; font: inherit; font-size: 14.5px; line-height: 1.6;
  resize: none; outline: none; }
.mk-text del { background: #fde2e2; color: #9b1c1c; text-decoration: line-through; text-decoration-color: #e57373;
  border-radius: 3px; }
.mk-text ins { background: #d9f7e4; color: #0f5132; text-decoration: none; border-radius: 3px; }
.mk-note { padding: 6px 12px; font-size: 12.5px; color: #5b4b8a; background: #faf8ff; border-top: 1px solid #ede9fe; }
.mk-note[hidden] { display: none; }
.mk-col.nodiff del, .mk-col.nodiff ins { background: none; color: inherit; text-decoration: none; }

.mk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 18px 10px; }
.mk-tools .mk-sep { width: 1px; height: 26px; background: #e5e7eb; }
.mk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid #ddd6fe; background: #fff; color: #4c1d95; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; }
.mk-chip:hover:not(:disabled) { background: #f5f3ff; border-color: #a78bfa; }
.mk-chip.main { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.mk-chip.main:hover:not(:disabled) { background: #5b21b6; }
.mk-chip:disabled { opacity: .5; cursor: default; }
.mk-trans { display: inline-flex; align-items: stretch; border: 1px solid #ddd6fe; border-radius: 10px; overflow: hidden; }
.mk-trans .mk-chip { border: 0; border-radius: 0; }
.mk-trans select { border: 0; border-left: 1px solid #ddd6fe; font: inherit; font-size: 13.5px; padding: 0 8px;
  color: #4c1d95; background: #faf8ff; }
.mk-ask { flex: 1 1 320px; display: flex; border: 1px solid #ddd6fe; border-radius: 10px; overflow: hidden; }
.mk-ask input { flex: 1; border: 0; padding: 8px 12px; font: inherit; font-size: 13.5px; outline: none; }
.mk-ask button { border: 0; background: #ede9fe; color: #4c1d95; padding: 0 14px; cursor: pointer; font-weight: 700; }
.mk-ask button:hover:not(:disabled) { background: #ddd6fe; }
.mk-on { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; font-size: 12.5px; }
.mk-on button { border: 0; background: #fff; padding: 6px 10px; cursor: pointer; color: #4b5563; font: inherit; }
.mk-on button.on { background: #1f2937; color: #fff; }

.mk-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid #eef0f4;
  background: #fbfbfd; }
.mk-foot .muted { color: #6b7280; font-size: 13px; }
.mk-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid #d1d5db; background: #fff; font: inherit;
  font-weight: 600; cursor: pointer; }
.mk-btn:hover:not(:disabled) { background: #f3f4f6; }
.mk-btn.primary { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.mk-btn.primary:hover:not(:disabled) { background: #5b21b6; }
.mk-btn:disabled { opacity: .5; cursor: default; }
.mk-foot .push { margin-left: auto; }
.mk-err { margin: 10px 18px 0; padding: 9px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b;
  border: 1px solid #fecaca; font-size: 13.5px; }
.mk-err[hidden] { display: none; }

@media (max-width: 820px) {
  .mk-cols { grid-template-columns: 1fr; }
  .mk-win { height: 96vh; }
}

/* ---- the Malek AI pop-up with the language (MalekAI.run) and the menu under my name --------- */
.mk-run { position: relative; min-height: 300px; max-width: 470px; }
.mk-run-label { margin: 16px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #8a4a0c; }
.mk-lang-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* same orange as the Malek AI pop-up (dialog.css, kind "malek") */
.mk-lang-pill { border: 1px solid #f3c99a; background: #fff; color: #8a4a0c; border-radius: 18px; padding: 7px 14px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.mk-lang-pill:hover { border-color: #e07b1a; background: #fff8f0; }
.mk-lang-pill.on { background: #e07b1a; border-color: #e07b1a; color: #fff; box-shadow: 0 2px 8px rgba(224, 123, 26, .3); }
.mk-lang-pill:focus-visible { outline: 3px solid rgba(224, 123, 26, .35); outline-offset: 2px; }
.mk-run-err { margin: 14px 0 0; padding: 8px 12px; border-radius: 10px; background: #fdecec; color: #b42318; font-size: 13.5px; }
.mk-run-err[hidden] { display: none; }
.mk-run .mk-work { border-radius: 20px; background: #fff; }
.user-card-prefs .mk-lang-pills { justify-content: flex-start; gap: 6px; }
.user-card-prefs .mk-lang-pill { padding: 5px 11px; font-size: 13px; }
