/* Painel de Sessões AXIOM. Tokens de cor e fonte de /srv/axiom-tarefas/app/static/style.css */
:root {
  --bg: #f4f5f1; --surface: #ffffff; --surface-2: #f9faf6; --ink: #111311; --muted: #5d615b;
  --line: #dbdcd8; --line-strong: #838483; --accent: #c6f135; --accent-soft: #effbc6; --accent-ink: #4d6100;
  --verde: #2f8a3e; --amarelo: #c98a00; --vermelho: #b3301a; --cinza: #9a9d97;
  --radius: 16px; --shadow: 0 1px 2px rgba(17,19,17,.06), 0 6px 20px rgba(17,19,17,.06);
  --f-display: "Bricolage Grotesque", system-ui, sans-serif; --f-body: "Bricolage Grotesque", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  /* áreas seguras do iPhone (entalhe, barra de início). Variáveis para o verificador conseguir simular. */
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
:root[data-theme="dark"] {
  --bg: #0e100e; --surface: #181b18; --surface-2: #1f231f; --ink: #f1f3ec; --muted: #a4a8a0;
  --line: #2c302c; --line-strong: #6b706a; --accent-soft: #2b3510; --accent-ink: #c6f135;
  --verde: #5ccf6c; --amarelo: #f0b733; --vermelho: #ff7a5c; --cinza: #6b706a;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
a, button, summary, label, select, input[type=checkbox] { touch-action: manipulation; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  padding-bottom: calc(40px + var(--sab)); }
a { color: inherit; }
h1 { font-family: var(--f-display); font-size: 1.6rem; font-weight: 800; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal)); }
main.wrap { padding-top: 18px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .num { font-variant-numeric: tabular-nums; }

.topo { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: var(--sat); }
.topo .wrap { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.topo form { margin: 0; } .topo .esp { flex: 1; }
.topo-nome { font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; background: var(--accent);
  color: #111311; border-radius: 999px; padding: 3px 10px; }
.logo img { height: 22px; display: block; } .logo .escuro { display: none; }
:root[data-theme="dark"] .logo .claro { display: none; } :root[data-theme="dark"] .logo .escuro { display: block; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; font-size: 1.05rem; text-decoration: none; font-family: inherit; }
/* volta ao AXIOM 360 (login único): discreto, do tamanho de um botão de ícone */
.voltar-360 { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3em; height: 44px; padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--line); color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .04em; line-height: 1;
  text-decoration: none; white-space: nowrap; }
.voltar-360:hover { color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 719px) {
  /* celular: bloco estreito de 2 linhas; o espaço menor no topo evita espremer os botões a 390 px */
  .voltar-360 { flex-direction: column; justify-content: center; gap: 2px; width: 34px; padding: 0; font-size: .5rem; letter-spacing: 0; }
  .voltar-360 span + span { font-size: .72rem; }
  .topo .wrap:has(.voltar-360) { gap: 4px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.caixa { max-width: 420px; margin: 32px auto 0; } .caixa > * + * { margin-top: 12px; }
.codigo { font-family: var(--f-display); font-size: 3rem; font-weight: 800; line-height: 1; margin: 0; color: var(--accent-ink); }
.form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
label.linha { display: flex; align-items: center; gap: 8px; }
input, select { max-width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 10px 12px; min-height: 46px; width: 100%; min-width: 0; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: #7a9a00; }
input:focus-visible, select:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent-ink); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.full { width: 100%; background: var(--accent); color: #111311; border-color: var(--accent); }
.btn.mini { min-height: 40px; padding: 6px 12px; font-size: .82rem; background: var(--surface); color: var(--ink); border-color: var(--line-strong); white-space: nowrap; }
.btn.mini.on { background: var(--accent); color: #111311; border-color: var(--accent); }
.aviso { background: color-mix(in srgb, var(--amarelo) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amarelo) 45%, transparent);
  border-radius: 12px; padding: 10px 12px; font-weight: 600; margin: 0; }
.vazio { text-align: center; padding: 18px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; }

.secao-tit { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.secao-tit .conta { color: var(--muted); font-weight: 600; font-size: .9rem; }
.filtros { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 720px) { .filtros { grid-template-columns: 2fr 1fr 1fr auto; } }
.item { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.item + .item { margin-top: 8px; } .item form { margin: 0; flex: 0 0 auto; }
.item-corpo { flex: 1; min-width: 0; text-decoration: none; display: block; }
.item-tit { font-weight: 650; display: block; overflow-wrap: anywhere; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 0; }
.tag { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 2px 7px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.tag.axiom { background: var(--accent); color: #111311; border-color: transparent; }
.tag.est-ativa { background: color-mix(in srgb, var(--verde) 14%, var(--surface)); color: var(--verde); border-color: color-mix(in srgb, var(--verde) 40%, transparent); }
.tag.est-esperando { background: color-mix(in srgb, var(--amarelo) 14%, var(--surface)); color: var(--amarelo); border-color: color-mix(in srgb, var(--amarelo) 40%, transparent); }
.paginas { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }

.sessao-tit { margin-top: 8px; overflow-wrap: anywhere; }
.marcar { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 720px) { .marcar { grid-template-columns: auto 1fr auto; align-items: end; } }
#mensagens { margin-top: 18px; }
.msg { margin-top: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
section.msg { padding: 12px 14px; }
.msg.usuario { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-ink) 25%, transparent); }
.quem { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.bloco { background: var(--surface-2); font-size: .9rem; }
.bloco summary { cursor: pointer; padding: 10px 14px; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bloco.ferramenta { border-left: 4px solid var(--accent); }
.bloco .txt { padding: 0 14px 12px; color: var(--muted); }
pre { margin: 0; padding: 0 14px 12px; font-family: var(--f-mono); font-size: .8rem; line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
@media (prefers-reduced-motion: no-preference) { .btn, .icon-btn { transition: transform .12s; } .btn:active, .icon-btn:active { transform: scale(.97); } }

/* abas, kanban, projetos */
.abas { border-top: 1px solid var(--line); }
.abas .wrap { display: flex; gap: 4px; overflow-x: auto; padding-top: 6px; padding-bottom: 6px; scrollbar-width: none; }
.abas a { flex: 0 0 auto; text-decoration: none; font-weight: 700; font-size: .88rem; padding: 8px 12px; border-radius: 10px; color: var(--muted); }
.abas a.on { background: var(--ink); color: var(--bg); }
.abas a.nova { margin-left: auto; background: var(--accent); color: #111311; }
.tag.proj { background: var(--ink); color: var(--bg); border-color: transparent; text-decoration: none; }
.kanban { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .kanban { grid-template-columns: repeat(3, 1fr); align-items: start; } .wrap:has(.kanban) { max-width: 1280px; } }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.kcol h2 { display: flex; justify-content: space-between; align-items: baseline; }
.kcol h2 .conta { color: var(--muted); font-size: .9rem; }
.k-ativa { border-top: 4px solid var(--verde); } .k-esperando { border-top: 4px solid var(--amarelo); } .k-parada { border-top: 4px solid var(--cinza); }
.kcard { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.kcard:hover { border-color: var(--line-strong); }
.projetos { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 860px) { .projetos { grid-template-columns: 1fr 1fr; align-items: start; } }
.pcard .ptit { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-decoration: none; }
.pcard .ptit .conta { color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.form-bloco { display: grid; gap: 12px; margin-top: 14px; }
.form-bloco label { display: grid; gap: 4px; font-weight: 650; }
.form-bloco label.linha { display: flex; font-weight: 500; }
.form-bloco fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; margin: 0; }
.form-bloco legend { font-weight: 650; padding: 0 4px; }
textarea { width: 100%; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; resize: vertical; }
.item.sel { cursor: pointer; } .item.sel input { width: 22px; height: 22px; flex: 0 0 auto; }
.lista-k { margin: 12px 0; }
.erro { color: var(--vermelho); font-weight: 650; }

/* tela da sessão em formato de conversa */
body.pg-chat { padding-bottom: 0; overflow: hidden; overscroll-behavior: none; }
body.pg-chat main.wrap { padding: 0; max-width: none; }
.chat { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  max-width: 860px; margin: 0 auto; background: var(--bg); }
@media (min-width: 880px) { .chat { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.chat-topo { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--sat)) calc(10px + var(--sar)) 8px calc(10px + var(--sal));
  border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-id { flex: 1; min-width: 0; }
.chat-tit { font-size: 1.02rem; font-weight: 750; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { margin: 3px 0 0; display: flex; gap: 6px; align-items: center; font-size: .75rem; white-space: nowrap; overflow: hidden; }
.chat-info { flex: 0 0 auto; max-height: 55%; overflow: auto; padding: 10px 14px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-info .marcar { margin-top: 10px; }
.chat-rolo { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 10px 10px 14px; outline: none; }
#mensagens, #pendentes { display: flex; flex-direction: column; gap: 6px; margin: 0; }
#pendentes:not(:empty) { margin-top: 6px; }
.chat-aviso { text-align: center; color: var(--muted); font-size: .85rem; margin: 6px 0 10px; }
.dia { display: flex; justify-content: center; margin: 8px 0 4px; }
.dia span { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px; box-shadow: var(--shadow); }
.bolha { max-width: 88%; padding: 8px 12px 5px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 1px 1px rgba(17,19,17,.05); font-size: 1rem; line-height: 1.42; min-width: 72px; }
@media (min-width: 720px) { .bolha { max-width: 76%; } }
.bolha.assistente { align-self: flex-start; border-bottom-left-radius: 5px; }
.bolha.usuario { align-self: flex-end; border-bottom-right-radius: 5px; background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.bolha + .bolha.usuario, .bolha.usuario + .bolha.assistente, .passos + .bolha.usuario { margin-top: 6px; }
.bolha .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.bolha footer { display: flex; justify-content: flex-end; gap: 8px; font-size: .68rem; color: var(--muted); margin-top: 2px; min-height: 1em; }
.bolha.pendente { opacity: .65; }
.bolha a { color: var(--accent-ink); font-weight: 600; overflow-wrap: anywhere; }
.md code { font-family: var(--f-mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 4px; }
.md pre.cod { padding: 8px 10px; margin: 4px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; max-height: 360px; }
.md pre.tab { white-space: pre; overflow-x: auto; overflow-wrap: normal; }
.contexto { margin-top: 6px; font-size: .85rem; border-top: 1px dashed color-mix(in srgb, var(--accent-ink) 30%, transparent); }
.contexto summary { cursor: pointer; padding: 6px 0; font-weight: 650; color: var(--muted); min-height: 32px; }
.contexto .txt { color: var(--muted); padding-bottom: 4px; }
.passos { align-self: flex-start; max-width: 100%; min-width: 0; font-size: .82rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.passos[open] { align-self: stretch; }
.passos > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 36px;
  font-weight: 650; color: var(--muted); }
.passos > summary::-webkit-details-marker { display: none; }
.passos > summary .res { white-space: nowrap; flex: 0 0 auto; }
.passos > summary .muted { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.passos > summary::after { content: "›"; margin-left: 2px; font-size: 1.1rem; line-height: 1; }
.passos[open] > summary::after { content: "⌄"; }
.passos .bloco { border-top: 1px solid var(--line); background: none; font-size: .86rem; }
.passos .bloco summary { min-height: 40px; padding: 8px 12px; }
.passos pre, .passos .bloco .txt { padding: 0 12px 10px; max-height: 420px; }
.digitando { display: inline-flex; gap: 5px; align-items: center; padding: 13px 14px; min-width: 0; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
@media (prefers-reduced-motion: no-preference) {
  .digitando i { animation: pisca 1.2s infinite ease-in-out; } .digitando i:nth-child(2) { animation-delay: .18s; } .digitando i:nth-child(3) { animation-delay: .36s; }
  @keyframes pisca { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
}
.descer { position: absolute; right: 14px; bottom: calc(84px + var(--sab)); width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 1.15rem; box-shadow: var(--shadow); cursor: pointer; z-index: 3; }
.descer.novo { background: var(--accent); color: #111311; border-color: var(--accent); }
.chat-erro { flex: 0 0 auto; margin: 0; padding: 8px 14px; font-size: .88rem; font-weight: 650;
  background: color-mix(in srgb, var(--amarelo) 16%, var(--surface)); border-top: 1px solid color-mix(in srgb, var(--amarelo) 45%, transparent); }
.compor { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 8px calc(10px + var(--sar)) calc(8px + var(--sab)) calc(10px + var(--sal));
  background: var(--surface); border-top: 1px solid var(--line); }
.compor textarea { flex: 1; min-width: 0; font-size: 16px; line-height: 1.35; min-height: 46px; max-height: 140px; resize: none; border-radius: 23px;
  padding: 11px 16px; overflow-y: auto; }
.compor textarea:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.enviar { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #111311; font-size: 1.1rem;
  cursor: pointer; display: grid; place-items: center; }
.enviar:disabled { opacity: .5; cursor: default; }
.chat-leitura { flex: 0 0 auto; margin: 0; text-align: center; font-size: .82rem; color: var(--muted); background: var(--surface);
  border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--sab)); }

/* aplicativo no celular: abas viram barra fixa embaixo, como em app nativo */
.abas a i { display: none; font-style: normal; }
.abas a b { font-weight: inherit; }
.chat.teclado .compor { padding-bottom: 8px; } .chat.teclado .chat-leitura { padding-bottom: 10px; }
.chat.teclado .descer { bottom: 84px; }
@media (max-width: 719px) {
  body { padding-bottom: calc(76px + var(--sab)); }
  body.pg-chat { padding-bottom: 0; }
  .abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-top: 1px solid var(--line); background: var(--surface);
    padding-bottom: var(--sab); }
  .abas .wrap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; overflow: visible;
    padding: 4px calc(4px + var(--sar)) 4px calc(4px + var(--sal)); max-width: 560px; }
  .abas a, .abas a.nova { margin: 0; min-width: 0; min-height: 52px; padding: 5px 2px 4px; border-radius: 12px; background: none; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: .68rem; font-weight: 700; line-height: 1.15; }
  .abas a i { display: block; font-size: 1.25rem; line-height: 1.1; }
  .abas a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .abas a.on, .abas a.nova.on { background: none; color: var(--ink); }
  .abas a.on i { background: var(--accent); color: #111311; border-radius: 999px; padding: 0 14px; }
  .abas .so-largo { display: none; }
  /* sem desfoque aqui: o desfoque prenderia a barra fixa dentro do topo */
  .topo { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .topo .wrap { min-height: 52px; }
  h1 { font-size: 1.45rem; }
  .kcol h2 { font-size: 1.15rem; margin: 2px 0 4px; } .kcol > p { margin: 0 0 6px; font-size: .85rem; }
}

/* áudio na barra de resposta */
.mic { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  font-size: 1.15rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.compor [hidden] { display: none !important; }
.gravando { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.grav-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 23px;
  background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 1rem; white-space: nowrap; overflow: hidden; }
.grav-info i { width: 10px; height: 10px; border-radius: 50%; background: var(--vermelho); flex: 0 0 auto; }
.gravando.espera .grav-info i { background: var(--amarelo); }
@media (prefers-reduced-motion: no-preference) { .grav-info i { animation: pisca 1.2s infinite ease-in-out; } }
