/* Miralo Chat — Modernist adaptado a oscuro + naranja. Cero border-radius. */
:root {
  --bg: #141210; --panel: #1a1815; --panel-h: #221e19; --hollow: #17150f;
  --text: #f2ede4; --muted: rgba(242,237,228,.5); --line: rgba(242,237,228,.25);
  --accent: #ff7a3d; --accent-h: #ffb27a; --accent-p: #d8480c;
  --warn: #ffb000; --ok: #7dc97d; --err: #ff5c5c; --blue: #4f9dff; --dark: #141210;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Archivo', system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
::selection { background: rgba(255,122,61,.35); }
input, button, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1,h2,h3,h4 { font-weight: 800; letter-spacing: -.015em; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.h6 { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); }

.btn { background: var(--accent); color: var(--dark); border: none; font-weight: 800; font-size: 15px;
  letter-spacing: .03em; padding: 13px 16px; text-align: left; cursor: pointer; white-space: nowrap; display: inline-block; }
.btn:hover { background: var(--accent-h); } .btn:active { background: var(--accent-p); }
.btn[disabled] { background: rgba(242,237,228,.2); cursor: default; }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: rgba(255,122,61,.12); }
.btn-dark { background: var(--dark); color: var(--text); }
.btn-dark:hover { background: #2b2620; }

.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { background: transparent; color: var(--muted); border: none; font-weight: 800; font-size: 11.5px;
  letter-spacing: .05em; padding: 10px 12px; cursor: pointer; }
.seg button:hover { color: var(--accent); }
.seg button.on { background: var(--accent); color: var(--dark); }

.rule { border-bottom: 2px solid var(--line); }
.grid-cells { display: grid; gap: 2px; background: var(--line); border: 2px solid var(--line); }
.cell { background: var(--panel); padding: 18px; }
.cell:hover { background: var(--panel-h); }

.badge-ia { background: rgba(255,122,61,.15); color: var(--accent); font-size: 10px; font-weight: 800;
  letter-spacing: .08em; padding: 1px 6px; white-space: nowrap; }
.dot { width: 7px; height: 7px; background: var(--accent); display: inline-block; animation: pulse 1.6s infinite; }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.chip-status { border: 1px solid; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 4px 8px; white-space: nowrap; }
.st-conectada { border-color: var(--ok); color: var(--ok); }
.st-sin_configurar, .st-limite { border-color: var(--warn); color: var(--warn); }
.st-apagada { border-color: var(--err); color: var(--err); }

.msg { display: flex; gap: 10px; padding: 8px 6px; align-items: flex-start; animation: rise .25s ease;
  border-left: 2px solid transparent; }
.msg:hover { background: rgba(255,122,61,.04); }
.msg.host { border-left-color: var(--accent); background: rgba(255,122,61,.06); }
.msg .av { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--panel-h); border: 1px solid rgba(242,237,228,.2); }
.msg .nick { font-weight: 800; font-size: 13.5px; }
.msg.mine .nick, .msg.host .nick { color: var(--accent); }
.msg .time { font-size: 11px; color: rgba(242,237,228,.35); }
.msg .body { font-size: 14.5px; line-height: 1.5; overflow-wrap: break-word; }
.msg-system { font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line); padding: 8px 12px; margin: 6px 0; }
.msg .report { visibility: hidden; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.msg:hover .report { visibility: visible; }

.input { width: 100%; background: var(--bg); border: 2px solid rgba(242,237,228,.35); color: var(--text);
  font-size: 16px; padding: 12px 14px; outline: none; }
.input:focus { border-color: var(--accent); }
.warn-text { color: var(--warn); font-size: 13px; }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center;
  justify-content: center; z-index: 60; padding: 20px; }
.modal { width: 100%; max-width: 440px; background: var(--panel); border: 2px solid rgba(242,237,228,.3); animation: rise .25s ease; }

/* Modo 90's */
body.retro { background: #080806; color: #cfc9ba; font-family: 'VT323', monospace; }
body.retro .msg .body, body.retro .input { font-size: 19px; }
body.retro .msg .nick { color: #8fd18f; }
body.retro .msg.host .nick, body.retro .msg.mine .nick { color: #ffb000; }
body.retro .btn { background: #ffb000; }
body.retro .dot, body.retro .cursor { color: #ffb000; background: #ffb000; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes dotwave { 0%,60%,100% { transform: none; opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Chat layout */
.chat-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.chat-main { flex: 1; display: flex; min-height: 0; }
.chat-side { width: 240px; flex: none; border-right: 2px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.chat-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 16px; }
.chat-compose { border-top: 2px solid var(--line); padding: 12px 16px; }
.room-row { padding: 10px 16px; cursor: pointer; display: block; color: var(--text); border-left: 3px solid transparent; }
.room-row:hover { background: rgba(255,122,61,.08); text-decoration: none; color: var(--text); }
.room-row.on { background: rgba(255,122,61,.12); border-left-color: var(--accent); }
@media (max-width: 760px) {
  .chat-side { display: none; }
  .btn { width: 100%; }
  .seg button { padding: 12px 10px; }
}
