/* =========================================================
   DOVIA · Protótipo visual · folha de estilos
   Paleta (a partir dos logos oficiais): preto #000000 · branco #FFFFFF · verde-azulado #009E98 (único destaque)
   Neutros derivados: #0A0A0A #111111 #161616 #1F1F1E #2A2A28 · #5E5E5B #8E8E8A #A3A3A0 · #E8E8E6 #F4F4F3 #FAFAF9
   ========================================================= */
@font-face { font-family: "Manrope"; src: url("assets/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* Modo claro (branco, secundário) */
:root {
  --grafite: #000000; --azul: #009E98; --marfim: #FFFFFF;
  --bg: #FFFFFF; --bg-2: #F4F4F3;
  --ink: #000000; --ink-2: #5E5E5B; --ink-3: #8E8E8A;
  --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.14);
  --surface: rgba(255,255,255,.66); --surface-2: rgba(255,255,255,.86); --surface-solid: #FFFFFF;
  --bubble-me: #000000; --bubble-me-ink: #FFFFFF; --bubble-other: #F4F4F3;
  --accent: #009E98; --accent-ink: #000000; --accent-soft: rgba(0,158,152,.10); --accent-line: rgba(0,158,152,.45);
  --hover: rgba(0,0,0,.045);
  --btn-1: #00ADA6; --btn-2: #009089; --btn-ink: #000000;
  --tile-1: #2A2A28; --tile-2: #000000; --tile-ink: #FFFFFF; --tile-alt-1: #8E8E8A; --tile-alt-2: #5E5E5B;
  --logo-ink: #000000; --logo-accent: #009E98; /* logo oficial versão branca: letras pretas, detalhes #009E98 */
  --danger: #D0553B;
  --shadow-1: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px -6px rgba(0,0,0,.12);
  --shadow-2: 0 2px 6px rgba(0,0,0,.05), 0 18px 48px -18px rgba(0,0,0,.25);
  --glow: 0 0 0 1px var(--accent-line), 0 6px 26px -8px rgba(0,158,152,.5);
  --blur: saturate(1.3) blur(22px);
  --r-s: 10px; --r-m: 16px; --r-l: 22px; --r-xl: 30px;
  --ease: cubic-bezier(.2,.8,.2,1); --ease-out: cubic-bezier(.16,1,.3,1);
  --t-fast: .16s; --t: .28s; --t-slow: .42s;
  --rail: 248px; --proj: 0px; --viewer: 0px;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Manrope", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
/* Modo escuro (preto, padrão) */
[data-theme="escuro"] {
  --bg: #000000; --bg-2: #0A0A0A;
  --ink: #FFFFFF; --ink-2: #A3A3A0; --ink-3: #6E6E6A;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --surface: rgba(20,20,20,.62); --surface-2: rgba(17,17,17,.88); --surface-solid: #111111;
  --bubble-me: #F4F4F3; --bubble-me-ink: #000000; --bubble-other: #161616;
  --accent-soft: rgba(0,158,152,.14); --accent-line: rgba(0,158,152,.5);
  --hover: rgba(255,255,255,.055);
  --tile-1: #2A2A28; --tile-2: #111111; --tile-alt-1: #5E5E5B; --tile-alt-2: #2A2A28;
  --logo-ink: #FFFFFF; --logo-accent: #009E98; /* logo oficial versão preta: letras brancas, detalhes #009E98 */
  --shadow-1: 0 1px 2px rgba(0,0,0,.5), 0 4px 14px -6px rgba(0,0,0,.7);
  --shadow-2: 0 2px 6px rgba(0,0,0,.5), 0 18px 48px -18px rgba(0,0,0,.9);
  --glow: 0 0 0 1px var(--accent-line), 0 6px 28px -8px rgba(0,158,152,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; } /* rede de segurança; as causas corrigem-se em cada componente */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--f-ui); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden;
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.02em; margin: 0; }
.muted { color: var(--ink-2); }
.eyebrow { font-family: var(--f-display); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
:focus-visible { outline: none; box-shadow: var(--glow); }

/* ---------- Logotipo oficial (geometria do SVG do Filipe; cores das variantes claro/escuro) ---------- */
.lg-mark, .lg-word { fill: var(--logo-ink); transition: fill var(--t-slow) var(--ease); }
.lg-ref, .lg-word .lg-acc { fill: var(--logo-accent); }
.lg-ptr {
  fill: var(--ptr-fill, var(--logo-accent));
  transform-box: view-box; transform-origin: 6px 11px;
  transform: rotate(var(--ptr, 0deg));
  transition: transform var(--ptr-dur, .42s) var(--ease-out), fill .3s var(--ease);
}

/* ---------- Ícones ---------- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .fill, .ic use { }
svg .fill { fill: currentColor; stroke: none; }

/* ---------- Vidro fosco ---------- */
.glass { background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.glass-soft { background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

/* ---------- Microinterações base ---------- */
.tap { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast) var(--ease), background-color var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease); }
.tap:active { transform: scale(.965); }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .45s var(--ease-out) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); background: rgba(181,84,63,.1); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 600; font-size: 15px; }
.btn.primary { background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); color: var(--btn-ink); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 22px -10px rgba(0,158,152,.7); }
.btn.primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, var(--glow); transform: translateY(-1px); }
.btn.primary:active { transform: scale(.97); }
.btn.ghost { color: var(--ink-2); font-weight: 500; height: 42px; }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.ghost em { font-style: normal; color: var(--ink-3); }
.btn.big { height: 54px; padding: 0 26px; border-radius: 16px; font-size: 16px; }
.link { color: var(--accent); font-size: 13.5px; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Avatares ---------- */
.avatar { --s: 34px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font: 700 calc(var(--s) * .36)/1 var(--f-display); letter-spacing: .02em; color: var(--marfim); position: relative;
  background: linear-gradient(145deg, var(--tile-1), var(--tile-2)); color: var(--tile-ink); box-shadow: 0 0 0 1px var(--line-2), 0 0 0 3px var(--surface-solid), var(--shadow-1); }
.avatar[data-cor="grafite"] { background: linear-gradient(145deg, var(--tile-alt-1), var(--tile-alt-2)); }
.avatar.sm { --s: 28px; } .avatar.lg { --s: 42px; } .avatar.xl { --s: 92px; box-shadow: 0 0 0 4px var(--surface-solid), 0 18px 40px -16px rgba(0,0,0,.5); }
.avatar.online::after { content: ""; position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface-solid); }

/* =========================================================
   ENTRADA
   ========================================================= */
.login { position: fixed; inset: 0; z-index: 2; overflow: auto; display: flex; flex-direction: column; padding: 28px 48px 40px; background: transparent;
  transition: opacity .5s var(--ease-out), visibility 0s; }
/* véu sobre o mapa: dá leitura ao texto sem esconder os pontos */
.login-veu { position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.42) 34%, rgba(0,0,0,.05) 54%, rgba(0,0,0,.10) 70%, rgba(0,0,0,.45) 100%),
              radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.6) 100%); }
html[data-theme="claro"] .login-veu { background: linear-gradient(90deg, rgba(255,255,255,.86) 0%, rgba(255,255,255,.5) 34%, rgba(255,255,255,.06) 54%, rgba(255,255,255,.12) 70%, rgba(255,255,255,.5) 100%),
              radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(255,255,255,.6) 100%); }
.login.aparecer .login-veu { animation: veuIn .9s var(--ease-out) both; }
@keyframes veuIn { from { opacity: 0; } }
.login.leaving { animation: fadeOut .38s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(1.015); } }
.login-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-tuner { position: absolute; width: 620px; height: 620px; right: 4%; top: 50%; margin-top: -280px; opacity: .045; --ptr-dur: .45s; }
[data-theme="escuro"] .login-tuner { opacity: .08; }
.login.aparecer .login-top { animation: rise .5s var(--ease-out) both; }
.login-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.logo-h { height: 30px; width: auto; }
.login-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 420px); gap: 56px; align-items: center; max-width: 1180px; width: 100%; margin: 24px auto 0; position: relative; z-index: 1; }
.login-title { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.05; font-weight: 800; margin: 4px 0 18px; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
html[data-theme="claro"] .login-title { text-shadow: none; }
.login-lema { margin: 0 0 26px; font-size: 15.5px; color: var(--ink-2); max-width: 30em; }
.login-lema b { color: var(--accent); font-weight: 700; }
/* botão discreto do vídeo de boas-vindas */
.vb-btn { display: inline-flex; align-items: center; gap: 12px; padding: 7px 20px 7px 7px; border-radius: 999px; text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--surface-solid) 40%, transparent); border: 1px solid var(--line-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease), background var(--t) var(--ease); }
.vb-btn:hover { border-color: var(--accent-line); box-shadow: var(--glow); transform: translateY(-1px); }
.vb-btn:active { transform: scale(.985); }
.vb-play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #000; position: relative; flex: none; }
.vb-play::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--accent-line); animation: vbPulse 2.4s ease-out infinite; }
@keyframes vbPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.vb-play .ic { width: 18px; height: 18px; margin-left: 2px; }
.vb-txt { display: flex; flex-direction: column; line-height: 1.25; }
.vb-txt b { font-size: 14px; font-weight: 600; }
.vb-txt small { font-size: 11.5px; color: var(--ink-3); }
.login-title span { color: var(--ink-2); }
.login.aparecer .login-intro > * { animation: rise .6s var(--ease-out) both; }
.login.aparecer .login-intro > *:nth-child(2) { animation-delay: .07s; } .login.aparecer .login-intro > *:nth-child(3) { animation-delay: .14s; } .login.aparecer .login-intro > *:nth-child(4) { animation-delay: .21s; }
.login.aparecer .login-card { animation: cardIn .7s var(--ease-out) .12s both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.welcome-video { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-xl); overflow: hidden; cursor: pointer; color: #fff;
  background: #000; border: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow-2); }
.wv-logo { position: absolute; left: 50%; top: 40%; width: 58%; transform: translate(-50%, -50%); transition: transform var(--t-slow) var(--ease-out); }
.welcome-video:hover .wv-logo { transform: translate(-50%, -52%) scale(1.02); }
.welcome-video::before { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 45% at 50% 78%, rgba(0,158,152,.28), transparent 70%); opacity: .7; transition: opacity var(--t-slow) var(--ease); }
.welcome-video:hover::before { opacity: 1; }
.welcome-video:active { transform: scale(.99); }
.wv-poster { position: absolute; inset: 0; display: grid; place-items: center; }
.wv-sym { position: absolute; width: 34%; height: auto; aspect-ratio: 1; top: 14%; --ptr: -14deg; --ptr-dur: .45s; filter: drop-shadow(0 10px 24px rgba(0,0,0,.4)); }
.welcome-video { --logo-ink: #FFFFFF; --logo-accent: #009E98; }
.welcome-video:hover .wv-sym { --ptr: 0deg; }
.wv-play { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-top: 26%;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.28);
  transition: transform var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.wv-play .ic { width: 28px; height: 28px; margin-left: 3px; }
.welcome-video:hover .wv-play { transform: scale(1.06); background: rgba(0,158,152,.6); box-shadow: 0 0 0 8px rgba(0,158,152,.18), 0 0 40px rgba(0,158,152,.6); }
.wv-bar { position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px;
  background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.wv-label { font-weight: 600; }
.wv-chip { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.wv-track { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.16); overflow: hidden; }
.wv-track i { display: block; width: 0; height: 100%; background: var(--azul); }
.wv-time { font-variant-numeric: tabular-nums; color: rgba(255,255,255,.7); }

.login-card { border-radius: var(--r-xl); padding: 30px 30px 22px; display: flex; flex-direction: column; gap: 16px; position: relative;
  background: color-mix(in srgb, var(--surface-solid) 52%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(20px); backdrop-filter: saturate(1.4) blur(20px);
  border: 1px solid var(--line-2); box-shadow: 0 40px 90px -40px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.07); }
html[data-theme="claro"] .login-card { background: rgba(255,255,255,.62); box-shadow: 0 40px 90px -40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.9); }
.login-card::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(0,158,152,.85), transparent); }
.login-card .field input { background: color-mix(in srgb, var(--surface-solid) 66%, transparent); }
.at-wrap { position: relative; display: block; }
.at-pre { position: absolute; left: 14px; top: 50%; transform: translateY(-52%); font-style: normal; font-weight: 700; font-size: 16px; color: var(--accent); pointer-events: none; }
.at-wrap input { padding-left: 33px !important; }
.field-hint { font-size: 12px; font-weight: 500; color: var(--ink-3); transition: color var(--t) var(--ease); }
.field-hint.erro { color: var(--danger); }
.lc-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.lc-head h2 { font-size: 26px; font-weight: 800; }
.lc-head p { margin: 2px 0 0; font-size: 13.5px; }
.lc-tuner { width: 56px; height: 56px; flex: none; padding: 9px; border-radius: 18px; background: var(--hover); border: 1px solid var(--line); --ptr: -22deg; --ptr-fill: var(--ink-3); transition: box-shadow var(--t-slow) var(--ease), background var(--t-slow) var(--ease); }
.lc-tuner.sintonia { --ptr-fill: var(--logo-accent); box-shadow: var(--glow); }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { height: 48px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface-solid); padding: 0 14px; font-size: 15px; font-weight: 500; color: var(--ink);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease); width: 100%; }
.field input:hover { border-color: var(--accent-line); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pw-wrap { position: relative; display: block; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.pw-eye:hover { color: var(--ink); background: var(--accent-soft); }
.lc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.check { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; max-width: 100%; }
.check input { position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; opacity: 0; pointer-events: none; } /* preso à etiqueta: não alarga o modal no Safari */
.check i { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: all var(--t) var(--ease); background: var(--surface-solid); }
.check input:checked + i { background: var(--accent); border-color: var(--accent); }
.check input:checked + i::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--marfim); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); }
.login-card .btn.primary { margin-top: 6px; }
.fine { margin: 2px 0 0; text-align: center; font-size: 12px; color: var(--ink-3); }
.shake { animation: shake .36s var(--ease); }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* =========================================================
   APLICAÇÃO · colunas
   ========================================================= */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: var(--rail) var(--proj) minmax(0, 1fr) var(--viewer);
  gap: 12px; padding: 12px; transition: grid-template-columns var(--t-slow) var(--ease-out); }
