/* mando · tokens AA (mismos que dashboard/styles.css); objetivos >= 44 px; foco visible; sin estilos inline. */
:root { --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #9da7b3; --line: #30363d; --bad: #ff7b72;
        --ok: #3fb950; --focus: #ffd33d; --brand: #1f6feb; --brand-accent: #f2cc60; --on-brand: #ffffff; color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .tabs/.actions con display propio no deben ganar a hidden */
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 "Avenir Next", "Segoe UI", sans-serif; }
body { min-height: 100vh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 8px; top: 8px; z-index: 50; background: var(--card); padding: 8px 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.app-name { font-size: 1.1rem; }
.net { margin-left: auto; color: var(--brand-accent); font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: transparent; border: 0; border-radius: 0; border-bottom: 3px solid transparent; color: var(--muted); }
.tabs button[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
main { padding: 14px; max-width: 720px; margin: 0 auto; }
main:focus { outline: none; }
h1 { font-size: 1.35rem; margin: 6px 0 8px; } h2 { font-size: 1.1rem; margin: 10px 0 6px; }
h1:focus, h2:focus { outline: none; } h1:focus-visible, h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, .file-btn { min-height: 44px; min-width: 44px; padding: 10px 16px; font: inherit; font-weight: 600; border-radius: 10px;
         background: var(--card); color: var(--text); border: 2px solid var(--line); cursor: pointer; }
button.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
button.danger { border-color: var(--bad); color: var(--bad); }
button[disabled] { opacity: .6; cursor: not-allowed; }
.icon-btn { padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
textarea, input[type="text"] { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--bg);
           border: 2px solid var(--line); border-radius: 8px; }
[aria-invalid="true"] { border-color: var(--bad); }
label { display: block; font-weight: 600; margin: 8px 0 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.err, .alert { color: var(--bad); font-weight: 600; }
.alert { margin: 8px 14px; }
.muted { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { button, textarea, input { border: 2px solid CanvasText; } }
/* MANDO-07: hilo */
.thread { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; max-width: 92%; }
.msg.me { justify-self: end; border-color: var(--brand); }
.msg.pending { border-style: dashed; }
.msg.failed { border-color: var(--bad); }
.msg .who { margin: 0; color: var(--muted); font-size: .9rem; }
.msg .text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.att img, .att video { max-width: 100%; border-radius: 8px; margin-top: 6px; }
.att audio { width: 100%; margin-top: 6px; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.file-btn { display: inline-flex; align-items: center; margin: 0; }
input[type="file"]:focus-visible + .file-btn, .file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
#voice-btn[aria-pressed="true"] { border-color: var(--bad); color: var(--bad); }
/* MANDO-08: tarjetas de decisión */
.decision { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.decision .amount { font-size: 1.4rem; font-weight: 700; margin: 0; }
.decision .stepup { color: var(--brand-accent); font-weight: 600; }
.decision .actions button { flex: 1 1 8rem; }   /* en 360 px los botones no quedan desparejados */
.decision .payload { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0; }
.decision .payload dt { color: var(--muted); } .decision .payload dd { margin: 0; overflow-wrap: anywhere; }
.decision.approved { border-left-color: var(--ok); } .decision.rejected { border-left-color: var(--bad); }

/* ATLAS · panel de instrumentos: tinta oscura, un acento (el de la marca), línea en vez de sombra.
   El dock va en el flujo, debajo de un main que hace scroll: no tapa la cola ni el compositor. */
body.in-app {
  height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  padding-bottom: 0;
}
body.in-app main { order: 1; flex: 1 1 auto; min-height: 0; overflow: auto; padding-bottom: 16px; }
body.in-app .composer { bottom: 0; }
.dock {
  order: 2; position: static; z-index: 20; display: flex; flex: none; gap: 0; margin: 0;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line);
}
@media (min-width: 760px) {
  body.in-app .dock { width: min(720px, 100%); margin-inline: auto; }
}
.dock button {
  flex: 1 1 0; min-width: 44px; min-height: 44px; margin: 0; padding: 8px 2px;
  border: 0; border-radius: 0; border-top: 2px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1.15;
}
.dock button[aria-current="page"] { color: var(--text); border-top-color: var(--brand); }
.glance { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; column-gap: 16px; margin: 8px 0 16px; border-top: 1px solid var(--line); }
.glance dt, .glance dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.glance dt { color: var(--muted); font-weight: 600; }
.glance dd { font-variant-numeric: tabular-nums; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.palette button { border-radius: 2px; text-align: left; }
.palette button[aria-pressed="true"] { border-color: var(--brand); }
.queue { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.queue li { border: 1px solid var(--line); border-radius: 2px; padding: 8px 10px; }
.queue li p { margin: 0; }
.queue li .muted { margin-top: 2px; }
.queue li.failed { border-color: var(--bad); }
.sheet-back {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .72); padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.sheet-back.is-motion { animation: sheet-in 160ms ease; }
@keyframes sheet-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(100%, 32rem); background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 2px; padding: 16px;
}
.sheet h2 { margin-top: 0; }
.voice-lead { color: var(--muted); margin-top: 0; overflow-wrap: break-word; }
.voice-stage { display: grid; justify-items: center; gap: 12px; margin: 18px 0 8px; }
.voice-orb {
  width: 11rem; height: 11rem; border-radius: 50%; border: 2px solid var(--line); background: var(--card);
}
.voice-orb[data-state="listening"],
.voice-orb[data-state="thinking"],
.voice-orb[data-state="speaking"] { border-color: var(--brand); }
.voice-orb[data-state="speaking"] { background: var(--brand); }
.voice-orb[data-state="interrupted"] { border-color: var(--bad); }
.voice-orb.is-motion[data-state="listening"] { animation: voice-breathe 2.4s ease-in-out infinite; }
.voice-orb.is-motion[data-state="speaking"] { animation: voice-breathe 2.4s ease-in-out infinite; }
.voice-orb.is-motion[data-state="thinking"] { animation: voice-wait 1.2s ease-in-out infinite; }
@keyframes voice-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes voice-wait { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
#voice-state { margin: 0; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; }
#voice-captions { min-height: 3.2rem; margin: 8px 0; text-align: center; font-size: 1.2rem; overflow-wrap: break-word; }
#voice-note { text-align: center; min-height: 1.4rem; }
#voice-ptt { flex: 1 1 100%; }
