/* CreA Studio — app del celular: negro, blanco y el azul de CreA */
@font-face { font-family: "Inter"; src: url("Inter-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --blue: #0011ff;
  --blue-hi: #3341ff;
  --bay: #0e0e0f;
  --panel: #141415;
  --raise: #1b1b1d;
  --raise-2: #232325;
  --line: #2b2b2e;
  --text: #f2f2f2;
  --mute: #9a9a9f;
  --dim: #636367;
  --ok: #4fb487;
  --warn: #e9b44c;
  --bad: #ff5a55;
  --r: 14px;
  --sans: -apple-system, "SF Pro Text", "Inter", system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bay); color: var(--text); font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mute { color: var(--mute); }
.small { font-size: 14px; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: var(--top); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* entrar */
.login { justify-content: center; align-items: center; padding: calc(var(--top) + 24px) 24px calc(var(--bottom) + 24px); }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login-mark { width: 54px; height: 54px; padding: 12px; border-radius: 16px; background: var(--blue); }
.login h1 { font-size: 26px; margin: 16px 0 6px; letter-spacing: -0.01em; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
input, textarea { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; width: 100%; font-size: 16px; }
input:focus, textarea:focus { border-color: var(--blue-hi); }
#code { text-align: center; letter-spacing: .3em; font-size: 22px; font-variant-numeric: tabular-nums; }
.primary { background: var(--blue); color: #fff; border-radius: 12px; padding: 13px 16px; font-weight: 600; }
.primary:active { background: var(--blue-hi); }
.primary:disabled { opacity: .5; }
.primary.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; white-space: nowrap; }
.link { color: var(--mute); font-size: 14px; padding: 8px; }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; }

/* barra */
.bar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); background: var(--bay); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.brand img { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--blue); }
.icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text); flex-shrink: 0; }
.icon:active { background: var(--raise); }
#menuBtn svg { fill: currentColor; stroke: none; }
.mac { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.mac i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.mac.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(79,180,135,.18); }
.title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.title small { color: var(--mute); font-size: 12px; }
.stop { color: var(--bad); }
.stop svg { fill: currentColor; stroke: none; }

.hint { margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--r); background: var(--raise); font-size: 14px; color: var(--mute); display: flex; gap: 10px; align-items: center; }
.hint span { flex: 1; }

/* lista de chats */
#chats { padding: 8px 0 calc(var(--bottom) + 96px); }
.chat-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-bottom: 1px solid #1a1a1c; }
.chat-row:active { background: var(--panel); }
.chat-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.chat-row .dot.working { background: var(--blue-hi); animation: pulse 1.4s infinite; }
.chat-row .dot.waiting { background: var(--warn); }
.chat-row .t { flex: 1; min-width: 0; }
.chat-row .t b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .t small { color: var(--mute); font-size: 13px; }
@keyframes pulse { 50% { opacity: .35; } }
.empty { text-align: center; color: var(--mute); padding: 48px 24px; font-size: 15px; }
.fab { position: fixed; right: 16px; bottom: calc(var(--bottom) + 18px); display: flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; padding: 13px 18px 13px 14px; border-radius: 999px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,17,255,.35); }

/* mensajes */
.msgs { padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.b { max-width: 86%; padding: 10px 13px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; font-size: 15.5px; user-select: text; -webkit-user-select: text; }
.b.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.b.it { align-self: flex-start; background: var(--raise); border-bottom-left-radius: 6px; }
.b .files { font-size: 13px; opacity: .8; margin-top: 4px; }
.b img.thumb { display: block; max-width: 100%; border-radius: 10px; margin-bottom: 4px; }
.sys { align-self: center; font-size: 13px; color: var(--mute); text-align: center; padding: 2px 12px; max-width: 92%; }
.sys.bad { color: var(--bad); }
.sys.past { opacity: .6; }
.sep { align-self: center; font-size: 12px; color: var(--dim); margin: 6px 0; }
.card { align-self: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; display: flex; flex-direction: column; gap: 10px; }
.card .h { font-weight: 600; }
.card code { font: 13px ui-monospace, Menlo, monospace; color: var(--mute); white-space: pre-wrap; word-break: break-word; background: var(--bay); padding: 8px 10px; border-radius: 8px; max-height: 140px; overflow: auto; }
.card .need { background: rgba(0,17,255,.12); border-radius: 10px; padding: 9px 11px; font-size: 14.5px; }
.card .where { font-size: 13px; color: var(--mute); white-space: pre-line; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--raise-2); border-radius: 999px; padding: 9px 14px; font-size: 14.5px; font-weight: 550; }
.chip:active { background: var(--line); }
.chip.yes { background: var(--blue); color: #fff; }
.chip.no { color: var(--bad); }
.chip.on { outline: 2px solid var(--blue-hi); }
.card.done .btns { display: none; }
.card .state { font-size: 13px; color: var(--mute); }
.card .full { white-space: pre-wrap; font-size: 14.5px; color: var(--text); user-select: text; -webkit-user-select: text; }
.q + .q { border-top: 1px solid var(--line); padding-top: 10px; }
.q p { margin: 0 0 8px; }
video { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; }
.typing { align-self: flex-start; color: var(--mute); font-size: 14px; display: flex; gap: 6px; align-items: center; padding: 4px 6px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-hi); animation: pulse 1.2s infinite; }

/* escribir */
.pending { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px 0; border-top: 1px solid var(--line); }
.pending .pf { position: relative; flex-shrink: 0; width: 64px; height: 64px; border-radius: 10px; background: var(--raise) center/cover; display: grid; place-items: center; font-size: 11px; color: var(--mute); }
.pending .pf button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--raise-2); font-size: 14px; line-height: 22px; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 8px calc(var(--bottom) + 8px); border-top: 1px solid var(--line); background: var(--bay); }
.pending:not([hidden]) + .composer { border-top: 0; }
.composer textarea { flex: 1; resize: none; max-height: 140px; padding: 10px 14px; border-radius: 20px; line-height: 1.35; }
.send { background: var(--blue); color: #fff; border-radius: 50%; }
.mic.rec { background: var(--bad); color: #fff; border-radius: 50%; animation: pulse 1.2s infinite; }

/* hoja de opciones */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 10; }
.sheet .in { width: 100%; background: var(--panel); border-radius: 18px 18px 0 0; padding: 10px 8px calc(var(--bottom) + 12px); }
.sheet button { display: block; width: 100%; text-align: left; padding: 15px 16px; border-radius: 12px; font-size: 16px; }
.sheet button:active { background: var(--raise); }
.sheet .who { padding: 10px 16px; color: var(--mute); font-size: 13px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom) + 90px); background: var(--raise-2); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; max-width: 90%; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