.app.entering { animation: appIn .42s var(--ease-out) both; }
@keyframes appIn { from { opacity: 0; transform: scale(.985); } }
.app[data-sala="1"] { --proj: 340px; }
.app[data-viewer="1"] { --viewer: clamp(400px, 46%, 780px); --rail: 76px; }
.app[data-viewer="1"][data-sala="1"] { --proj: 0px; }
.app[data-viewer="1"] .col-projects { opacity: 0; transform: translateX(-14px); pointer-events: none; border-width: 0; }
@media (min-width: 1600px) { .app[data-viewer="1"][data-sala="1"] { --proj: 300px; } .app[data-viewer="1"] .col-projects { opacity: 1; transform: none; pointer-events: auto; border-width: 1px; } }
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 560px at 100% 0%, rgba(0,158,152,.12), transparent 60%),
              radial-gradient(700px 500px at 0% 100%, rgba(0,158,152,.04), transparent 60%), var(--bg); }

/* Barra lateral */
.rail { border-radius: var(--r-l); display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; min-width: 0; overflow: hidden; }
@media (min-width: 861px) {
  .rail.glass { background: rgba(16,16,16,.34); box-shadow: none; }
  html[data-theme="claro"] .rail.glass { background: rgba(255,255,255,.46); }
}
.rail-logo { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; border-radius: 12px; }
.logo-sym { width: 30px; height: 30px; flex: none; }
.rail-logo:hover .logo-sym { --ptr: 8deg; --ptr-dur: .3s; }
.logo-word { height: 22px; width: auto; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.rail-user { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 16px; background: var(--hover); border: 1px solid var(--line); min-width: 0; }
.ru-txt { display: flex; flex-direction: column; min-width: 0; transition: opacity var(--t) var(--ease); }
.ru-txt b { font-family: var(--f-display); font-size: 14.5px; white-space: nowrap; }
.ru-txt small { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu-item { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 14px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.menu-item:hover { background: var(--hover); color: var(--ink); }
.menu-item.active { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1), inset 3px 0 0 var(--accent); }
.menu-item.active .ic { color: var(--accent); }
.menu-item span { transition: opacity var(--t) var(--ease); }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: #000; font-weight: 700; font-size: 12px; display: grid; place-items: center; box-shadow: 0 4px 14px -4px rgba(0,158,152,.8); }
.badge:empty { display: none; }
.rail-foot { margin-top: auto; display: flex; gap: 6px; }
.rail-foot .icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.rail-ajustes { display: none; }
.app[data-viewer="1"] .rail { padding: 18px 10px; align-items: center; }
.app[data-viewer="1"] .logo-word, .app[data-viewer="1"] .ru-txt, .app[data-viewer="1"] .menu-item span { opacity: 0; width: 0; overflow: hidden; }
.app[data-viewer="1"] .rail-user { padding: 6px; background: none; }
.app[data-viewer="1"] .menu-item { padding: 0; width: 46px; justify-content: center; gap: 0; }
.app[data-viewer="1"] .badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
.app[data-viewer="1"] .rail-foot { flex-direction: column; }

/* Coluna de projetos */
.col-projects { border-radius: var(--r-l); min-width: 0; overflow: hidden; display: flex; flex-direction: column; opacity: 0; transform: translateX(-14px);
  transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-out); padding: 0; }
.app[data-sala="1"] .col-projects { opacity: 1; transform: none; }
.app[data-sala="0"] .col-projects { border-width: 0; pointer-events: none; }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 22px 20px 12px; min-width: 300px; }
.cp-head h2 { font-size: 24px; font-weight: 800; }
.h-ic { display: flex; align-items: center; gap: 9px; } .h-ic .ic { width: 22px; height: 22px; color: var(--ink-3); }
.count-pill { margin-left: auto; font-size: 12px; color: var(--ink-2); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); }
.search { display: flex; align-items: center; gap: 8px; margin: 4px 16px 10px; padding: 0 12px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--surface-solid) 70%, transparent); border: 1px solid var(--line); color: var(--ink-3); transition: border-color var(--t), box-shadow var(--t); min-width: 268px; }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .ic { width: 17px; height: 17px; }
.search input { border: 0; background: none; outline: none; flex: 1; font-size: 14px; color: var(--ink); min-width: 0; }
.project-list { list-style: none; margin: 0; padding: 4px 10px 14px; overflow-y: auto; flex: 1; min-width: 300px; }
.project { display: flex; gap: 12px; padding: 12px; border-radius: 16px; cursor: pointer; align-items: flex-start; margin-bottom: 4px; }
.project.entrar { animation: rise .36s var(--ease-out) both; }
.project:hover { background: var(--hover); }
.project.active { background: var(--surface-solid); box-shadow: var(--shadow-1), 0 0 0 1px var(--accent-line); }
.proj-tile { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font: 800 14px/1 var(--f-display); color: var(--ink); letter-spacing: .02em;
  background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); transition: border-color var(--t), box-shadow var(--t); }
.project.active .proj-tile, .chat-head .proj-tile { border-color: var(--accent-line); }
.pj-txt { flex: 1; min-width: 0; }
.pj-top { display: flex; align-items: baseline; gap: 8px; }
.pj-top b { font-family: var(--f-display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-top time { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.project.unread .pj-top time { color: var(--accent); font-weight: 600; }
.pj-last { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.pj-last span { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.project.unread .pj-last span { color: var(--ink); font-weight: 500; }
.pj-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* Coluna principal */
.col-main { position: relative; min-width: 0; border-radius: var(--r-l); overflow: hidden; display: flex; }
.welcome { flex: 1; display: grid; place-items: center; padding: 40px; overflow: auto; }
.wl-inner { max-width: 640px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.wl-inner > * { animation: rise .45s var(--ease-out) both; }
.wl-inner > *:nth-child(2) { animation-delay: .05s; } .wl-inner > *:nth-child(3) { animation-delay: .09s; } .wl-inner > *:nth-child(4) { animation-delay: .13s; } .wl-inner > *:nth-child(5) { animation-delay: .17s; } .wl-inner > *:nth-child(6) { animation-delay: .21s; }
.welcome .avatar.xl { margin-bottom: 22px; }
.wl-title { font-size: clamp(36px, 4.4vw, 58px); font-weight: 800; line-height: 1.05; margin: 2px 0 12px; }
.wl-title span { color: var(--ink); }
.wl-sub { color: var(--ink-2); font-size: 17px; margin: 0 0 26px; max-width: 520px; }

/* Conversa */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; border-radius: var(--r-l); background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--line); animation: chatIn .36s var(--ease-out) both; }
@keyframes chatIn { from { opacity: 0; transform: translateX(16px); } }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; z-index: 2; }
.chat-head .proj-tile { width: 42px; height: 42px; }
.ch-title { min-width: 0; flex: 1; }
.ch-title h2 { font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-title p { margin: 1px 0 0; font-size: 12.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.ch-title p span { overflow: hidden; text-overflow: ellipsis; }
.ch-title .avatar { --s: 18px; font-size: 7px; box-shadow: 0 0 0 1.5px var(--surface-solid); }
.ch-title .avatar + .avatar { margin-left: -9px; }
.tabs { position: relative; display: flex; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 6%, transparent); flex: none; }
.tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tab .ic { width: 17px; height: 17px; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab:hover { color: var(--ink); }
.tab-count { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--hover); color: var(--ink-2); }
.tab-ink { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: var(--surface-solid); box-shadow: var(--shadow-1); transition: transform var(--t-slow) var(--ease-out), width var(--t-slow) var(--ease-out); }

.chat-body { flex: 1; min-height: 0; position: relative; display: flex; }
.thread { flex: 1; overflow-y: auto; padding: 18px 22px 10px; scroll-behavior: smooth; }
.day-group { position: relative; }
.day { display: flex; justify-content: center; margin: 18px 0 12px; position: sticky; top: 0; z-index: 1; }
.day span { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 5px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-1); }

.msg { display: flex; gap: 10px; align-items: flex-end; margin: 4px 0; max-width: 100%; }
.msg.me { flex-direction: row-reverse; }
.msg .avatar { visibility: hidden; }
.msg.first .avatar { visibility: visible; }
.msg-col { display: flex; flex-direction: column; gap: 6px; max-width: min(560px, 78%); min-width: 0; }
.msg.me .msg-col { align-items: flex-end; }
.msg-meta { display: none; align-items: baseline; gap: 8px; font-size: 12px; color: var(--ink-3); padding: 0 4px; }
.msg.first .msg-meta { display: flex; }
.msg-meta b { color: var(--ink); font-family: var(--f-display); font-size: 13px; }
.msg-meta time { cursor: help; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg.enter { animation: msgIn .34s var(--ease-out) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.msg.flash .msg-col > * { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent-line), 0 0 30px rgba(0,158,152,.35); } 100% { box-shadow: none; } }
.bubble { padding: 10px 14px; border-radius: 18px; background: var(--bubble-other); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; position: relative; }
.msg:not(.me) .bubble { border-bottom-left-radius: 6px; }
.msg.me .bubble { background: var(--bubble-me); color: var(--bubble-me-ink); border-color: transparent; border-bottom-right-radius: 6px; }
.bubble a { text-decoration: underline; text-underline-offset: 3px; }
.bubble .stamp { font-size: 11px; opacity: .6; margin-left: 10px; float: right; margin-top: 5px; }

/* Anexos no chat */
.att { cursor: pointer; border-radius: 18px; overflow: hidden; position: relative; box-shadow: var(--shadow-1); border: 1px solid var(--line); background: var(--surface-solid);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.att:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), 0 0 0 1px var(--accent-line); }
.att:active { transform: scale(.985); }
.att.selected { box-shadow: var(--glow); }
.att-media { width: 340px; max-width: 100%; aspect-ratio: 16 / 10; position: relative; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.att-media img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.03); transition: opacity .4s var(--ease), transform .45s var(--ease-out); }
.att-media img.loaded { opacity: 1; transform: none; }
.att:hover .att-media img.loaded { transform: scale(1.02); }
.att-cap { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; color: var(--ink-2); }
.att-cap b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-cap span { margin-left: auto; white-space: nowrap; }
.play-o { position: absolute; inset: 0; display: grid; place-items: center; }
.play-o i { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.38); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.3);
  transition: transform var(--t) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.play-o .ic { width: 24px; height: 24px; margin-left: 3px; }
