/* monkeyai.css — a cara da Monkey AI. Pop, sólido, divertido.
 * Paleta (espírito Conca, Lisboa: rosa forte e tropical, blocos de cor plana,
 * tipografia gorda): rosa #ff3c8e, laranja #ff8a1f, azul-cobalto #2440e6,
 * verde #19b26b, amarelo #ffd23f, sobre creme #fff6e9 e tinta #15161a.
 * Contraste AA: texto de tinta sobre rosa/laranja/verde/amarelo/creme (≥ 6:1);
 * texto branco SÓ sobre o cobalto (≈ 8:1). Nada de castanhos nem beges.
 * Ficheiro próprio: NÃO carrega o style.css nem o command-center.css. */
:root {
  --pink: #ff3c8e; --pink-deep: #e0206f; --orange: #ff8a1f; --blue: #2440e6; --green: #19b26b; --yellow: #ffd23f;
  --cream: #fff6e9; --paper: #ffffff; --ink: #15161a; --ink-soft: #3a3c45; --line: #15161a;
  --radius: 18px; --side-w: 290px;
  --font: "Avenir Next", "Nunito", "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--blue); }
::selection { background: var(--yellow); color: var(--ink); }

/* ── marca ─────────────────────────────────────────────────────────────── */
.mk-wordmark { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 900; letter-spacing: -.03em; font-size: 34px; line-height: 1; }
.mk-wordmark-small { font-size: 22px; }
.mk-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mk-brand img { border-radius: 10px; border: 2px solid var(--ink); }

/* ── botões e chips ────────────────────────────────────────────────────── */
.mk-btn { border: 2.5px solid var(--ink); border-radius: 999px; padding: 12px 22px; font-weight: 800; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.mk-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.mk-btn:disabled { opacity: .6; cursor: progress; }
.mk-btn-pink { background: var(--pink); color: var(--ink); }
.mk-btn-ink { background: var(--ink); color: var(--yellow); box-shadow: 4px 4px 0 var(--pink); }
.mk-link { background: none; border: 0; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; color: var(--ink-soft); }
.mk-icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper); font-size: 18px; font-weight: 800; display: inline-grid; place-items: center; }
.mk-chip { border: 2px solid var(--ink); border-radius: 999px; padding: 9px 16px; font-weight: 800; font-size: 15px; background: var(--paper); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); text-align: left; }
.mk-chip:hover { transform: translateY(-1px); }
.mk-chip-yellow { background: var(--yellow); } .mk-chip-blue { background: var(--blue); color: #fff; box-shadow: 3px 3px 0 var(--ink); } .mk-chip-green { background: var(--green); } .mk-chip-orange { background: var(--orange); } .mk-chip-pink { background: var(--pink); }
.mk-sticker { position: absolute; background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 900; transform: rotate(-6deg); box-shadow: 3px 3px 0 var(--ink); font-size: 15px; }

/* ── login ─────────────────────────────────────────────────────────────── */
.mk-login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--cream); background-image: radial-gradient(var(--pink) 1.6px, transparent 1.8px); background-size: 26px 26px; }
.mk-login-card { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border: 3px solid var(--ink); border-radius: 28px; box-shadow: 10px 10px 0 var(--ink); overflow: hidden; }
.mk-login-stage { position: relative; background: var(--pink); min-height: 420px; display: grid; place-items: center; border-right: 3px solid var(--ink); }
.mk-mascote { position: relative; width: 100%; aspect-ratio: 1; }
.mk-mascote canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s; }
.mk-mascote.mk-ready canvas { opacity: 1; }
.mk-mascote .mk-fallback { position: absolute; inset: 14%; width: 72%; height: 72%; border-radius: 28%; }
.mk-mascote.mk-ready .mk-fallback { opacity: 0; }
.mk-mascote-login { width: min(340px, 80%); }
.mk-sticker-a { top: 10%; left: 8%; } .mk-sticker-b { bottom: 12%; right: 8%; background: var(--green); transform: rotate(5deg); }
.mk-login-form { padding: 40px 40px 34px; display: flex; flex-direction: column; }
.mk-login-form h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.03em; margin: 22px 0 6px; font-weight: 900; }
.mk-lead { margin: 0 0 18px; color: var(--ink-soft); font-weight: 600; }
.mk-login-form label { font-weight: 800; font-size: 14px; margin-top: 12px; display: block; }
.mk-login-form input[type=email], .mk-login-form input[type=password], .mk-login-form input[type=text] { width: 100%; margin-top: 6px; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--cream); outline: none; font-size: 17px; }
.mk-login-form input:focus { background: #fff; box-shadow: 0 0 0 3px var(--yellow); }
.mk-login-form input[aria-invalid=true] { border-color: var(--pink-deep); }
.mk-pw { position: relative; }
.mk-pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin-top: 3px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; }
.mk-check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-weight: 700; font-size: 14px; }
.mk-check input { width: 20px; height: 20px; accent-color: var(--blue); }
.mk-estado { min-height: 22px; margin: 10px 0 6px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.mk-estado.erro { color: var(--pink-deep); }
.mk-estado.ok { color: #0d7a4a; }
#entrar { align-self: flex-start; font-size: 18px; margin-top: 4px; }

/* ── app ───────────────────────────────────────────────────────────────── */
.mk-app { display: flex; height: 100dvh; }
.mk-side { width: var(--side-w); flex: 0 0 var(--side-w); background: var(--yellow); border-right: 3px solid var(--ink); display: flex; flex-direction: column; padding: 16px 14px; gap: 12px; }
.mk-side-top { display: flex; align-items: center; justify-content: space-between; min-height: 42px; }
.mk-side-close { display: none; }
.mk-new { width: 100%; text-align: left; }
.mk-convs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; scrollbar-width: thin; }
.mk-conv { display: block; width: 100%; text-align: left; background: transparent; border: 2px solid transparent; border-radius: 12px; padding: 9px 10px; font-weight: 700; color: var(--ink); }
.mk-conv:hover { background: rgba(255,255,255,.55); }
.mk-conv.ativa { background: var(--paper); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.mk-conv b { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-conv small { display: block; font-weight: 600; color: var(--ink-soft); font-size: 12px; }
.mk-conv .mk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); margin-right: 6px; vertical-align: middle; }
.mk-convs-head { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 8px 10px 2px; }
.mk-side-foot { display: flex; flex-direction: column; gap: 2px; border-top: 2px dashed var(--ink); padding-top: 10px; }
.mk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.mk-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 3px solid var(--ink); background: var(--cream); }
.mk-top #menu { display: none; }
.mk-top-title { flex: 1; font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.mk-col { max-width: 780px; margin: 0 auto; padding: 24px 18px 0; }
.mk-bottom-pad { height: 24px; }

/* vazio */
.mk-empty { text-align: center; padding: 10px 0 20px; }
.mk-empty-stage { position: relative; width: min(360px, 78vw); margin: 0 auto 10px; }
.mk-mascote-hero { width: 100%; position: relative; z-index: 1; }
.mk-blob { position: absolute; border-radius: 50%; border: 3px solid var(--ink); }
.mk-blob-a { width: 58%; height: 58%; background: var(--pink); left: -6%; top: 12%; }
.mk-blob-b { width: 44%; height: 44%; background: var(--blue); right: -4%; bottom: 8%; }
.mk-sticker-c { right: -2%; top: 4%; z-index: 2; background: var(--orange); cursor: pointer; }
.mk-empty h2 { font-size: clamp(30px, 5vw, 44px); line-height: 1.05; letter-spacing: -.03em; margin: 10px 0 6px; font-weight: 900; }
.mk-empty p { margin: 0 0 22px; color: var(--ink-soft); font-weight: 600; font-size: 17px; }
.mk-starters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* mensagens */
.mk-msgs { display: flex; flex-direction: column; gap: 16px; }
.mk-msg { display: flex; }
.mk-msg.user { justify-content: flex-end; }
.mk-bubble { max-width: 86%; padding: 12px 16px; border-radius: var(--radius); border: 2.5px solid var(--ink); overflow-wrap: anywhere; }
.mk-msg.user .mk-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; box-shadow: 4px 4px 0 var(--ink); white-space: pre-wrap; }
.mk-msg.assistant .mk-bubble { background: var(--paper); border-bottom-left-radius: 6px; box-shadow: 4px 4px 0 var(--pink); }
.mk-msg.error .mk-bubble { background: var(--yellow); border-style: dashed; font-weight: 700; }
.mk-msg.live .mk-bubble { box-shadow: 4px 4px 0 var(--green); }
.mk-avatar { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--ink); margin: 2px 10px 0 0; flex: 0 0 34px; background: var(--pink) url(/monkeyai-icon.svg) center/cover; }
.mk-bubble p { margin: 0 0 .7em; } .mk-bubble p:last-child, .mk-bubble ul:last-child, .mk-bubble ol:last-child { margin-bottom: 0; }
.mk-bubble h2, .mk-bubble h3, .mk-bubble h4 { margin: .6em 0 .3em; line-height: 1.2; }
.mk-bubble pre { background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; overflow-x: auto; font-size: 14px; }
.mk-bubble code { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 6px; padding: 0 5px; font-size: .92em; }
.mk-bubble pre code { background: none; border: 0; padding: 0; }
.mk-msg.user .mk-bubble code { background: rgba(255,255,255,.2); border-color: #fff; }
.mk-bubble table { border-collapse: collapse; width: 100%; font-size: 14px; margin: .5em 0; }
.mk-bubble th, .mk-bubble td { border: 2px solid var(--ink); padding: 6px 8px; text-align: left; }
.mk-bubble th { background: var(--yellow); }
.mk-bubble blockquote { margin: .5em 0; padding: 4px 12px; border-left: 4px solid var(--orange); color: var(--ink-soft); }
.mk-bubble hr { border: 0; border-top: 2px dashed var(--ink); }
.mk-typing { display: inline-flex; gap: 5px; align-items: center; height: 20px; }
.mk-typing i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); animation: mkBounce 1.1s infinite; }
.mk-typing i:nth-child(2) { animation-delay: .15s; background: var(--pink); } .mk-typing i:nth-child(3) { animation-delay: .3s; background: var(--blue); }
@keyframes mkBounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
.mk-suggs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0 44px; }
.mk-suggs:empty { margin: 0; }
.mk-notice { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 6px 0; }

