@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600..900&family=DM+Sans:wght@400..700&display=swap');

:root {
  --navy: #0B1A3A; --navy2: #13285A; --navy3: #1B3A78;
  --ink: #1C2B4A; --muted: #4A5568; --muted2: #5B6884;
  --bg: #F4F7FB; --card: #FFFFFF; --line: #D5DEEA;
  --red: #E5352B; --orange: #F7931E; --yellow: #F5C518; --green: #4CB848; --cyan: #2DB8F0;
  --q-plan: #E3EEFA; --q-ja: #E6F4E4; --q-depois: #ECEFF3; --q-teste: #FDF6DC;
  --display: 'Montserrat', Arial, sans-serif;
  --body: 'DM Sans', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
body.dark { background: radial-gradient(ellipse at 85% 0%, #17336e 0%, var(--navy) 55%, #071230 100%) fixed; color: #F4F7FB; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* faixa de cores do evento */
.rainbow { display: flex; height: 8px; width: 220px; border-radius: 4px; overflow: hidden; }
.rainbow i { flex: 1; } .rainbow i:nth-child(1) { background: var(--red); } .rainbow i:nth-child(2) { background: var(--orange); }
.rainbow i:nth-child(3) { background: var(--yellow); } .rainbow i:nth-child(4) { background: var(--green); }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: #8A6D00; }
.dark .eyebrow { color: var(--yellow); }

/* ---------- formulários (celular e notebook) ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.page.wide { max-width: 1200px; }
.top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.top h1 { font-size: 28px; font-weight: 800; color: var(--navy); }
.top p { margin: 0; color: var(--muted); line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span, .label { font-weight: 700; font-size: 15px; color: var(--navy); }
.field small { color: var(--muted2); font-size: 13px; }
input[type=text], input[type=number], textarea, select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.4; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); }
.row { display: flex; gap: 12px; } .row > * { flex: 1; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip[aria-pressed=true] { border-color: var(--navy); background: var(--navy); color: #fff; }

.btn { border: 0; border-radius: 12px; padding: 14px 20px; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--navy); color: #fff; }
.btn.primary { background: var(--green); color: #0B1A3A; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: transparent; border: 1.5px solid #E7B4AF; color: #B12A21; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.msg { min-height: 22px; font-size: 15px; margin: 10px 0 0; }
.msg.err { color: #B12A21; } .msg.ok { color: #2E7D2A; font-weight: 700; }

/* mini-matriz do celular */
.mini { position: relative; aspect-ratio: 1 / 1; width: 100%; border-radius: 14px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; background: var(--line); touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.mini .q { display: flex; padding: 10px; font-family: var(--display); font-weight: 800; font-size: 14px; }
.q.plan { background: var(--q-plan); color: #0F6E99; } .q.ja { background: var(--q-ja); color: #2E7D2A; justify-content: flex-end; }
.q.depois { background: var(--q-depois); color: var(--muted2); align-items: flex-end; } .q.teste { background: var(--q-teste); color: #8A6D00; align-items: flex-end; justify-content: flex-end; }
.mini .pin { position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(11,26,58,.35); transform: translate(-50%, -50%); pointer-events: none; }
.axis { display: flex; justify-content: space-between; color: var(--muted2); font-size: 13px; font-weight: 600; margin-top: 6px; }

.mylist { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.myitem { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--cyan); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.myitem .t { flex: 1; min-width: 0; font-size: 15px; }
.myitem .t small { display: block; color: var(--muted2); font-size: 13px; margin-top: 2px; }
.success { background: var(--navy); color: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.success h2 { font-size: 22px; color: var(--green); }
.success p { margin: 0; color: #C9D8EE; }

/* ---------- canvas (notebook) ---------- */
.cv-head { display: grid; grid-template-columns: 260px 1fr 2fr; gap: 14px; margin-bottom: 14px; }
.cv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cell { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.cell.r1 { border-left: 6px solid var(--red); } .cell.r2 { border-left: 6px solid var(--orange); } .cell.r3 { border-left: 6px solid var(--green); }
.cell.dark-cell { background: var(--navy); color: #fff; border-left: 6px solid var(--cyan); }
.cell .label { font-size: 15px; } .cell.dark-cell .label { color: #fff; }
.cell .hint { font-size: 13px; color: var(--muted2); margin: -4px 0 0; } .cell.dark-cell .hint { color: #C9D8EE; }
.cell textarea { min-height: 96px; border-radius: 10px; font-size: 15px; }
.cell.dark-cell textarea, .cell.dark-cell input { background: var(--navy2); border-color: var(--navy3); color: #fff; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.level { border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 6px; font-size: 13px; font-weight: 700; cursor: pointer; text-align: center; }
.level[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }
.savebar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); margin-top: 8px; }
.savebar .status { flex: 1; color: var(--muted2); font-size: 14px; }
@media (max-width: 900px) { .cv-head, .cv-grid { grid-template-columns: 1fr; } }

/* ---------- telão: painel e mural ---------- */
.screen { height: 100vh; display: grid; grid-template-columns: 1fr 380px; gap: 28px; padding: 28px 32px; }
.screen header { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.screen header h1 { font-size: 34px; font-weight: 900; }
.live { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #8FA9CF; }
.live i { width: 10px; height: 10px; border-radius: 50%; background: #8FA9CF; }
.live.on i { background: var(--green); box-shadow: 0 0 0 4px rgba(76,184,72,.25); }
.main { display: flex; flex-direction: column; min-height: 0; }

.board { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; border-radius: 18px; overflow: hidden; }
.board .q { padding: 16px 20px; font-family: var(--display); font-weight: 900; font-size: 28px; display: flex; opacity: .95; }
.board .q small { display: block; font-family: var(--body); font-weight: 600; font-size: 14px; opacity: .8; margin-top: 4px; }
.board .q.ja, .board .q.teste { text-align: right; }
.yaxis, .xaxis { color: #C9D8EE; font-weight: 700; font-size: 15px; }
.xaxis { text-align: right; margin-top: 8px; }
.yaxis { margin-bottom: 8px; }
.layer { position: absolute; inset: 0; }
.tag { position: absolute; transform: translate(-50%, -50%); width: max-content; max-width: 220px; background: #fff; color: var(--ink); border-radius: 10px; border-left: 6px solid var(--cyan); padding: 8px 10px; font-size: 15px; line-height: 1.25; box-shadow: 0 6px 18px rgba(7,18,48,.28); cursor: pointer; transition: left .4s, top .4s; }
.tag b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; }
.tag small { display: block; color: var(--muted2); font-size: 12px; margin-top: 3px; }
.tag.pop { animation: pop .9s ease-out; }
.tag.dim { opacity: .15; }
.tag.dragging { transition: none; cursor: grabbing; z-index: 5; outline: 3px solid var(--yellow); }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 55% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; box-shadow: 0 0 0 10px rgba(245,197,24,.55); } 100% { transform: translate(-50%, -50%) scale(1); } }

aside.side { display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow: auto; }
.panel { background: var(--navy2); border-radius: 16px; padding: 18px 20px; }
.panel h2 { font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: #8FA9CF; margin-bottom: 12px; }
.qr { background: #fff; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--navy); }
.qr img { width: 100%; max-width: 230px; image-rendering: pixelated; }
.qr .url { font-family: var(--display); font-weight: 800; font-size: 18px; word-break: break-all; text-align: center; }
.qr .cta { font-weight: 700; font-size: 15px; color: var(--muted); }
.big { font-family: var(--display); font-size: 48px; font-weight: 900; line-height: 1; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend button { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: #F4F7FB; font-size: 16px; padding: 4px 0; cursor: pointer; text-align: left; }
.legend button .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.legend button .n { margin-left: auto; font-weight: 800; }
.legend button.off { opacity: .35; }
.rank { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: #C9D8EE; }
.rank b { color: #F4F7FB; font-weight: 600; }
.admin { border: 1.5px dashed var(--yellow); }
.admin .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.admin a, .admin button { font-size: 13px; font-weight: 700; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--navy3); background: var(--navy3); color: #fff; text-decoration: none; cursor: pointer; }
.admin p { margin: 8px 0 0; font-size: 13px; color: #C9D8EE; }

/* detalhe (overlay) */
.overlay { position: fixed; inset: 0; background: rgba(7,18,48,.72); display: flex; align-items: center; justify-content: center; padding: 32px; z-index: 50; }
.detail { background: #fff; color: var(--ink); border-radius: 18px; padding: 28px 32px; max-width: 640px; width: 100%; border-top: 10px solid var(--cyan); }
.detail h3 { font-size: 30px; margin: 6px 0 14px; color: var(--navy); line-height: 1.2; }
.detail p { margin: 6px 0; font-size: 18px; color: var(--muted); }
.detail .actions { display: flex; gap: 10px; margin-top: 18px; }

/* mural de canvas */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; overflow: auto; align-content: start; padding-bottom: 20px; }
.tile { background: #fff; color: var(--ink); border-radius: 16px; padding: 18px 20px; border-top: 8px solid var(--cyan); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.tile.pop { animation: tilepop .9s ease-out; }
@keyframes tilepop { 0% { transform: scale(.9); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
.tile .area { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted2); }
.tile h3 { font-size: 21px; color: var(--navy); line-height: 1.25; }
.tile .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.badge { display: inline-block; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--navy); color: #fff; }
.progress { height: 6px; background: var(--q-depois); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); }

.full { position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--ink); padding: 36px 48px; display: flex; flex-direction: column; gap: 18px; overflow: auto; }
.full .head { display: flex; align-items: flex-start; gap: 18px; }
.full .head h2 { font-size: 40px; font-weight: 900; color: var(--navy); line-height: 1.15; }
.full .head .close { margin-left: auto; display: flex; gap: 10px; flex: none; }
.full .head .close .btn { white-space: nowrap; }
.full .grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; flex: 1; }
.full .c { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.full .c h4 { margin: 0 0 8px; font-family: var(--display); font-size: 18px; color: var(--navy); }
.full .c p { margin: 0; font-size: 19px; line-height: 1.4; white-space: pre-wrap; color: var(--ink); }
.full .c p.empty { color: #B9C3D1; font-style: italic; }
.full .c.r1 { border-left: 6px solid var(--red); } .full .c.r2 { border-left: 6px solid var(--orange); } .full .c.r3 { border-left: 6px solid var(--green); }
.full .c.dk { background: var(--navy); border: 0; border-left: 6px solid var(--cyan); } .full .c.dk h4, .full .c.dk p { color: #fff; }
.empty-state { color: #8FA9CF; font-size: 20px; padding: 40px; text-align: center; }

/* página inicial */
.home { max-width: 980px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 28px; }
.home h1 { font-size: 44px; font-weight: 900; }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.links a { background: var(--navy2); border-radius: 16px; padding: 22px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; border-top: 6px solid var(--cyan); }
.links a b { font-family: var(--display); font-size: 20px; }
.links a span { color: #C9D8EE; font-size: 15px; line-height: 1.4; }

/* ---------- laboratório: entrar ---------- */
.quem { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 18px; font-size: 16px; }
.quem span { margin-right: auto; }
.link { background: none; border: 0; padding: 4px 0; color: var(--navy3); font-weight: 700; font-size: 14px; text-decoration: underline; cursor: pointer; }
.aviso { background: var(--q-teste); border: 1px solid #EAD68A; border-radius: 14px; padding: 16px 18px; }
.aviso b { font-family: var(--display); color: #8A6D00; }
.aviso p { margin: 6px 0 0; color: var(--muted); }
.nota { color: var(--muted2); font-size: 14px; margin: 6px 0 12px; }
.criar { margin-top: 26px; padding-top: 20px; border-top: 1.5px dashed var(--line); }
.success a.btn { text-align: center; text-decoration: none; }
#boxExercicio > .label { margin: 0 0 10px; }
#exercicioTitulo { display: inline-block; background: var(--navy); color: #fff; font-size: 14px; border-radius: 10px; padding: 8px 12px; }

/* ---------- laboratório: tela do grupo ---------- */
.lab-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.lab-top { background: var(--navy); color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex: none; }
.lab-id { min-width: 0; flex: 1; }
.lab-id .eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--yellow); margin: 0 0 4px; }
.lab-id h1 { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-membros { margin: 4px 0 0; color: #C9D8EE; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.ghost-dark { background: transparent; border: 1.5px solid var(--navy3); color: #fff; text-decoration: none; }
.lab-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #C9D8EE; padding: 6px 12px; border-radius: 999px; background: var(--navy2); }
.lab-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.lab-status.fila i { background: var(--yellow); }
.lab-status.executando i { background: var(--cyan); animation: pulsar 1.2s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: .3; } }

.lab-abas { display: none; }
.lab-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) 8px minmax(0, 1fr); overflow: hidden; }
.lab-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lab-arquivos { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 8px minmax(0, 1fr); min-height: 0; min-width: 0; background: var(--card); }
/* divisores arrastáveis entre os painéis (lab.js) */
.divisor { background: var(--line); position: relative; touch-action: none; transition: background .15s; }
.divisor::after { content: ""; position: absolute; border-radius: 2px; background: var(--muted2); opacity: .55; }
.divisor-v { cursor: col-resize; }
.divisor-v::after { width: 2px; height: 36px; top: 50%; left: 3px; margin-top: -18px; }
.divisor-h { cursor: row-resize; }
.divisor-h::after { height: 2px; width: 36px; left: 50%; top: 3px; margin-left: -18px; }
.divisor:hover, .divisor:focus-visible, .divisor.arrastando { background: var(--cyan); outline: none; }
body.redimensionando { user-select: none; }
body.redimensionando.col { cursor: col-resize; } body.redimensionando.lin { cursor: row-resize; }

.desafios { margin: 12px 16px 0; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--yellow); border-radius: 12px; padding: 10px 14px; flex: none; }
.desafios summary { font-weight: 700; color: var(--navy); cursor: pointer; }
.desafios ol { margin: 8px 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; line-height: 1.4; }

.conversa { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.vazio { color: var(--muted2); text-align: center; margin: auto; max-width: 320px; line-height: 1.5; }
.m { max-width: 92%; line-height: 1.45; font-size: 15px; }
.m .autor { font-size: 12px; font-weight: 700; color: var(--muted2); margin-bottom: 4px; }
.m.user { align-self: flex-end; background: var(--navy); color: #fff; border-radius: 14px 14px 4px 14px; padding: 10px 14px; }
.m.user .autor { color: #8FA9CF; }
.m.user .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.m.claude { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 14px; }
.m.claude.digitando .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.m.claude.digitando .autor::after { content: " está escrevendo…"; font-weight: 400; }
.m.ferr { align-self: flex-start; font-size: 13px; color: var(--muted2); display: flex; align-items: baseline; gap: 6px; padding: 0 6px; overflow-wrap: anywhere; }
.m.ferr code { background: var(--q-depois); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; color: var(--ink); }
.m.ferr.negado { color: #B12A21; font-weight: 600; }
.m.ferr.negado code { background: #FBE3E1; }
.m.sis { align-self: center; font-size: 13px; color: #8A6D00; background: var(--q-teste); border-radius: 999px; padding: 5px 14px; text-align: center; }

.aviso-chat { margin: 0 16px 8px; background: var(--q-teste); border: 1px solid #EAD68A; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--ink); flex: none; }
.aviso-chat span { flex: 1; min-width: 180px; }
.aviso-chat .btn { text-decoration: none; }
.composer { padding: 10px 16px 12px; background: var(--card); border-top: 1px solid var(--line); flex: none; }
.atalhos { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.atalhos .chip { flex: none; font-size: 13px; padding: 7px 12px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atalhos .chip:disabled { opacity: .5; cursor: default; }
.composer textarea { min-height: 64px; max-height: 30vh; font-size: 15px; }
.composer-pe { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer-pe small { flex: 1; color: var(--muted2); font-size: 13px; }
.composer .msg { margin: 6px 0 0; min-height: 0; }

.arvore-box { overflow-y: auto; padding: 12px 16px; min-height: 64px; max-height: 40vh; }
.arvore-box .label { margin: 0 0 8px; }
.arvore { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.arvore li { display: flex; align-items: center; }
.arvore li.dir { gap: 6px; font-weight: 700; color: var(--navy); padding-top: 4px; padding-bottom: 4px; }
.arvore li.arq button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 6px; border-radius: 8px; cursor: pointer; text-align: left; }
.arvore li.arq button:hover { background: var(--bg); }
.arvore li.arq.sel button { background: var(--q-plan); }
.arvore li.arq .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arvore li.arq small { color: var(--muted2); font-size: 12px; flex: none; }
.arvore li.mudou button { animation: mudou 2.5s ease-out; }
@keyframes mudou { 0%, 40% { background: #FFF1B8; } 100% { background: transparent; } }
.arvore .ic { font-size: 13px; }

.visor { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.visor-cab { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.visor-cab b { font-family: var(--display); color: var(--navy); overflow-wrap: anywhere; }
.visor-cab small { color: var(--muted2); font-size: 12px; flex: 1; }
.visor-corpo { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 24px; }
pre.fonte { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }

/* Markdown renderizado (chat e visor) */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .md-tabela { margin: 0 0 10px; }
.md h2, .md h3, .md h4, .md h5, .md h6 { color: var(--navy); margin: 14px 0 8px; }
.md h2 { font-size: 20px; } .md h3 { font-size: 17px; } .md h4, .md h5, .md h6 { font-size: 15px; }
.md ul, .md ol { padding-left: 22px; } .md li { margin: 3px 0; }
.md code { background: var(--q-depois); border-radius: 5px; padding: 1px 5px; font-size: .92em; }
.md pre { background: var(--navy); color: #E6EEF8; border-radius: 10px; padding: 10px 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: inherit; white-space: pre; }
.md pre.md-front { background: var(--q-plan); color: var(--ink); border-left: 4px solid var(--cyan); }
.md blockquote { border-left: 4px solid var(--line); padding-left: 12px; color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md .md-tabela { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--bg); color: var(--navy); }

@media (max-width: 900px) {
  .lab-top { padding: 10px 14px; flex-wrap: wrap; }
  .lab-id h1 { font-size: 19px; }
  .lab-acoes { width: 100%; justify-content: flex-start; }
  .lab-abas { display: flex; background: var(--navy2); flex: none; }
  .lab-abas .aba { flex: 1; border: 0; background: transparent; color: #C9D8EE; font-weight: 700; padding: 10px; cursor: pointer; border-bottom: 3px solid transparent; }
  .lab-abas .aba[aria-pressed=true] { color: #fff; border-bottom-color: var(--yellow); }
  .lab-main { grid-template-columns: minmax(0, 1fr) !important; }
  .divisor-v { display: none; }
  .lab-arquivos { display: none; }
  .ver-arquivos .lab-chat { display: none; }
  .ver-arquivos .lab-arquivos { display: grid; }
  .m { max-width: 100%; }
}

/* ---------- laboratório: facilitador ---------- */
.adm-links { font-weight: 600; }
.adm-links a { color: var(--navy3); }
.adm-bloco { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; }
.adm-bloco h2 { font-size: 18px; color: var(--navy); }
.adm-linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.adm-linha select, .adm-linha input { width: auto; flex: 1; min-width: 200px; }
.adm-resumo { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.adm-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-cab select { width: auto; min-width: 260px; }
.adm-cab .btn { margin-left: auto; }
.adm-grupos { display: flex; flex-direction: column; gap: 10px; }
.adm-grupo { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-left: 6px solid var(--cyan); border-radius: 12px; padding: 12px 14px; }
.adm-g-info, .adm-g-uso { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adm-g-info b { font-size: 16px; color: var(--navy); }
.adm-grupo small { color: var(--muted2); font-size: 13px; overflow-wrap: anywhere; }
.adm-g-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.adm-g-btns a { text-decoration: none; }
.adm-st { font-size: 13px; font-weight: 800; color: #2E7D2A; }
.adm-st.fila { color: #8A6D00; } .adm-st.executando { color: #0F6E99; }
.adm-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--line); }
.adm-form small { color: var(--muted2); font-size: 13px; }
.adm-form .label { margin: 0 0 4px; }
.adm-canvas { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; margin: 14px 0 4px; }
.adm-canvas button.myitem { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.adm-canvas button.myitem:hover { background: var(--bg); }
@media (max-width: 900px) { .adm-grupo, .adm-acoes { grid-template-columns: 1fr; } .adm-g-btns { justify-content: flex-start; } }

/* ---------- laboratório: telão ---------- */
.lt-grade { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lt-tile { cursor: pointer; gap: 6px; }
.lt-tile.ativo { box-shadow: 0 0 0 4px rgba(45,184,240,.55); }
.lt-tile-cab { display: flex; align-items: center; gap: 8px; }
.lt-st { margin-left: auto; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--q-ja); color: #2E7D2A; }
.lt-st.fila { background: var(--q-teste); color: #8A6D00; }
.lt-st.executando { background: var(--q-plan); color: #0F6E99; animation: pulsar 1.2s ease-in-out infinite; }
.lt-arqs { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-top: 4px; }
.lt-arqs b { color: var(--navy); }
.lt-arqs code { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-acao { font-size: 13px; color: #0F6E99; border-top: 1px solid var(--line); padding-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-acao.negado { color: #B12A21; font-weight: 700; }
.lt-numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lt-numeros h2 { font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
.lt-numeros .big { font-size: 40px; }
.lt-feed { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #C9D8EE; }
.lt-feed li { overflow-wrap: anywhere; }
.lt-feed b { color: #F4F7FB; }
.lt-feed li.negado { color: #FF9A92; }
.lt-membros { margin: 6px 0 0; color: var(--muted); font-size: 18px; }
.lt-corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
.lt-arvore { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; overflow: auto; font-size: 17px; }
.lt-visor { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 26px; overflow: auto; }
.lt-visor-nome { margin: 0 0 12px; font-family: var(--display); font-weight: 800; color: var(--navy); font-size: 20px; }
.lt-md { font-size: 22px; line-height: 1.5; }
.lt-md h2 { font-size: 30px; } .lt-md h3 { font-size: 25px; } .lt-md table { font-size: 19px; }
.lt-md pre.fonte { font-size: 18px; }
.lt-tile-cab h3 { flex: 1; min-width: 0; }
.lt-area { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted2); }
.lt-area i { width: 9px; height: 9px; border-radius: 3px; }