.att:hover .play-o i { transform: scale(1.08); background: rgba(0,158,152,.75); box-shadow: 0 0 0 6px rgba(0,158,152,.2), 0 0 30px rgba(0,158,152,.6); }
.dur { position: absolute; right: 10px; bottom: 10px; font-size: 11.5px; font-weight: 600; color: #fff; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-variant-numeric: tabular-nums; }

.att-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; width: 340px; max-width: 100%; }
.type-badge { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-2); transition: color var(--t), border-color var(--t); }
.type-badge .ic { width: 22px; height: 22px; }
.att:hover .type-badge, .lib-row:hover .type-badge { color: var(--accent); border-color: var(--accent-line); }
.af-txt { min-width: 0; flex: 1; }
.af-txt b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-txt span { font-size: 12px; color: var(--ink-2); }
.af-open { font-size: 12px; font-weight: 600; color: var(--ink); padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line-2); white-space: nowrap; transition: background var(--t); }
.att:hover .af-open { background: var(--accent); color: #000; border-color: transparent; }

.att-link { width: 360px; max-width: 100%; }
.att-link .att-media { aspect-ratio: 1200 / 630; }
.al-txt { padding: 10px 14px 12px; }
.al-dom { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); text-transform: lowercase; }
.al-dom .ic { width: 13px; height: 13px; }
.al-txt b { display: block; font-family: var(--f-display); font-size: 14.5px; margin: 3px 0 2px; color: var(--ink); }
.al-txt p { margin: 0; font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.att-audio { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; width: 330px; max-width: 100%; }
.msg.me .att-audio { background: var(--bubble-me); color: var(--bubble-me-ink); border-color: transparent; }
.aplay { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: #000; box-shadow: 0 6px 16px -6px rgba(0,158,152,.8); transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease); }
.msg.me .aplay { background: var(--accent); color: #000; }
.aplay:hover { transform: scale(1.06); box-shadow: var(--glow); }
.aplay .ic { width: 18px; height: 18px; }
.aplay .i-pause { display: none; } .playing .aplay .i-play { display: none; } .playing .aplay .i-pause { display: block; }
.wave { flex: 1; height: 34px; display: flex; align-items: center; gap: 2px; cursor: pointer; min-width: 0; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, currentColor 28%, transparent); transition: background .15s linear, transform .2s var(--ease); transform-origin: center; }
.wave i.on { background: var(--accent); }
.msg.me .wave i.on { background: var(--accent); }
.att-audio:hover .wave i { transform: scaleY(1.06); }
.atime { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 34px; text-align: right; }
.msg.me .atime { color: inherit; opacity: .7; }

/* Biblioteca */
.library { container-type: inline-size; flex: 1; overflow-y: auto; padding: 18px 22px 24px; animation: rise .32s var(--ease-out) both; }
.lib-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-top h3 { font-size: 18px; font-weight: 800; margin-right: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2); background: var(--surface); }
.chip:hover { color: var(--ink); border-color: var(--accent-line); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lib-group { margin-top: 14px; }
.lib-group h4 { font: 700 12px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 18px 4px 10px; }
.lib-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 120px; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; cursor: pointer; border: 1px solid transparent; animation: rise .32s var(--ease-out) both;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast) var(--ease); }
.lib-row:hover { background: var(--surface-solid); border-color: var(--line); box-shadow: var(--shadow-1); }
.lib-row:active { transform: scale(.99); }
.lib-row.selected { background: var(--surface-solid); box-shadow: var(--glow); }
.lib-thumb { width: 56px; height: 44px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 7%, transparent); position: relative; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease); }
.lib-thumb img.loaded { opacity: 1; }
.lib-thumb .type-badge { width: 100%; height: 100%; border: 0; border-radius: 0; background: none; }
.lib-thumb .mini-play { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; }
.lib-thumb .mini-play .ic { width: 11px; height: 11px; margin-left: 1px; }
.lib-name b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-name span { font-size: 12px; color: var(--ink-2); }
.lib-from { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.lib-from span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-when { font-size: 12px; color: var(--ink-2); text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lib-when a { color: var(--accent); font-weight: 600; font-size: 11.5px; }
.lib-when a:hover { text-decoration: underline; }
@container (max-width: 640px) { .lib-row { grid-template-columns: 52px minmax(0, 1fr) 118px; } .lib-from { display: none; } }
.lib-empty { padding: 60px 20px; text-align: center; color: var(--ink-2); }

/* Compositor */
.composer-wrap { padding: 8px 18px 12px; position: relative; z-index: 2; }
.composer, .recorder { display: flex; align-items: flex-end; gap: 4px; padding: 7px; border-radius: 20px; background: var(--surface-2); transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); min-width: 0; }
.composer:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow-1), 0 0 0 4px var(--accent-soft); }
.composer .icon-btn { width: 34px; height: 34px; flex: none; }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; outline: none; padding: 9px 4px; max-height: 160px; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.composer textarea:focus-visible { box-shadow: none; }
.composer textarea::placeholder { color: var(--ink-3); }
.send-btn { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--accent); color: #000; box-shadow: 0 8px 18px -8px rgba(0,158,152,.9); }
.send-btn:hover { box-shadow: var(--glow); transform: translateY(-1px); }
.send-btn:disabled { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink-3); box-shadow: none; cursor: default; }
.send-btn:disabled:active { transform: none; }
.send-btn .ic { width: 19px; height: 19px; stroke-width: 2.1; }
.composer.out { animation: none; }
.recorder { align-items: center; animation: recIn .3s var(--ease-out) both; border-color: rgba(181,84,63,.3); box-shadow: var(--shadow-1), 0 0 0 4px rgba(181,84,63,.08); }
@keyframes recIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #D0553B; margin-left: 4px; animation: pulse 1.2s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(208,85,59,.5); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(208,85,59,.55); } 70% { box-shadow: 0 0 0 9px rgba(208,85,59,0); } 100% { box-shadow: 0 0 0 0 rgba(208,85,59,0); } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; min-width: 40px; }
.rec-wave { flex: 1; height: 38px; min-width: 0; }
.rec-note { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.link-preview { margin-bottom: 8px; }
.lp-card { display: flex; gap: 12px; align-items: center; padding: 8px; padding-right: 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-1); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: recIn .3s var(--ease-out) both; position: relative; }
.lp-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.lp-card img, .lp-card .lp-ph { width: 92px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; margin-left: 6px; }
.lp-ph { display: grid; place-items: center; background: var(--hover); color: var(--ink-2); }
.lp-card div { min-width: 0; flex: 1; }
.lp-card b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card span { font-size: 12px; color: var(--ink-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card small { font-size: 11px; color: var(--ink-3); }
.lp-loading b, .lp-loading span { background: linear-gradient(90deg, var(--line) 0%, var(--line-2) 50%, var(--line) 100%); background-size: 200% 100%; color: transparent; border-radius: 6px; animation: shimmer 1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.drop-zone { position: absolute; inset: 8px; z-index: 5; border-radius: var(--r-l); display: grid; place-items: center; text-align: center; background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 2px dashed var(--accent-line); animation: rise .2s var(--ease-out) both; }
.drop-zone div { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-2); }
.drop-zone .ic { width: 34px; height: 34px; color: var(--accent); }
.drop-zone b { color: var(--ink); font-size: 17px; }

/* =========================================================
   Painel de visualização (direita)
   ========================================================= */
.col-viewer { border-radius: var(--r-l); min-width: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--surface-2);
  opacity: 0; transform: translateX(24px); transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-out); }