/* dock (o macaco pequeno a acompanhar a conversa) */
.mk-dock { position: absolute; right: 14px; bottom: 112px; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 14px 4px 4px; box-shadow: 3px 3px 0 var(--ink); font-weight: 800; font-size: 13px; pointer-events: none; }
.mk-mascote-dock { width: 52px; }

/* composer fixo em baixo */
.mk-compose { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--cream); border-top: 3px solid var(--ink); }
.mk-compose-box { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 22px; padding: 8px 8px 8px 16px; box-shadow: 5px 5px 0 var(--ink); }
.mk-compose-box:focus-within { box-shadow: 5px 5px 0 var(--blue); }
#inp { flex: 1; border: 0; outline: none; resize: none; background: transparent; max-height: 180px; line-height: 1.45; padding: 8px 0; font-size: 17px; }
.mk-send { width: 44px; height: 44px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--pink); color: var(--ink); font-size: 22px; font-weight: 900; display: grid; place-items: center; flex: 0 0 44px; }
.mk-send:disabled { background: var(--cream); color: var(--ink-soft); cursor: default; }
.mk-stop { background: var(--orange); font-size: 16px; }
.mk-compose-note { max-width: 780px; margin: 8px auto 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); }

/* ── telemóvel: barra lateral em gaveta ────────────────────────────────── */
@media (max-width: 900px) {
  .mk-side { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-105%); transition: transform .22s ease; width: min(var(--side-w), 86vw); box-shadow: 8px 0 0 rgba(21,22,26,.15); }
  .mk-app.mk-side-open .mk-side { transform: none; }
  .mk-side-close { display: inline-grid; }
  .mk-scrim { position: fixed; inset: 0; background: rgba(21,22,26,.45); z-index: 20; }
  .mk-top #menu { display: inline-grid; }
  .mk-col { padding: 16px 12px 0; }
  .mk-bubble { max-width: 92%; }
  .mk-avatar { display: none; }
  .mk-suggs { margin-left: 0; }
  .mk-dock { display: none; }
  .mk-compose { padding-left: 10px; padding-right: 10px; }
  .mk-compose-note { display: none; }
  .mk-login { padding: 12px; }
  .mk-login-card { grid-template-columns: 1fr; box-shadow: 6px 6px 0 var(--ink); }
  .mk-login-stage { min-height: 250px; border-right: 0; border-bottom: 3px solid var(--ink); }
  .mk-mascote-login { width: min(230px, 60%); }
  .mk-login-form { padding: 24px 20px 22px; }
  .mk-login-form h1 { font-size: 30px; }
  .mk-sticker { font-size: 13px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { .mk-side, .mk-btn, .mk-chip { transition: none; } .mk-typing i { animation: none; } .mk-scroll { scroll-behavior: auto; } }
