/* Resumo — estilos (mesma família visual dos apps da WE4) */
:root {
  --bg: #f3f3f7; --surface: #ffffff; --surface-2: #e9e9f1; --ink: #17182a; --muted: #6a6c80; --line: #e0e0ea;
  --accent: #3a4fd6; --accent-ink: #ffffff; --accent-soft: #e2e6fb;
  --ok: #1f8a5b; --ok-soft: #dcf1e6; --warn: #b7791f; --warn-soft: #fbf0d9; --danger: #c2412d; --danger-soft: #fbe3de;
  --radius: 16px; --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .04);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f17; --surface: #171926; --surface-2: #212435; --ink: #eceef6; --muted: #959ab3; --line: #262a3c;
    --accent: #8696ff; --accent-ink: #0b0d1c; --accent-soft: #1f2547;
    --ok: #4fd39a; --ok-soft: #12301f; --warn: #f0b545; --warn-soft: #3a2e12; --danger: #ff7a66; --danger-soft: #3d1c17;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.wrap { max-width: 600px; margin: 0 auto; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 104px); }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 16px/1 inherit; font-family: inherit; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.slim { width: auto; min-height: 38px; font-size: 14px; border-radius: 11px; padding: 0 14px; }
.btn:active { transform: scale(.985); }
.link { background: none; border: 0; color: var(--accent); font: inherit; padding: 8px 0; cursor: pointer; }
.link.danger { color: var(--danger); }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; font: 16px/1.3 inherit; font-family: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-inline { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); font-size: 15px; }
.check-inline input { width: 22px; height: 22px; accent-color: var(--accent); }

.page-head { margin: 4px 0 18px; }
.page-head h1 { font-size: 28px; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-block; margin-bottom: 6px; font-weight: 600; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 4px 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card h2 { font-size: 17px; margin-bottom: 10px; }
.card p { margin: 0 0 10px; }
.callout { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); margin-bottom: 14px; }
.callout.warn { background: var(--warn-soft); } .callout.danger { background: var(--danger-soft); }
.empty { text-align: center; padding: 30px 18px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 6px 0 14px; }

/* estado da conexão */
.status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; color: var(--ink); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.status.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.status.warn .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.status.danger .dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.status div { flex: 1; min-width: 0; display: grid; }
.status small { color: var(--muted); }
.chev { color: var(--muted); font-size: 20px; }

/* rodadas e resumos */
.rodada-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 4px 8px; }
.rodada-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.resumo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.resumo.importante { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
.resumo-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.avatar.grupo { border-radius: 11px; }
.resumo-top div { flex: 1; min-width: 0; display: grid; }
.resumo-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resumo-top small { color: var(--muted); font-size: 12.5px; }
.manchete { font-weight: 600; margin: 8px 0 6px; }
.resumo ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.resumo li { font-size: 15px; }
.pend { margin-top: 10px; padding: 10px 12px; background: var(--warn-soft); border-radius: 12px; }
.pend strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-bottom: 4px; }
.pend ul { padding-left: 18px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--warn-soft); color: var(--warn); }

/* lista de chats */
.lista { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.lista > li + li { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; }
.item > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.item .txt { flex: 1; min-width: 0; display: grid; }
.item strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item small { color: var(--muted); font-size: 13px; }
.item form { margin: 0; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; border: 0; background: var(--surface-2); cursor: pointer; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
.busca { margin-bottom: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .btn { width: auto; }

/* QR */
.qr { background: #fff; border-radius: 18px; padding: 14px; max-width: 300px; margin: 6px auto 14px; }
.qr svg { display: block; width: 100%; height: auto; }
.passos { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 6px; }

/* login */
body.auth .wrap { display: grid; min-height: 100dvh; align-content: center; padding-bottom: calc(var(--safe-b) + 24px); }
.brand { text-align: center; display: grid; justify-items: center; gap: 6px; margin-bottom: 20px; }
.brand img { border-radius: 16px; }
.brand h1 { font-size: 30px; }
.brand p { margin: 0; color: var(--muted); }

/* barra de abas */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 8px calc(var(--safe-b) + 6px); z-index: 10; }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* avisos */
.toasts { position: fixed; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; z-index: 20; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 560px; margin: 0 auto; width: 100%; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 15px; box-shadow: 0 6px 24px rgb(0 0 0 / .18); }
.toast.danger { background: var(--danger); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }

/* leitura em voz alta */
.ouvir { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ouvir .btn { width: auto; }
.player { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 74px); z-index: 15; max-width: 576px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; border-radius: 18px;
  background: var(--ink); color: var(--bg); box-shadow: 0 8px 28px rgb(0 0 0 / .25); }
.player[hidden] { display: none; }
.player-txt { flex: 1; min-width: 0; display: grid; }
.player-txt strong, .player-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-txt small { opacity: .7; font-size: 12.5px; }
.pbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); font-size: 17px; cursor: pointer; flex: none; }
.pbtn.vel { width: auto; padding: 0 10px; font-size: 13px; font-weight: 700; }