.app[data-viewer="1"] .col-viewer { opacity: 1; transform: none; }
.app[data-viewer="0"] .col-viewer { border-width: 0; pointer-events: none; }
.vw-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); min-width: 360px; }
.vw-head .type-badge { width: 38px; height: 38px; border-radius: 11px; } .vw-head .type-badge .ic { width: 20px; height: 20px; }
.vw-title { flex: 1; min-width: 0; }
.vw-title h3 { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-title p { margin: 1px 0 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-actions { display: flex; gap: 2px; }
.vw-actions .icon-btn { width: 34px; height: 34px; }
.vw-actions .ic { width: 18px; height: 18px; }
.vw-body { flex: 1; min-height: 0; overflow: auto; position: relative; min-width: 360px; }
.vw-body > * { animation: vwIn .32s var(--ease-out) both; }
@keyframes vwIn { from { opacity: 0; transform: translateY(8px); } }
.vw-note { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; color: var(--ink-2); background: var(--hover); border: 1px solid var(--line); }
.vw-note .ic { width: 16px; height: 16px; color: var(--accent); }

.vw-media { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.vw-media video, .vw-media .vw-img { width: 100%; border-radius: 16px; background: #000; box-shadow: var(--shadow-2); display: block; }
.vw-img { cursor: zoom-in; transition: transform .35s var(--ease-out); background: transparent !important; }
.vw-img.zoom { transform: scale(1.6); cursor: zoom-out; }
.vw-imgwrap { overflow: hidden; border-radius: 16px; }
.vw-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.vw-facts div { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.vw-facts b { display: block; color: var(--ink); font-size: 13px; margin-top: 2px; }

/* Leitor de áudio grande */
.vw-audio { margin: 16px; padding: 26px 22px; border-radius: 22px; background: radial-gradient(120% 120% at 20% 0%, #1C1C1B, #050505); color: var(--marfim); box-shadow: var(--shadow-2); }
.vw-audio .wave { height: 90px; gap: 3px; color: var(--marfim); }
.vw-audio .wave i.on { background: #33C2BC; }
.va-ctrl { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.va-ctrl .aplay { width: 56px; height: 56px; background: var(--marfim); color: var(--grafite); }
.va-ctrl .aplay .ic { width: 22px; height: 22px; }
.va-time { font-variant-numeric: tabular-nums; font-size: 14px; color: rgba(255,255,255,.8); }
.speed { margin-left: auto; height: 32px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.12); color: var(--marfim); font-weight: 700; font-size: 13px; }
.speed:hover { background: rgba(255,255,255,.2); }
.va-who { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; color: rgba(255,255,255,.75); }
.va-who b { color: var(--marfim); font-family: var(--f-display); }

/* PDF e diapositivos simulados */
.pdf { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 100%; }
.pdf-thumbs { border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--ink) 3%, transparent); position: sticky; top: 0; align-self: start; max-height: 100%; }
.pdf-thumb { border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: border-color var(--t), transform var(--t-fast); background: #fff; aspect-ratio: 1 / 1.414; display: grid; place-items: center; font-size: 10px; color: #8E8E8A; position: relative; }
.pdf-thumb.slide { aspect-ratio: 16 / 9; }
.pdf-thumb:hover { transform: scale(1.04); }
.pdf-thumb.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pdf-thumb i { position: absolute; inset: 14% 16%; background: repeating-linear-gradient(180deg, #E8E8E6 0 2px, transparent 2px 7px); }
.pdf-thumb.slide i { inset: 18% 12%; background: linear-gradient(90deg, #009E98 0 30%, transparent 30%), repeating-linear-gradient(180deg, #E8E8E6 0 2px, transparent 2px 8px); }
.pdf-thumb span { position: absolute; bottom: 3px; right: 5px; font-weight: 700; }
.pdf-main { padding: 0 18px 30px; }
.pdf-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; margin: 0 -18px 12px; background: color-mix(in srgb, var(--surface-solid) 85%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.pdf-bar .icon-btn { width: 30px; height: 30px; }
.pdf-bar .ic { width: 16px; height: 16px; }
.pdf-bar b { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }
.pdf-pages { transform-origin: top center; transition: transform var(--t-slow) var(--ease-out); }
.page { background: #FFFFFF; color: #111111; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 12px 30px -14px rgba(0,0,0,.3); margin: 0 auto 18px; max-width: 560px; aspect-ratio: 1 / 1.414; padding: 8% 9%; font-size: 10.5px; line-height: 1.55; position: relative; overflow: hidden; }
.page h1 { font-size: 22px; line-height: 1.15; margin-bottom: 8px; color: #111111; }
.page h2 { font-size: 13.5px; margin: 16px 0 6px; color: #009E98; letter-spacing: 0; }
.page p { margin: 0 0 8px; }
.page .pg-foot { position: absolute; left: 9%; right: 9%; bottom: 4.5%; display: flex; justify-content: space-between; font-size: 8.5px; color: #8E8E8A; border-top: 1px solid #E8E8E6; padding-top: 6px; }
.page .pg-logo { height: 12px; width: auto; margin-bottom: 22px; }
.page, .slide-pg { --logo-ink: #111111; --logo-accent: #009E98; }
.page .cover-band, .slide-pg.dark { --logo-ink: #FFFFFF; --logo-accent: #009E98; }
.page table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 9.5px; }
.page td, .page th { padding: 5px 6px; border-bottom: 1px solid #E8E8E6; text-align: left; }
.page th { color: #5E5E5B; font-weight: 700; }
.page td.n, .page th.n { text-align: right; font-variant-numeric: tabular-nums; }
.page .cover-band { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(135deg, #111111, #1C1C1B); }
.page .cover-band svg { position: absolute; right: 9%; bottom: 12%; width: 30%; opacity: .9; }
.page .site-plan { width: 100%; border: 1px solid #E8E8E6; border-radius: 6px; margin: 8px 0; background: #FAFAF9; }
.slide-pg { aspect-ratio: 16 / 9; max-width: 620px; margin: 0 auto 18px; border-radius: 6px; overflow: hidden; position: relative; background: #FFFFFF; color: #111111; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 12px 30px -14px rgba(0,0,0,.35); padding: 6% 7%; }
.slide-pg.dark { background: radial-gradient(120% 120% at 20% 0%, #1C1C1B, #050505); color: #FFFFFF; }
.slide-pg h1 { font-size: 26px; line-height: 1.1; margin-bottom: 8px; }
.slide-pg h2 { font-size: 19px; margin-bottom: 12px; }
.slide-pg p { font-size: 12px; margin: 0 0 6px; opacity: .85; }
.slide-pg .s-num { position: absolute; right: 4%; bottom: 5%; font-size: 10px; opacity: .55; }
.slide-pg .s-eyebrow { font: 700 9.5px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: #009E98; margin-bottom: 10px; }
.slide-pg.dark .s-eyebrow { color: #33C2BC; }
.s-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.s-grid div { background: rgba(255,255,255,.7); border-radius: 10px; padding: 10px; font-size: 10.5px; }
.s-grid b { display: block; font: 800 20px/1.1 var(--f-display); color: #009E98; }
.s-bars { display: flex; align-items: flex-end; gap: 10px; height: 46%; margin-top: 8px; padding-bottom: 16px; border-bottom: 1px solid rgba(0,0,0,.15); }
.s-bars div { flex: 1; background: linear-gradient(180deg, #2A2A28, #000000); border-radius: 6px 6px 0 0; position: relative; }
.s-bars div span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 9px; color: #5E5E5B; }
.s-bars div em { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-size: 9px; font-style: normal; font-weight: 700; }

/* Documento Word simulado */
.doc-wrap { padding: 16px 18px 30px; }
.doc-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.doc-tools span { padding: 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.doc-page { aspect-ratio: auto; min-height: 640px; font-family: Georgia, "Times New Roman", serif; font-size: 11.5px; line-height: 1.65; }
.doc-page h1 { font-family: var(--f-display); }
.doc-page h2 { font-family: var(--f-display); }
.doc-page .hl { background: rgba(0,158,152,.13); box-shadow: -6px 0 0 0 rgba(0,158,152,.13), 6px 0 0 0 rgba(0,158,152,.13); border-left: 2px solid #009E98; padding-left: 8px; margin-left: -10px; }
.doc-page .cmt { float: right; width: 34%; margin: 0 -4% 8px 10px; font-family: var(--f-ui); font-size: 9.5px; background: #F4F4F3; border: 1px solid #E8E8E6; border-left: 2px solid #009E98; border-radius: 6px; padding: 6px 8px; color: #5E5E5B; }

/* Folha Excel simulada */
.sheet-wrap { display: flex; flex-direction: column; height: 100%; }
.fx { display: flex; align-items: center; gap: 0; margin: 12px 14px 8px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface-solid); font-size: 12.5px; }
.fx b { padding: 7px 12px; border-right: 1px solid var(--line-2); min-width: 54px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fx i { padding: 7px 10px; color: var(--accent); font-style: italic; font-family: Georgia, serif; border-right: 1px solid var(--line-2); }
.fx span { padding: 7px 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-scroll { flex: 1; overflow: auto; margin: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-solid); }
.xls { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.xls th, .xls td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 10px; white-space: nowrap; height: 32px; }
.xls thead th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--ink) 6%, var(--surface-solid)); font-weight: 600; color: var(--ink-2); font-size: 11.5px; text-align: center; }
.xls tbody th { position: sticky; left: 0; background: color-mix(in srgb, var(--ink) 6%, var(--surface-solid)); color: var(--ink-3); font-weight: 600; font-size: 11px; width: 34px; text-align: center; }
.xls thead th:first-child { left: 0; z-index: 2; }
.xls td { cursor: cell; transition: background .12s; color: var(--ink); }
.xls td:hover { background: var(--accent-soft); }
.xls td.sel { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.xls td.n { text-align: right; }
.xls td.h { font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.xls td.t { font-weight: 800; border-top: 2px solid var(--ink-3); }
.xls td.neg { color: var(--ink-2); }
.xls td.pos { color: var(--ink); }
.sheet-tabs { display: flex; gap: 4px; padding: 10px 14px 14px; }
.sheet-tabs button { height: 30px; padding: 0 14px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sheet-tabs button:hover { background: var(--hover); }
.sheet-tabs button.on { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1), inset 0 -2px 0 var(--ink); }

/* Ligação (link) */
.vw-link { padding: 16px; }
.vw-link img { width: 100%; border-radius: 16px; display: block; box-shadow: var(--shadow-2); }
.vw-link h2 { font-size: 22px; font-weight: 800; margin: 16px 0 6px; }
.vw-link p { color: var(--ink-2); margin: 0 0 14px; }
.vw-link .url { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--ink-3); word-break: break-all; margin-bottom: 16px; display: block; }
.vw-generic { padding: 40px 24px; text-align: center; color: var(--ink-2); }
.vw-generic .type-badge { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 16px; } .vw-generic .type-badge .ic { width: 34px; height: 34px; }
.vw-frame { width: 100%; height: calc(100% - 4px); border: 0; display: block; background: #fff; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; align-items: center; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: color-mix(in srgb, var(--grafite) 92%, transparent); color: var(--marfim); font-size: 13.5px; box-shadow: var(--shadow-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: toastIn .32s var(--ease-out) both; max-width: 90vw; }
.toast .ic { width: 17px; height: 17px; color: #33C2BC; }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

.only-mobile { display: none !important; }

/* =========================================================
   Telemóvel: ecrãs empilhados
   ========================================================= */
@media (max-width: 860px) {
  body { font-size: 15px; }
  .only-mobile { display: inline-grid !important; }
  .hide-mobile { display: none !important; }
  .login { padding: 18px 18px 28px; }
  .login-grid { grid-template-columns: 1fr; gap: 22px; margin-top: 18px; align-items: start; }
  .login-title { margin-bottom: 16px; }
  .login-tuner { width: 520px; height: 520px; right: -200px; bottom: -160px; }
  .login-card { padding: 22px 20px 16px; }
  .wv-sym { width: 24%; top: 9%; }
  .wv-logo { top: 27%; width: 58%; }
  .wv-play { width: 46px; height: 46px; margin-top: 4%; }
  .wv-bar { left: 10px; right: 10px; bottom: 10px; padding: 8px 12px; }
  .wv-track, .wv-time { display: none; }
  .wv-label, .wv-chip { white-space: nowrap; }
  .wv-chip { margin-left: auto; }

  .app { display: block; padding: 0; max-width: 100%; }
  .app > .rail, .app > .col-projects, .app > .col-main, .app > .col-viewer { position: absolute; inset: 0; border-radius: 0; max-width: 100%; }
  .rail { flex-direction: row; align-items: center; height: 64px; inset: 0 0 auto 0 !important; padding: 10px 8px; z-index: 3; gap: 6px; border-width: 0 0 1px 0; padding-top: max(10px, env(safe-area-inset-top)); max-width: 100%; background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--shadow-1); }
  .rail, .rail .menu, .rail .menu > li, .rail .menu-item, .rail .icon-btn { overflow: visible !important; }
  .rail .menu { display: flex; flex-direction: row; align-items: center; gap: 2px; margin: 0; flex: 0 0 auto; min-width: max-content; }
  .so-largo { display: none !important; }
  .rail .logo-word { display: none; }
  .rail-logo { padding: 0 2px; flex: none; }
  .rail .rail-user { display: none; }
  .rail .menu-item { position: relative; width: 36px; height: 36px; padding: 0; justify-content: center; gap: 0; overflow: visible; }
  .rail .menu-item span, .rail .exp-tag { display: none; }
  .rail .menu-item.active { box-shadow: var(--shadow-1), inset 0 -2px 0 var(--accent); }
  .rail .menu-item .badge { position: absolute; top: -6px; right: -7px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; z-index: 2; box-shadow: 0 0 0 2px var(--bg); }
  #btnAgendaMob { display: none !important; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row !important; flex: none; gap: 2px; }
  .rail-foot .icon-btn { width: 36px; height: 36px; }
  .rail-foot > #btnPerfil, .rail-foot > #btnLixeira, .rail-foot > .theme-toggle { display: none !important; }
  .rail-ajustes { display: block; position: relative; }
  #btnAjustes { position: relative; }
  #btnAjustes[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
  .ajustes-menu { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; min-width: 188px; padding: 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-2), 0 24px 60px -24px rgba(0,0,0,.55); }
  .ajustes-menu button, .ajustes-menu a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--ink); text-align: left; }
  .ajustes-menu button .ic, .ajustes-menu a .ic { width: 18px; height: 18px; color: var(--ink-2); }
  .ajustes-menu button:hover, .ajustes-menu button:focus-visible, .ajustes-menu a:hover, .ajustes-menu a:focus-visible { background: var(--hover); outline: none; }
  .ajustes-menu button:hover .ic, .ajustes-menu a:hover .ic, .ajustes-menu a[aria-current="page"] { color: var(--accent); }
  .ajuste-n { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--ink-3); color: var(--bg); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
  .login, .welcome, .ag-body, .thread { overflow-x: hidden; }
  .login-grid, .wl-inner, .relogios, .relogio, .dv-card, .agenda, .ag-head, .chat, .chat-head, .composer, .composer-wrap { min-width: 0; max-width: 100%; }
  .app[data-viewer="1"] .logo-word { opacity: 1; width: auto; }
  .col-main { top: 64px !important; border-radius: 0; }
  .welcome { padding: 28px 20px; align-items: start; }
  .welcome .avatar.xl { --s: 76px; }
  .wl-sub { font-size: 15px; }
  .col-projects, .col-viewer { z-index: 4; transform: translateX(100%); opacity: 1; transition: transform var(--t-slow) var(--ease-out); background: var(--bg); border: 0; }
  .app[data-sala="1"] .col-projects { transform: none; }
  .app[data-project]:not([data-project=""]) .col-projects { transform: translateX(-22%); }
  .app[data-viewer="1"] .col-viewer { transform: none; z-index: 6; }
  .cp-head, .search, .project-list { min-width: 0; }
  .cp-head { padding-top: max(18px, env(safe-area-inset-top)); }
  .chat { position: absolute; inset: 0; z-index: 5; border: 0; border-radius: 0; background: var(--bg); animation: slideIn .38s var(--ease-out) both; }
  @keyframes slideIn { from { transform: translateX(100%); } }
  .col-main:has(.chat:not([hidden])) { top: 0 !important; z-index: 5; }
  .chat-head { border-radius: 0; flex-wrap: wrap; padding: 10px 12px; gap: 10px; padding-top: max(10px, env(safe-area-inset-top)); }
  .tabs { width: 100%; order: 5; }
  .tab { flex: 1; justify-content: center; }
  .thread { padding: 10px 12px; }
  .msg-col { max-width: 84%; }
  .att-media, .att-file, .att-link, .att-audio { width: 270px; }
  .composer-wrap { padding: 6px 10px max(10px, env(safe-area-inset-bottom)); }
  .library { padding: 12px; }
  .lib-row { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .lib-from { display: none; }
  .lib-when { grid-column: 2; text-align: left; align-items: flex-start; flex-direction: row; gap: 10px; margin-top: -8px; }
  .vw-head, .vw-body { min-width: 0; }
  .vw-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .pdf { grid-template-columns: 1fr; }
  .pdf-thumbs { display: none; }
  .rec-note { display: none; }
}

/* =========================================================
   Movimento reduzido: sem deslocações nem escalas
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .rec-dot { animation: none; }
}

/* ---------- Dóvia · assistente IA ---------- */
.avatar-ia { background: radial-gradient(120% 120% at 30% 20%, #1b1b1b, #000) !important; color: #fff; box-shadow: 0 0 0 1px var(--accent-line), 0 0 0 3px var(--surface-solid), 0 0 18px -4px rgba(0,158,152,.55); }
.avatar-ia .ia-sym { width: 66%; height: 66%; display: block; }
.avatar-ia .ia-acc { fill: var(--accent); }
.msg.ia .bubble { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bubble-other)), var(--bubble-other)); border-color: var(--accent-line); animation: doviaBrilho 2.8s ease-in-out infinite; }
.msg.ia .bubble::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--accent); opacity: .8; }
@keyframes doviaBrilho {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,158,152,.28), 0 0 10px -6px rgba(0,158,152,.35); }
  50% { box-shadow: 0 0 0 1px #009E98, 0 0 16px -2px rgba(0,158,152,.72); }
}
.msg.para-dovia .bubble { border-color: #009E98; animation: none; box-shadow: none; }
.msg.me.para-dovia .bubble { box-shadow: inset 0 0 0 1.5px #009E98; }
.composer.a-dovia, .composer.a-dovia:focus-within { border-color: #009E98; box-shadow: inset 0 0 0 1.5px #009E98; }
.cmp-dovia.on { color: #009E98; box-shadow: inset 0 0 0 1.5px #009E98; }
.emoji-pop { position: absolute; left: 18px; bottom: calc(100% - 8px); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: min(320px, calc(100% - 36px)); padding: 8px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-2); z-index: 6; }
.emoji-pop button { height: 40px; border-radius: 10px; font-size: 22px; line-height: 1; }
.emoji-pop button:hover, .emoji-pop button:focus-visible { background: var(--accent-soft); }
.agm-ev.privado { border-left-color: color-mix(in srgb, var(--ink) 35%, transparent); background: color-mix(in srgb, var(--ink) 6%, var(--accent-soft)); }
.agm-ev.alheio { border-left-color: #C4A574; background: color-mix(in srgb, #C4A574 22%, transparent); }
.agl-item.privado { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ink) 28%, transparent); }
.agl-item.alheio, .lb-item.alheio { box-shadow: inset 3px 0 0 #C4A574; }
.lb-item.privado { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ink) 28%, transparent); }
.ia-tag { font: 700 9.5px/1 var(--f-display); letter-spacing: .08em; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 6px; padding: 3px 5px 2px; align-self: center; }
.mention { color: var(--accent); font-weight: 600; background: var(--accent-soft); border-radius: 6px; padding: 0 4px; }
.msg.me .mention { background: rgba(0,158,152,.16); color: #00736F; }
html[data-theme="claro"] .msg.me .mention { color: #2BC7C0; background: rgba(0,158,152,.22); }
.typing-b { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; }
.typing-b .dots { display: inline-flex; gap: 4px; }
.typing-b .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: iaDot 1.1s ease-in-out infinite; }
.typing-b .dots i:nth-child(2) { animation-delay: .15s; } .typing-b .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes iaDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
.mention-sug { position: absolute; left: 18px; bottom: calc(100% - 26px); min-width: 320px; max-width: calc(100% - 36px); padding: 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  opacity: 0; transform: translateY(6px) scale(.98); transform-origin: bottom left; transition: opacity .18s var(--ease-out), transform .18s var(--ease-out); z-index: 5; }
.mention-sug.on { opacity: 1; transform: none; }
.ms-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 11px; text-align: left; color: var(--ink); }
.ms-opt.sel, .ms-opt:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.ms-opt > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ms-opt b { font-family: var(--f-display); font-size: 13.5px; }
.ms-opt small { font-size: 11.5px; color: var(--ink-3); }
.ms-opt kbd { font: 600 10.5px/1 var(--f-body, inherit); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; }
@media (max-width: 860px) { .mention-sug { left: 10px; min-width: 0; right: 10px; } }
@media (prefers-reduced-motion: reduce) { .typing-b .dots i { animation: none; opacity: .8; } .mention-sug { transition: none; } .msg.ia .bubble { animation: none; } }
@media (max-width: 860px) { .emoji-pop { left: 10px; right: 10px; width: auto; } }

/* ---------- Diálogos (vídeo de boas-vindas, recuperar acesso, perfil) ---------- */
.dlg { border: 0; padding: 18px; width: min(92vw, 860px); max-width: none; max-height: 90vh; max-height: 90dvh; overflow: auto; color: var(--ink); border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); }
.dlg-sm { width: min(92vw, 430px); padding: 22px; }
.dlg::backdrop { background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg[open] { animation: dlgIn .32s var(--ease-out) both; }
.dlg[open]::backdrop { animation: veuIn .3s ease both; }
.dlg.saindo { animation: dlgOut .2s var(--ease) forwards; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes dlgOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.dlg-head h3 { margin: 0; font: 800 19px/1.2 var(--f-display); }
.dlg-form { display: flex; flex-direction: column; gap: 14px; }
.dlg-form p { margin: 0; font-size: 13.5px; }
.rec-msg { min-height: 1em; font-size: 13px !important; }
.rec-msg.ok { color: var(--accent); } .rec-msg.erro { color: var(--danger); }
.perfil .pf-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.perfil .pf-top .avatar.xl { --s: 64px; }
.perfil .pf-top b { display: block; font: 800 19px/1.2 var(--f-display); }
.perfil .handle { color: var(--accent); font-weight: 600; font-size: 14px; }
@media (max-width: 860px) {
  .login-veu { background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 30%, rgba(0,0,0,.05) 55%, rgba(0,0,0,.35) 100%); }
  html[data-theme="claro"] .login-veu { background: linear-gradient(180deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,.15) 30%, rgba(255,255,255,.6) 60%, rgba(255,255,255,.85) 100%); }
  .login-lema { font-size: 14px; margin-bottom: 16px; }
  .dlg { padding: 12px; } .dlg-sm { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .dlg[open], .dlg.saindo, .dlg[open]::backdrop, .login.aparecer .login-card, .login.aparecer .login-intro > *, .login.aparecer .login-top, .login.aparecer .login-veu { animation: none; }
  .vb-play::after { animation: none; opacity: 0; }
}
@media (max-width: 860px) { .login-card { background: color-mix(in srgb, var(--surface-solid) 38%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); } }

/* =========================================================
   AGENDA
   ========================================================= */
.badge.soft { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.agenda { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; animation: rise .4s var(--ease-out) both; }
.ag-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px 10px; flex-wrap: wrap; }
.ag-tit { flex: 1; min-width: 180px; }
.ag-tit .eyebrow { margin: 0 0 2px; }
.ag-tit h2 { margin: 0; font: 800 26px/1.15 var(--f-display); letter-spacing: -.01em; }
.ag-nav { display: flex; align-items: center; gap: 4px; }
.ag-hoje { height: 36px; padding: 0 14px; font-size: 13.5px; }
.ag-vista { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.ag-vista .ic { width: 17px; height: 17px; }
.ag-vista[aria-selected="true"] { color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-1); }
.ag-vista[aria-selected="true"] .ic { color: var(--accent); }
.ag-novo { height: 40px; padding: 0 16px; }
.ag-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--hover); border: 1px solid var(--line); white-space: nowrap; }
.ag-chip .ic { width: 14px; height: 14px; }
.ag-chip.ok { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.ag-body { flex: 1; min-height: 0; overflow: auto; padding: 0 22px 22px; }
.agm { display: flex; flex-direction: column; min-height: 100%; }
.agm-sem { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 4px 0 8px; }
.agm-sem span { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-left: 8px; }
.agm-grelha { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(104px, 1fr); gap: 6px; }
.agm-dia { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 55%, transparent); border: 1px solid var(--line); min-width: 0; overflow: hidden;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease); }
.agm-dia[role="button"] { cursor: pointer; }
.agm-dia[role="button"]:hover { border-color: var(--accent-line); background: var(--surface-solid); }
.agm-dia[role="button"]:hover::after { content: "+"; position: absolute; right: 9px; top: 5px; color: var(--accent); font-weight: 700; font-size: 16px; }
.agm-dia.fora { opacity: .38; }
.agm-num { font: 700 13px/1 var(--f-display); color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin: -3px 0 2px -3px; }
.agm-dia.hoje { border-color: var(--accent-line); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 24px -10px rgba(0,158,152,.6); }
.agm-dia.hoje .agm-num { background: var(--accent); color: #000; }
.agm-ev { display: block; width: 100%; text-align: left; font-size: 12px; font-weight: 600; line-height: 1.25; padding: 4px 7px; border-radius: 8px; color: var(--ink);
  background: var(--accent-soft); border-left: 2px solid var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--t) var(--ease), transform var(--t) var(--ease); }
.agm-ev i { font-style: normal; color: var(--accent); margin-right: 5px; font-variant-numeric: tabular-nums; }
.agm-ev:hover { background: rgba(0,158,152,.26); transform: translateX(2px); }
.agm-ev.passado { opacity: .55; border-left-color: var(--ink-3); background: var(--hover); }
.agm-ev.passado i { color: var(--ink-3); }
.agm-mais { font-size: 11.5px; color: var(--ink-3); padding-left: 6px; }
.agl-dia { margin: 18px 0 8px; font: 700 12px/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.agl-dia:first-child { margin-top: 4px; }
.agl-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agl-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; text-align: left; background: color-mix(in srgb, var(--surface-solid) 60%, transparent); border: 1px solid var(--line);
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.agl-item:hover { border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.agl-hora { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding-right: 14px; border-right: 2px solid var(--accent); font-variant-numeric: tabular-nums; }
.agl-hora b { font: 800 16px/1.1 var(--f-display); } .agl-hora small { color: var(--ink-3); font-size: 12px; }
.agl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agl-txt b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .agl-txt small { color: var(--ink-3); font-size: 12.5px; }
.agl-who { display: flex; } .agl-who .avatar + .avatar { margin-left: -8px; }
.agl-ind { color: var(--accent); display: grid; } .agl-ind .ic { width: 17px; height: 17px; }
/* detalhe do evento */
.dlg-evento .dlg-head .eyebrow { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--accent); }
.dlg-evento .dlg-head .eyebrow .ic { width: 15px; height: 15px; }
.ev-tit { margin: 0 0 14px; font: 800 24px/1.15 var(--f-display); }
.ev-linhas { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ev-linhas > li { display: flex; gap: 12px; align-items: flex-start; }
.ev-linhas > li > .ic { width: 19px; height: 19px; color: var(--accent); margin-top: 2px; flex: none; }
.ev-linhas li > span { display: flex; flex-direction: column; } .ev-linhas b { font-size: 14.5px; } .ev-linhas small { color: var(--ink-3); font-size: 12.5px; }
.ev-part { flex-direction: row !important; flex-wrap: wrap; gap: 10px 16px; }
.ev-p { display: inline-flex; align-items: center; gap: 8px; } .ev-p > span { display: flex; flex-direction: column; line-height: 1.2; }
.ev-nota { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--hover); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.ev-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ev-origem { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin: 0 0 12px; } .ev-origem .ic { width: 15px; height: 15px; color: var(--accent); }
.ev-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.ev-acts .btn { height: 38px; padding: 0 14px; font-size: 13.5px; }
.danger-t { color: var(--danger) !important; } .danger-t.confirmar { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.ed-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.dlg .field select, .dlg .field textarea { border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface-solid); padding: 11px 14px; font-size: 14.5px; color: var(--ink); width: 100%; resize: vertical; }
.dlg .field select { height: 48px; padding: 0 12px; }
.dlg .field select:focus, .dlg .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ed-part { border: 0; margin: 0; padding: 0; } .ed-part > div { display: flex; flex-direction: column; gap: 8px; }
.ed-p { font-weight: 500; color: var(--ink); } .ed-p small { color: var(--ink-3); }
.ed-acts { display: flex; justify-content: flex-end; gap: 8px; }
.ed-acts .btn { height: 42px; padding: 0 18px; }
/* proposta de evento da Dóvia no chat */
.evp { padding: 14px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--accent-line); box-shadow: var(--shadow-1), 0 0 30px -14px rgba(0,158,152,.6); display: flex; flex-direction: column; gap: 8px; max-width: 420px; animation: rise .35s var(--ease-out) both; }
.evp.cancelado { opacity: .6; border-color: var(--line); box-shadow: var(--shadow-1); }
.evp-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.evp-head .ic { width: 16px; height: 16px; color: var(--accent); }
.evp-estado { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--hover); color: var(--ink-2); }
.evp-estado.pend { color: var(--accent); background: var(--accent-soft); } .evp-estado.ok { color: #000; background: var(--accent); } .evp-estado .ic { width: 13px; height: 13px; color: inherit; }
.evp-tit { font: 800 17px/1.25 var(--f-display); }
.evp-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; } .evp-row .ic { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; flex: none; } .evp-row small { color: var(--ink-3); }
.evp-nota { font-size: 12px; color: var(--ink-3); }
.evp-acts { display: flex; gap: 8px; margin-top: 2px; } .evp-acts .btn { height: 38px; padding: 0 16px; font-size: 13.5px; flex: 1; }
.evp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
/* boas-vindas da Dóvia */
.dv-card { width: 100%; text-align: left; margin: 0 0 18px; padding: 16px 16px 12px; border-radius: 22px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface-solid)), var(--surface-solid) 55%); border: 1px solid var(--accent-line); box-shadow: var(--shadow-2), 0 0 50px -24px rgba(0,158,152,.7); }
.dv-card:empty { display: none; }
.dv-card::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(0,158,152,.9), transparent); }
.dvc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.dvc-head > div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.dvc-head b { font: 800 16px/1.2 var(--f-display); } .dvc-head span { font-size: 12.5px; color: var(--ink-3); }
.dvc-ola { margin: 4px 0 10px; font-size: 14.5px; color: var(--ink); }
.dvc-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dvc-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--hover); border: 1px solid var(--line); animation: rise .4s var(--ease-out) both; }
.dvc-item:nth-child(2) { animation-delay: .06s; } .dvc-item:nth-child(3) { animation-delay: .12s; } .dvc-item:nth-child(4) { animation-delay: .18s; } .dvc-item:nth-child(5) { animation-delay: .24s; }
.dvc-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.dvc-ic .ic { width: 18px; height: 18px; }
.dvc-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dvc-item small { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.dvc-item b { font-size: 14px; font-weight: 600; } .dvc-item span { font-size: 12.5px; color: var(--ink-3); }
.dvc-go { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease); }
.dvc-go:hover { background: var(--accent); color: #000; transform: translateX(2px); } .dvc-go .ic { width: 16px; height: 16px; }
.dvc-item.loading b { background: linear-gradient(90deg, var(--line) 0%, var(--line-2) 50%, var(--line) 100%); background-size: 200% 100%; color: transparent; border-radius: 6px; animation: shimmer 1s linear infinite; }
.dvc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.dvc-foot .link { font-size: 12px; background: none; border: 0; cursor: pointer; padding: 0; white-space: nowrap; }
.welcome .wl-inner { padding-bottom: 20px; }
@media (max-width: 860px) {
  .ag-head { padding: 12px 14px 8px; gap: 10px; }
  .ag-tit h2 { font-size: 21px; }
  .ag-novo span { display: none; } .ag-novo { width: 40px; padding: 0; justify-content: center; }
  .ag-vistas { order: 5; }
  .ag-body { padding: 0 10px 18px; }
  .agm-grelha { grid-auto-rows: minmax(64px, 1fr); gap: 3px; }
  .agm-sem { gap: 3px; } .agm-sem span { padding-left: 2px; font-size: 10px; letter-spacing: .02em; text-align: center; }
  .agm-dia { padding: 4px; border-radius: 9px; align-items: center; }
  .agm-num { margin: 0 0 2px; font-size: 12px; }
  .agm-ev { font-size: 0; height: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--accent); }
  .agm-ev.privado { background: color-mix(in srgb, var(--ink) 45%, transparent); }
  .agm-ev.alheio { background: #C4A574; }
  .agm-ev i { display: none; }
  .agm-mais { font-size: 10px; padding: 0; }
  .agl-who { display: none; }
  .ed-grid { grid-template-columns: 1fr 1fr; } .ed-grid .field:first-child { grid-column: 1 / -1; }
  .dvc-foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .agenda, .evp, .dvc-item { animation: none; } }

/* ---------- Base de dados: mensagens anteriores, estados de envio ---------- */
.mais-antigas { display: flex; justify-content: center; padding: 10px 0 4px; }
.mais-antigas .btn { font-size: 13px; }
#btnEntrar.loading { opacity: .7; pointer-events: none; }
#dlgTrocar .field-hint { display: block; margin: -4px 0 8px; }

/* ---------- Relógios da home interior (Juiz de Fora · Castelo Branco) ---------- */
.relogios { display: flex; justify-content: center; gap: clamp(20px, 5vw, 56px); margin: 6px auto 26px; flex-wrap: wrap; }
.relogio { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text, #fff); }
.rl-face { width: clamp(132px, 15vw, 172px); height: auto; overflow: visible; }
.rl-aro { fill: none; stroke: currentColor; stroke-opacity: .22; stroke-width: .7; }
.rl-mm { stroke: currentColor; stroke-opacity: .28; stroke-width: .5; stroke-linecap: round; }
.rl-mh { stroke: currentColor; stroke-opacity: .85; stroke-width: 1.1; stroke-linecap: round; }
.rl-h { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.rl-m { stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.rl-s line { stroke: #009E98; stroke-width: .6; stroke-linecap: round; }
.rl-s circle, .rl-c { fill: #009E98; }
.rl-c { stroke: var(--bg, #000); stroke-width: .8; }
.relogio figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.rl-cid { font-weight: 700; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.rl-pais { font-size: 11.5px; opacity: .55; letter-spacing: .04em; }
.rl-dig { font-size: 26px; font-weight: 300; letter-spacing: .04em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.rl-dig::after { content: ''; display: block; width: 18px; height: 1px; background: #009E98; margin: 6px auto 0; }
.rl-dia { font-size: 12px; opacity: .6; }
[data-theme="claro"] .relogio { color: #000; }
[data-theme="escuro"] .relogio { color: #fff; }
@media (max-width: 520px) {
  .relogios { gap: 12px; width: 100%; }
  .relogio { flex: 1 1 0; min-width: 0; }
  .rl-face { width: min(118px, 38vw); }
  .rl-cid { letter-spacing: .08em; }
  .rl-dig { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .rl-s { display: none; } }

/* =========================================================
   PROJETOS · gestão (novo, ⋯ editar/arquivar, arquivados, estado vazio)
   ========================================================= */
[data-tom] { --tom: #009E98; }
.proj-tile[data-tom] { background: linear-gradient(150deg, color-mix(in srgb, var(--tom) 24%, var(--bg-2)), var(--bg-2) 78%);
  border-color: color-mix(in srgb, var(--tom) 38%, var(--line-2)); color: color-mix(in srgb, var(--tom) 46%, var(--ink)); }
[data-tom="turquesa"] { --tom: #009E98; } [data-tom="azul"] { --tom: #3E74B5; } [data-tom="salvia"] { --tom: #6F9A79; }
[data-tom="terra"] { --tom: #C07A4E; } [data-tom="ameixa"] { --tom: #946294; } [data-tom="grafite"] { --tom: #8E8E8A; }
.project.active .proj-tile[data-tom] { border-color: var(--accent-line); }
.proj-tile.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }

.cp-tools { display: flex; align-items: center; gap: 8px; margin: 4px 16px 10px; min-width: 268px; }
.cp-tools .search { margin: 0; flex: 1; min-width: 0; }
.pj-novo { height: 40px; padding: 0 14px 0 11px; border-radius: 12px; font-size: 13.5px; gap: 6px; flex: none; white-space: nowrap; }
.pj-novo .ic { width: 18px; height: 18px; stroke-width: 2.2; }

.project { position: relative; }
.pj-mais { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent); border: 1px solid var(--line); opacity: 0; transform: scale(.9);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), color var(--t), border-color var(--t); }
.pj-mais .ic { width: 18px; height: 18px; }
.project:hover .pj-mais, .project:focus-within .pj-mais, .project.active .pj-mais, .pj-mais[aria-expanded="true"] { opacity: 1; transform: none; }
.pj-mais:hover, .pj-mais[aria-expanded="true"] { color: var(--accent); border-color: var(--accent-line); }
.project:hover .pj-top time, .project:focus-within .pj-top time, .project.active .pj-top time { visibility: hidden; }
@media (hover: none) { .pj-mais { opacity: 1; transform: none; top: auto; bottom: 10px; background: transparent; border-color: transparent; } .project .pj-top time { visibility: visible !important; } .project .pj-last, .project .pj-desc { padding-right: 26px; } }

.pj-menu { position: fixed; z-index: 60; min-width: 200px; padding: 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-2), 0 24px 60px -24px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; transition: opacity .16s var(--ease), transform .2s var(--ease-out); }
.pj-menu.on { opacity: 1; transform: none; }
.pj-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 11px; font-size: 14px; font-weight: 500; color: var(--ink); text-align: left; }
.pj-menu button .ic { width: 18px; height: 18px; color: var(--ink-2); }
.pj-menu button:hover, .pj-menu button:focus-visible { background: var(--hover); outline: none; }
.pj-menu button[data-acao="editar"]:hover .ic { color: var(--accent); }
.pj-menu .danger-t .ic { color: var(--danger); }

/* Estado vazio */
.pj-vazio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 18px 30px; animation: rise .45s var(--ease-out) both; }
.pj-vazio-art { width: 150px; height: auto; color: var(--ink); margin-bottom: 6px; }
.pj-vazio b { font: 800 18px/1.2 var(--f-display); }
.pj-vazio span { font-size: 13.5px; color: var(--ink-2); max-width: 260px; line-height: 1.5; }
.pj-vazio .btn { margin-top: 10px; height: 44px; font-size: 14px; }
.pj-vazio .btn span { color: inherit; max-width: none; }
.col-projects.sem-projetos .cp-tools .search { opacity: .5; pointer-events: none; }

/* Arquivados */
.pj-acao { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background var(--t), color var(--t); }
.pj-acao .ic { width: 18px; height: 18px; }
.pj-acao:hover { background: var(--accent-soft); color: var(--accent); }
.pj-acao.danger:hover { background: rgba(208,85,59,.12); color: var(--danger); }
.pj-acao:disabled { opacity: .4; }

/* Modal do projeto */
.dlg-proj { width: min(92vw, 480px); }
.pjf-tit { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pjf-tit .eyebrow { margin: 0 0 3px; color: var(--accent); }
.pjf-tit h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pjf-tit .proj-tile { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; transition: background var(--t-slow) var(--ease), color var(--t-slow), border-color var(--t-slow); }
.pjf-lab { display: flex; justify-content: space-between; align-items: baseline; }
.pjf-lab small { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pjf-linha { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.pjf-sigla input { text-transform: uppercase; text-align: center; font: 800 16px/1 var(--f-display); letter-spacing: .06em; }
.pjf-tons { border: 0; margin: 0; padding: 0; min-width: 0; }
.pjf-tons > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 48px; }
.pj-tom { position: relative; cursor: pointer; }
.pj-tom input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.pj-tom i { display: block; width: 32px; height: 32px; border-radius: 11px; background: linear-gradient(150deg, var(--tom), color-mix(in srgb, var(--tom) 55%, var(--bg-2)));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 0 2px transparent; transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
.pj-tom:hover i { transform: translateY(-1px); }
.pj-tom input:checked + i { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--tom); }
.pj-tom input:focus-visible + i { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--accent), 0 0 0 7px var(--accent-soft); }
.ed-p.fixo { opacity: .8; cursor: default; }
.pjf-acts { flex-wrap: wrap; }
.pjf-arq { margin-right: auto; padding: 0 12px !important; }

/* Confirmação de arquivo / apagamento */
.rm-avisos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rm-avisos li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--hover); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.rm-avisos li b { color: var(--ink); font-weight: 600; }
.rm-avisos .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--ink-2); }
.rm-avisos li.ok { background: var(--accent-soft); border-color: var(--accent-line); } .rm-avisos li.ok .ic { color: var(--accent); }
.rm-avisos li.perigo { background: rgba(208,85,59,.1); border-color: rgba(208,85,59,.4); } .rm-avisos li.perigo .ic { color: var(--danger); }
#rmNomeLab b { color: var(--ink); }
.rm-ok { height: 42px; padding: 0 18px; gap: 8px; font-size: 14.5px; color: var(--danger); border: 1px solid rgba(208,85,59,.45); background: transparent; transition: background var(--t), color var(--t), opacity var(--t); }
.rm-ok .ic { width: 18px; height: 18px; }
.rm-ok:hover:not(:disabled) { background: rgba(208,85,59,.1); }
.rm-ok.confirmar, .rm-ok.perigo:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.rm-ok:disabled { opacity: .45; cursor: not-allowed; }
.agl-arq { font-style: normal; color: var(--ink-3); }

@media (max-width: 860px) {
  .cp-tools { min-width: 0; }
  .pjf-linha { grid-template-columns: 84px 1fr; }
  .dlg-proj { width: min(96vw, 480px); }
  .pjf-acts .btn { flex: 1; } .pjf-arq { flex-basis: 100%; order: 3; margin: 4px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .pj-menu, .pj-mais, .pj-tom i, .pjf-tit .proj-tile { transition: none; } .pj-vazio, .project.entrar { animation: none; } }
.pj-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-vazio { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 20px; animation: rise .45s var(--ease-out) both; }
.th-vazio .proj-tile { width: 60px; height: 60px; border-radius: 19px; font-size: 18px; margin-bottom: 8px; }
.th-vazio b { font: 800 18px/1.25 var(--f-display); }
.th-vazio span:not(.proj-tile) { font-size: 13.5px; color: var(--ink-2); max-width: 320px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .th-vazio { animation: none; } }

/* =========================================================
   t127 · Fundo de mapa, fotos de avatar, perfil e lixeira
   ========================================================= */
.app-mapa { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .9; }
[data-theme="claro"] .app-mapa { opacity: 1; }
.avatar.com-foto { background: var(--bg-2) !important; color: transparent; }
.avatar.com-foto img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center; display: block; user-select: none; }
.ru-txt small { overflow: hidden; text-overflow: ellipsis; }

/* Perfil */
.dlg-perfil .pf-top { margin-bottom: 4px; }
.pf-foto { position: relative; flex: none; }
.dlg-perfil .pf-top .pf-foto .avatar.xl { --s: 76px; box-shadow: 0 0 0 4px var(--surface-solid), 0 14px 34px -16px rgba(0,0,0,.5); font-size: 26px; }
.pf-cam { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: #000; box-shadow: 0 0 0 3px var(--surface-solid); transition: transform var(--t) var(--ease); }
.pf-cam:hover { transform: scale(1.06); }
.pf-cam .ic { width: 15px; height: 15px; }
.pf-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-id b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-foto-acts { display: flex; gap: 14px; margin-top: 8px; }
.pf-foto-acts .link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }
.dlg-perfil.a-enviar .pf-foto .avatar { opacity: .45; }
.dlg-perfil.a-enviar .pf-foto::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: pfGira .8s linear infinite; }
@keyframes pfGira { to { transform: rotate(360deg); } }
.pf-acts { align-items: center; flex-wrap: wrap; }
.pf-acts .pf-senha { margin-right: auto; padding: 0 12px !important; }
.pf-acts .pf-senha .ic { width: 17px; height: 17px; }

/* Lixeira */
#btnLixeira { position: relative; }
.lx-n { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; background: var(--ink-3); color: var(--bg); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.lx-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lx-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 12px; border-radius: 16px; background: var(--hover); border: 1px solid var(--line); }
.lx-item .proj-tile { opacity: .75; filter: saturate(.6); }
.lx-txt b { display: block; font: 700 14.5px/1.25 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-txt small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-acts { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.lx-acts .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.lx-acts .btn .ic { width: 16px; height: 16px; }
.lx-apagar:hover { color: var(--danger); border-color: rgba(181,84,63,.4); }
.lx-vazio { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 0 18px; color: var(--ink-3); font-size: 13.5px; }
.lx-vazio .ic { width: 30px; height: 30px; stroke-width: 1.3; }
@media (prefers-reduced-motion: reduce) { .dlg-perfil.a-enviar .pf-foto::after { animation-duration: 2.4s; } .pf-cam { transition: none; } }
@media (max-width: 520px) { .pf-acts { flex-wrap: nowrap; } .pf-acts [data-fechar].btn { display: none; } }

/* =========================================================
   t137 · Conversa com a Dovia na home, gestão de utilizadores
   ========================================================= */
.dv-bloco { width: 100%; margin: 0 0 18px; }
.dv-bloco .dv-card { margin: 0; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.dv-chat { width: 100%; margin-top: 6px; padding: 8px; border-radius: 8px 8px 22px 22px; text-align: left; box-shadow: var(--shadow-2);
  background: var(--surface-solid); border: 1px solid var(--accent-line); }
.dvx-fio { list-style: none; margin: 0 0 8px; padding: 6px 6px 2px; display: flex; flex-direction: column; gap: 8px; max-height: min(300px, 42vh); max-height: min(300px, 42dvh); overflow-y: auto; overscroll-behavior: contain; }
.dvx-m { max-width: 86%; font-size: 14px; line-height: 1.5; animation: rise .3s var(--ease-out) both; }
.dvx-m p { margin: 0; padding: 9px 13px; border-radius: 16px; overflow-wrap: anywhere; }
.dvx-m.eu { align-self: flex-end; }
.dvx-m.eu p { background: var(--accent); color: #000; border-bottom-right-radius: 6px; }
.dvx-m.ia { align-self: flex-start; }
.dvx-m.ia p { background: var(--hover); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 6px; }
.dvx-m.erro p { color: var(--danger); border-color: rgba(208,85,59,.4); }
.dvx-m.pendente { padding: 12px 14px; border-radius: 16px; background: var(--hover); border: 1px solid var(--line); }
.dvx-m .dots { display: inline-flex; gap: 4px; }
.dvx-m .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: iaDot 1.1s ease-in-out infinite; }
.dvx-m .dots i:nth-child(2) { animation-delay: .15s; } .dvx-m .dots i:nth-child(3) { animation-delay: .3s; }
.dvx-linha { display: flex; align-items: flex-end; gap: 8px; }
.dvx-linha .icon-btn { flex: none; }
.dvx-linha textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; outline: none; padding: 9px 8px; max-height: 140px; font: inherit; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.dvx-linha textarea::placeholder { color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .dvx-m { animation: none; } .dvx-m .dots i { animation: none; opacity: .8; } }

.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.sm .ic { width: 16px; height: 16px; }
.pf-users { width: 100%; justify-content: flex-start; gap: 10px; }
.pf-users .pf-seta { margin-left: auto; width: 16px; height: 16px; color: var(--ink-3); }
.us-head-acts { display: flex; align-items: center; gap: 6px; }
.us-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.us-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-align: left; background: var(--hover); border: 1px solid var(--line); color: var(--ink); }
.us-item:hover { border-color: var(--accent-line); }
.us-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.us-txt b { font: 700 14px/1.3 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-txt small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-eu { font-weight: 500; color: var(--ink-3); font-family: var(--f-body, inherit); }
.us-chips { display: flex; align-items: center; gap: 6px; flex: none; }
.us-chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; }
.us-chip.adm { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.us-chip.temp { padding: 3px 6px; } .us-chip.temp .ic { width: 13px; height: 13px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface-solid); }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 9px 8px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.seg input:checked + span { background: var(--accent); color: #000; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.uf-perigo { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line); }
.uf-perigo .btn { height: 38px; padding: 0 12px; font-size: 13px; }
.uf-perigo .btn .ic { width: 16px; height: 16px; }
.uf-perigo .btn.confirmar { background: var(--accent); color: #000; border-color: var(--accent); }
.uf-confirmar { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid rgba(208,85,59,.4); background: rgba(208,85,59,.06); }
.sn-quem { display: flex; flex-direction: column; margin-bottom: 12px; }
.sn-quem b { font: 700 15px/1.3 var(--f-display); } .sn-quem span { color: var(--accent); font-size: 13.5px; font-weight: 600; }
.sn-caixa { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 14px; border: 1px dashed var(--accent-line); background: var(--accent-soft); margin-bottom: 16px; }
.sn-caixa code { flex: 1; font: 600 18px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; overflow-wrap: anywhere; color: var(--ink); user-select: all; }
@media (max-width: 520px) { .us-item small { max-width: 52vw; } .sn-caixa code { font-size: 16px; } }

/* ===== t138 · Lembretes, avisos da Dovia e ações da Dovia ===== */
.lb-body { padding-top: 6px; }
.lb-lista { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 860px; }
.lb-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise .3s var(--ease-out) both; transition: border-color var(--t) var(--ease), opacity var(--t) var(--ease); }
.lb-item:hover { border-color: var(--line-2); }
.lb-item[data-prio="urgente"]:not(.feito) { border-color: rgba(0,158,152,.55); box-shadow: inset 4px 0 0 #009E98, 0 0 0 1px rgba(0,158,152,.18), var(--shadow-1); }
.lb-item[data-prio="alta"]:not(.feito) { box-shadow: inset 3px 0 0 color-mix(in srgb, #009E98 55%, transparent), var(--shadow-1); }
.lb-item.feito { opacity: .62; }
.lb-item.feito .lb-txt b { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.lb-check { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 1.6px solid var(--line-2); background: transparent; display: grid; place-items: center; color: transparent; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease); }
.lb-check .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.lb-check:hover { border-color: var(--accent); color: var(--accent); }
.lb-check[aria-pressed="true"], .lb-item.a-concluir .lb-check { background: var(--accent); border-color: var(--accent); color: #000; }
.lb-check.ro { border: 0; cursor: default; } .lb-check.ro .avatar { --s: 26px; }
.lb-item[data-prio="urgente"]:not(.feito) .lb-check { border-color: #009E98; }
.lb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; }
.lb-txt b { font-size: 15px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.lb-desc { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lb-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--hover); border: 1px solid var(--line); white-space: nowrap; }
.lb-chip .ic { width: 13px; height: 13px; }
.lb-chip.vencido { color: var(--danger); border-color: rgba(208,85,59,.4); background: rgba(208,85,59,.08); }
.lb-chip.prio-urgente { color: #000; background: #009E98; border-color: #009E98; font-weight: 750; letter-spacing: .02em; }
.lb-chip.prio-alta { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.lb-chip.ia .ic { color: var(--accent); }
.lb-vazio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 10px; }
.lb-vazio .ic { width: 30px; height: 30px; color: var(--accent); opacity: .7; }
#lbNotif { margin-left: auto; }
.lembretes .ag-vista .tab-count { margin-left: 2px; }
.menu-item .badge.alerta { background: #009E98; color: #000; box-shadow: 0 0 0 3px rgba(0,158,152,.25); }
.seg-prio label[data-prio="urgente"] input:checked + span { background: #009E98; color: #000; box-shadow: 0 0 0 3px rgba(0,158,152,.2); }
.lf-alerta { grid-template-columns: 1fr 1fr auto !important; align-items: end; }
.lf-limpar { margin-bottom: 4px; }
.lf-de { display: flex; align-items: center; gap: 8px; margin: -4px 0 2px; font-size: 13px; color: var(--ink-2); } .lf-de .avatar { --s: 22px; }
.lf-conf-t { margin: 0 0 8px; font-weight: 600; }
#formLembrete input:disabled:not([type=radio]), #formLembrete textarea:disabled { opacity: .8; }
/* avisos */
.lb-avisos { position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.lb-aviso { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 18px; border: 1px solid var(--accent-line); background: var(--surface-solid);
  box-shadow: 0 20px 50px -18px rgba(0,0,0,.55), 0 0 0 1px rgba(0,158,152,.12); cursor: pointer; animation: rise .35s var(--ease-out) both; }
.lb-aviso[data-prio="urgente"] { border-color: #009E98; box-shadow: inset 4px 0 0 #009E98, 0 20px 50px -18px rgba(0,0,0,.55), 0 0 30px -8px rgba(0,158,152,.55); }
.lb-aviso.sair { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.lb-aviso-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.lb-aviso-t small { font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.lb-aviso-t b { font-size: 14.5px; overflow-wrap: anywhere; } .lb-aviso-t span { font-size: 12.5px; color: var(--ink-3); }
.lb-aviso-acts { display: flex; align-items: center; gap: 4px; }
.dvc-item[data-prio="urgente"] { border-color: rgba(0,158,152,.55); box-shadow: inset 3px 0 0 #009E98; }
.dvc-item[data-prio="urgente"] .dvc-ic { background: #009E98; color: #000; }
.dvc-primeira { display: flex; flex-direction: column; gap: 6px; } .dvc-primeira .dvc-ola { margin: 0; }
/* ligações e confirmações nas mensagens da Dovia */
.lb-ref { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin-top: 6px; height: 30px; padding: 0 10px 0 9px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.lb-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lb-ref .ic { width: 14px; height: 14px; flex: none; }
.lb-ref:hover { background: rgba(0,158,152,.22); }
.dvc-conf { margin-top: 6px; }
.dvx-m .dvc-conf, .dvx-m .lb-ref { margin-top: 8px; }
.dvx-m.ia .evp { max-width: 100%; }
@media (max-width: 860px) {
  .lb-lista { gap: 6px; }
  .lb-item { padding: 11px 12px; gap: 10px; border-radius: 14px; }
  .lembretes .ag-tit { min-width: 0; }
  .lembretes .ag-vistas { order: 5; width: 100%; }
  .lembretes .ag-vista { flex: 1; justify-content: center; }
  .lb-avisos { left: 50%; right: auto; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .lb-item, .lb-aviso { animation: none; } }

.seg input, .seg input:disabled { appearance: none; -webkit-appearance: none; opacity: 0; margin: 0; }
.seg input:disabled + span { cursor: default; }

/* t141 · iPhone/iPad: o Safari do iOS faz zoom automático ao focar um campo com letra abaixo de 16 px (e não volta atrás).
   Em ecrãs tácteis e no telemóvel todos os campos ficam com 16 px. */
@media (pointer: coarse), (max-width: 820px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { font-size: 16px !important; }
}
/* t141 · coluna da home estreita (ex.: iPhone deitado na Sala, 860–1000 px): nada mais largo do que a coluna */
.welcome { container-type: inline-size; padding-inline: clamp(12px, 3vw, 40px); }
.welcome .wl-inner, .welcome .relogios, .welcome .dv-bloco { min-width: 0; max-width: 100%; }
@container (max-width: 380px) { .relogios { gap: 14px; } .rl-face { width: 104px; } .rl-cid { letter-spacing: .12em; } }

#dvMic.on { color: #000; background: var(--accent); }
#dvMic.on { animation: dvMicPulso 1.4s ease-in-out infinite; }
#dvMic.a-transcrever { color: var(--accent); background: var(--accent-soft); opacity: .75; }
@keyframes dvMicPulso { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { #dvMic.on { animation: none; } }
/* Altifalante junto ao microfone: bem visível nos dois estados (paleta #000 / #FFF / #009E98).
   Desligado: contorno teal. Ligado ou a falar: teal cheio. O ditado é sempre lido em voz; o botão vale para o texto escrito. */
#dvOuvir { flex: none; color: #009E98; background: transparent; box-shadow: inset 0 0 0 1.5px #009E98; }
#dvOuvir .so-on { display: none; }
#dvOuvir.on .so-on { display: block; } #dvOuvir.on .so-off { display: none; }
#dvOuvir.on, #dvOuvir.a-falar { color: #000; background: #009E98; box-shadow: none; }
html[data-theme="claro"] #dvOuvir.on, html[data-theme="claro"] #dvOuvir.a-falar { color: #FFF; }
#dvOuvir:hover { background: rgba(0,158,152,.14); } #dvOuvir.on:hover { background: #009E98; }
.exp-tag { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 7px; }
.app[data-viewer="1"] .exp-tag { display: none; }

.cx-quem { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.cx-quem select { height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); padding: 0 10px; }
.cx-nota { margin: 0 0 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.consumo .cx-comprar { flex: none; white-space: nowrap; }
.cx-hero { position: relative; padding: 4px 2px 2px; }
.cx-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cx-origem { font-size: 12.5px; color: var(--ink-3); text-align: right; }
.cx-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--hover); color: var(--ink-2); border: 1px solid var(--line); width: fit-content; }
.cx-tag.ativa { background: var(--accent); color: #041413; border-color: transparent; box-shadow: 0 0 18px -4px rgba(0,158,152,.85); }
.cx-tag.espera { border-style: dashed; color: var(--ink-3); background: transparent; }
.cx-tag.concluida { color: var(--ink-3); }
.cx-det .cx-hero h3 { margin: 36px 0 0; font: 800 clamp(28px, 5vw, 36px)/1.05 var(--f-display); letter-spacing: -.03em; }
.cx-hero-top { margin-bottom: 4px; }
.cx-pcts { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; }
.cx-pcts b { display: block; font: 800 clamp(36px, 8vw, 52px)/.95 var(--f-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.cx-pcts span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.cx-pcts .resta { text-align: right; }
.cx-pcts .resta b { color: var(--accent); }
.cx-barra { position: relative; height: 22px; margin: 16px 0 8px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: inset 0 1px 2px rgba(0,0,0,.25), inset 0 0 0 1px var(--line); }
.cx-vazio { position: absolute; top: 0; bottom: 0; width: 28%; border-radius: inherit; background: linear-gradient(90deg, transparent, rgba(0,158,152,.55), transparent); animation: cxVazio 2.8s ease-in-out infinite; }
.cx-cheio { position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; width: 0; border-radius: inherit; overflow: hidden; background: linear-gradient(90deg, #006e69, #00b3ab 62%, #d8fffb); box-shadow: 0 0 18px rgba(0,158,152,.85), 0 0 36px rgba(0,158,152,.45); }
.cx-cheio::after { content: ""; position: absolute; top: 0; bottom: 0; width: 38%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); animation: cxFaixa 1.8s ease-in-out infinite; }
.cx-barra.sem .cx-cheio { box-shadow: none; }
.cx-det.ativa:not(.a-abrir) { animation: cxPulso 3.4s ease-in-out infinite; }
.cx-det.a-abrir { animation: cxAbrir .55s var(--ease-out) both; transform-origin: top center; }
.cx-hero.concluida .cx-cheio { background: var(--ink-3); box-shadow: none; }
.cx-hero.concluida .cx-cheio::after, .cx-hero.concluida .cx-vazio { animation: none; opacity: 0; }
.cx-saldo { margin: 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cx-outras-lab { margin: 16px 0 8px; font: 700 12px/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cx-linha { list-style: none; margin: 0 0 16px; padding: 2px 0 8px; display: flex; gap: 10px; overflow-x: auto; }
.cx-tempo { margin-bottom: 18px; }
.cx-cap { width: 168px; flex: none; text-align: left; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); color: var(--ink); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.cx-cap.sel { border-color: var(--accent-line); box-shadow: var(--glow); transform: translateY(-2px); }
.cx-cap.a-entrar { animation: cxEntrar .55s var(--ease-out) both; }
.cx-cap.concluida { opacity: .72; }
.cx-cap.espera { border-style: dashed; }
.cx-cap b { font: 700 14px/1.2 var(--f-display); }
.cx-cap small { color: var(--ink-3); font-size: 12px; }
.cx-trilho { display: block; width: 100%; height: 8px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.cx-trilho i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; box-shadow: 0 0 10px rgba(0,158,152,.7); }
.cx-cap.concluida .cx-trilho i { background: var(--ink-3); box-shadow: none; }
.cx-det { padding: 18px 18px 16px; border-radius: 24px; border: 1px solid var(--accent-line); background:
  radial-gradient(120% 80% at 0% 0%, rgba(0,158,152,.16), transparent 52%),
  color-mix(in srgb, var(--surface-solid) 82%, transparent);
  box-shadow: var(--shadow-2), 0 0 48px -22px rgba(0,158,152,.75);
  display: flex; flex-direction: column; gap: 12px; }
.cx-det h3 { margin: 0; }
.cx-meta { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.cx-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cx-nums-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cx-ajuda { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink-3); font: 700 14px/1 var(--f-display); display: grid; place-items: center; }
.cx-ajuda:hover { color: var(--ink); border-color: var(--accent-line); background: var(--accent-soft); }
.cx-nums div, .cx-tipo { padding: 10px 12px; border-radius: 12px; background: var(--hover); border: 1px solid var(--line); }
.cx-nums b, .cx-tipo b { display: block; font: 700 15px/1.2 var(--f-display); }
.cx-nums span, .cx-tipo span { font-size: 12px; color: var(--ink-3); }
.cx-tipos { display: flex; flex-direction: column; gap: 6px; }
.cx-tipo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cx-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-relatorio { height: 46px; padding: 0 18px; }
.cx-relatorio .ic { width: 18px; height: 18px; }
.cx-crit-btn { margin-left: auto; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.cx-crit-btn:hover { color: var(--ink-2); background: var(--hover); }
.cx-rel { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); }
.cx-rel h3, .cx-rel h4 { margin: 8px 0 0; font: 750 15px/1.3 var(--f-display); }
.cx-rel p, .cx-crit p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.cx-crit { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.cx-crit:first-child { border-top: 0; padding-top: 0; }
.cx-crit b { font: 750 15px/1.3 var(--f-display); color: var(--ink); }
.cx-crit-lista { max-height: min(62vh, 520px); overflow: auto; padding-right: 4px; }
.cx-aviso { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); }
.cx-anel { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); margin: 18px auto 8px; animation: pfGira .8s linear infinite; }
.cx-proc, #cxPasso3 p { text-align: center; }
.cx-feito { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.cx-feito h3 { margin: 4px 0 0; font: 800 28px/1.1 var(--f-display); }
.cx-feito-n { margin: 0; font: 800 22px/1 var(--f-display); color: var(--accent); }
.cx-feito-ref { margin: 0; font-size: 13px; color: var(--ink-3); }
.cx-loja { display: flex; align-items: center; gap: 18px; padding: 8px 0 16px; }
.cx-loja-txt { display: flex; flex-direction: column; min-width: 0; }
.cx-loja-txt b { font: 800 36px/1 var(--f-display); letter-spacing: -.03em; }
.cx-loja-txt span { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.cx-loja-txt p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.cx-sug p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.cx-sug ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cx-sug li { font-size: 14px; color: var(--ink); }
.cx-sug b { font: 750 15px/1.2 var(--f-display); letter-spacing: 0; }
.cx-sug-nota { color: var(--ink-3) !important; font-size: 12px !important; }
.cx-loja-nota { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--ink-3); }
.cx-frasco { position: relative; width: 92px; height: 148px; flex: none; border-radius: 46px; overflow: hidden; border: 1px solid var(--accent-line);
  background: radial-gradient(circle at 32% 18%, rgba(255,255,255,.45), transparent 36%), linear-gradient(180deg, rgba(0,158,152,.12), rgba(0,158,152,.28));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 0 36px -8px rgba(0,158,152,.75); }
.cx-frasco i { position: absolute; left: 7px; right: 7px; bottom: 7px; height: 58%; border-radius: 0 0 40px 40px; background: linear-gradient(180deg, #d8fffb, #00b3ab 45%, #00756f); box-shadow: 0 0 22px rgba(0,158,152,.85); }
.cx-frasco i::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: linear-gradient(180deg, rgba(255,255,255,.75), transparent); animation: cxOnda 2.2s ease-in-out infinite; }
.cx-frasco.ok { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 0 42px -4px rgba(0,158,152,.9); }
.cx-frasco.a-espera { margin: 8px auto 0; opacity: .85; }
.cx-voltar { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.cx-voltar .ic { width: 16px; height: 16px; }
.cx-equipa { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.cx-eq-nome { display: inline-flex; font: 750 18px/1.2 var(--f-display); margin-bottom: 8px; }
.cx-equipa .btn { align-self: flex-start; }
@keyframes cxAbrir { from { opacity: 0; transform: translateY(18px) scale(.97); filter: brightness(1.35); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cxEntrar { from { opacity: 0; transform: translateX(22px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes cxOnda { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes cxFaixa { from { transform: translateX(-130%); } to { transform: translateX(320%); } }
@keyframes cxVazio { from { transform: translateX(-130%); } to { transform: translateX(420%); } }
@keyframes cxPulso {
  0%, 100% { box-shadow: var(--shadow-2), 0 0 28px -16px rgba(0,158,152,.45); }
  50% { box-shadow: var(--shadow-2), 0 0 46px -8px rgba(0,158,152,.8); }
}
@media (max-width: 860px) {
  .cx-nums { grid-template-columns: 1fr; }
  .consumo .ag-head { flex-wrap: nowrap; }
  .consumo .ag-tit { min-width: 0; flex: 1 1 auto; }
  .consumo .ag-tit h2 { font-size: 20px; white-space: nowrap; }
  .consumo .cx-comprar { margin-left: auto; height: 36px; padding: 0 12px; font-size: 13.5px; }
  .consumo .cx-comprar,
  .consumo .cx-comprar span { display: inline-flex; width: auto; }
  .cx-crit-btn { margin-left: 0; }
  .cx-loja { flex-direction: column; text-align: center; }
  .cx-loja-txt { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-anel, .cx-cheio::after, .cx-vazio, .cx-det.ativa, .cx-det.a-abrir, .cx-cap.a-entrar, .cx-frasco i::after { animation: none; }
}

/* =========================================================
   Agentes do Laboratório: figura (formas da v1) com piscar de olhos
   ========================================================= */
.lab-fig { display: block; width: 100%; height: 100%; overflow: visible; }
.lab-fig .lf-c { stroke-width: 1.6; stroke-linejoin: round; }
.fig-teal .lf-c { fill: #009E98; } .fig-teal .lf-olho, .fig-teal .lf-boca { fill: #000; }
.fig-branco .lf-c { fill: #FFF; stroke: #000; } .fig-branco .lf-olho, .fig-branco .lf-boca { fill: #000; }
.fig-preto .lf-c { fill: #000; stroke: #FFF; } .fig-preto .lf-olho, .fig-preto .lf-boca { fill: #FFF; }
.fig-dovia .lf-c { fill: #000; stroke: #009E98; } .fig-dovia .lf-olho, .fig-dovia .lf-boca, .fig-dovia .lf-antena { fill: #009E98; }
.lf-olho { transform-box: fill-box; transform-origin: center; animation: figPisca 6.4s ease-in-out infinite; }
.lf-olho.b { animation-delay: .08s; }
@keyframes figPisca { 0%, 46%, 52%, 100% { transform: scaleY(1); } 49% { transform: scaleY(.12); } }
.lf-boca, .lf-z { opacity: 0; }
.lf-z text { font: 700 9px Helvetica, Arial, sans-serif; fill: currentColor; }
.avatar-ag { background: var(--bg-2); padding: 3px; box-shadow: 0 0 0 1px var(--line-2, rgba(0,0,0,.12)); }
@media (prefers-reduced-motion: reduce) { .lf-olho { animation: none; } }
.laboratorio .lab-corpo { padding-top: 14px; }
