/* Alvorada Messenger — paleta Alvorada/Goodyear */
:root {
  --navy: #002C61;
  --navy-2: #0E4A93;
  --blue: #004FA8;
  --gold: #FFD900;
  --gold-2: #FFE45C;
  --gold-border: #B89B00;
  --desk: #2B4C73;
  --win-border: #001F47;
  --body: #EEF3FA;
  --line: #C3D3EA;
  --input: #A9BEDB;
  --text: #1A2233;
  --muted: #4A5A70;
  --sel: #D6E3F5;
  --on: #2E9E4F;
  --busy: #C8452B;
  --away: #E09A1A;
  --off: #9AA6B5;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: 'Segoe UI', Tahoma, Verdana, sans-serif; color: var(--text); background: var(--desk); font-size: 14px; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
.muted { color: var(--muted); }
.error { color: #9A3412; background: #FFF1EA; border: 1px solid #F2B79B; border-radius: 4px; padding: 8px 10px; margin: 0; font-size: 13px; }

/* ---------- janelas ---------- */
.desktop { min-height: 100%; padding: 20px; display: flex; gap: 20px; }
.desktop.center { align-items: center; justify-content: center; }
.window { display: flex; flex-direction: column; border: 1px solid var(--win-border); border-radius: 8px; overflow: hidden; background: var(--body); box-shadow: 0 8px 24px rgba(0, 10, 30, .45); }
.titlebar { height: 32px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; color: #FFF; background: linear-gradient(#0E4A93, #002C61); border-bottom: 2px solid var(--gold); font-size: 13px; font-weight: 600; }
.titlebar span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-icon { width: 18px; height: 18px; border-radius: 3px; background: #FFF; flex-shrink: 0; }
.tb-btn { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.15); color: #FFF; border-radius: 3px; padding: 2px 10px; font-size: 12px; }
.tb-btn:hover { background: rgba(255,255,255,.28); }
.tb-back { display: none; font-size: 20px; line-height: 1; padding: 0 10px; }

.btn-gold { min-height: 40px; padding: 0 18px; border: 1px solid var(--gold-border); border-radius: 4px; background: linear-gradient(var(--gold-2), var(--gold)); color: var(--navy); font-weight: 700; font-size: 14px; }
.btn-gold:hover { filter: brightness(1.04); }
.btn-gold:disabled { opacity: .6; cursor: default; }
.btn-small { min-height: 32px; padding: 0 12px; border: 1px solid var(--input); border-radius: 4px; background: linear-gradient(#FFF, #E4ECF7); color: var(--navy); font-size: 12px; font-weight: 600; }
.btn-small:hover { background: #FFF; }
.btn-danger { color: #9A3412; border-color: #F2B79B; }

/* ---------- login ---------- */
.login-window { width: 400px; max-width: 100%; }
.login-body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 36px 30px; background: linear-gradient(#FFF, #E4ECF7); }
.login-logo { height: 40px; }
.login-avatar { width: 110px; height: 110px; border-radius: 10px; border: 3px solid var(--on); background: #FFF; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 3px #FFF3A6, 0 2px 6px rgba(0,20,60,.2); }
.login-avatar svg { width: 64px; height: 64px; }
.login-body h1 { margin: 0; font-size: 22px; color: var(--navy); }
.login-body p { margin: 0; font-size: 13px; text-align: center; }
.login-body label { width: 100%; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--navy); }
.login-body input { height: 36px; padding: 0 10px; border: 1px solid var(--input); border-radius: 3px; background: #FFF; }
.login-body .error { width: 100%; }
#login-btn { width: 150px; }

/* ---------- lista de contatos ---------- */
.contacts-window { width: 340px; flex-shrink: 0; height: calc(100vh - 40px); }
.me { display: flex; gap: 12px; padding: 14px; background: linear-gradient(#FFF, #E4ECF7); border-bottom: 1px solid var(--line); }
.me-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.me-info strong { color: var(--navy); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status { font-size: 12px; color: #3B4A5E; display: flex; align-items: center; gap: 6px; }
.me-status select { font-size: 12px; padding: 2px 4px; border: 1px solid var(--input); border-radius: 3px; background: #FFF; }
.me-note { border: 1px solid transparent; background: transparent; font-size: 12px; font-style: italic; color: var(--muted); padding: 2px 4px; margin-left: -4px; border-radius: 3px; }
.me-note:hover, .me-note:focus { border-color: var(--input); background: #FFF; outline: none; }
.search { display: flex; align-items: center; gap: 6px; margin: 10px 12px; padding: 5px 8px; background: #FFF; border: 1px solid var(--input); border-radius: 3px; }
.search svg { width: 14px; height: 14px; flex-shrink: 0; }
.search input { border: none; outline: none; flex: 1; background: transparent; }
.notify-banner { margin: 0 12px 8px; padding: 8px 10px; background: #FFF8CC; border: 1px solid #E6CF5C; border-radius: 4px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.contact-list { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.sec-head { display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: transparent; padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--navy); text-align: left; }
.sec-head .arrow { width: 10px; }
.sec-head .sec-action { margin-left: auto; font-weight: 600; color: var(--blue); }
.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; border: none; background: transparent; padding: 4px 12px 4px 28px; text-align: left; }
.row:hover { background: #E4ECF7; }
.row.active { background: var(--sel); }
.row .txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row .nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nt { font-size: 11px; color: #5A6B80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.offline .nm { color: #7A8798; }
.row.unread .nm { font-weight: 700; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); background: var(--off); }
.dot.on { background: var(--on); } .dot.busy { background: var(--busy); } .dot.away { background: var(--away); }
.dot.group { border-radius: 3px; background: var(--blue); }
.brand-strip { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #FFF; border-top: 3px solid var(--gold); }
.brand-strip img { height: 34px; }
.empty-hint { padding: 6px 12px 6px 28px; font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------- avatares ---------- */
.avatar { flex-shrink: 0; border-radius: 8px; border: 3px solid var(--off); color: #FFF; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px #FFF; background: var(--blue); }
.avatar.on { border-color: var(--on); } .avatar.busy { border-color: var(--busy); } .avatar.away { border-color: var(--away); }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 30px; }
.avatar.me-color { background: var(--gold); color: var(--navy); }

/* ---------- conversa ---------- */
.conv-window { flex: 1; min-width: 0; height: calc(100vh - 40px); }
.conv-window.shake { animation: shake 1s; }
@keyframes shake { 0%{transform:translate(0,0)} 8%{transform:translate(-11px,3px)} 16%{transform:translate(10px,-4px)} 24%{transform:translate(-10px,2px)} 32%{transform:translate(9px,-3px)} 40%{transform:translate(-9px,3px)} 48%{transform:translate(8px,-2px)} 56%{transform:translate(-7px,2px)} 64%{transform:translate(6px,-2px)} 72%{transform:translate(-5px,1px)} 80%{transform:translate(4px,-1px)} 90%{transform:translate(-2px,1px)} 100%{transform:translate(0,0)} }
.conv-window.knock { animation: knock .18s; }
@keyframes knock { 0%{transform:scale(1)} 40%{transform:scale(.985) translateY(3px)} 100%{transform:scale(1)} }
.conv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.conv-empty img { height: 44px; opacity: .8; }
.conv-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.conv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: linear-gradient(#FFF, #E4ECF7); border-bottom: 1px solid var(--line); }
.conv-to { font-size: 13px; color: #3B4A5E; }
.conv-to b { color: var(--navy); }
.conv-note { font-size: 12px; font-style: italic; color: var(--muted); }
.conv-main { flex: 1; display: flex; gap: 12px; padding: 12px 16px; min-height: 0; }
.conv-col { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.conv-side { width: 110px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.history { flex: 1; min-height: 0; overflow-y: auto; background: #FFF; border: 1px solid var(--input); border-radius: 4px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; gap: 2px; }
.msg .hdr { font-size: 12px; color: #6A7890; }
.msg .txt { margin-left: 14px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.msg.mine .txt { color: #003A80; }
.msg .txt a { color: var(--blue); }
.sys { font-size: 12px; font-style: italic; color: #5A6B80; }
.sys.nudge { color: var(--busy); font-weight: 600; font-style: normal; }
.sys.warn { color: #9A3412; background: #FFF1EA; border: 1px solid #F2B79B; border-radius: 4px; padding: 6px 8px; font-style: normal; }
.day-sep { align-self: center; font-size: 11px; color: var(--muted); background: var(--body); border-radius: 10px; padding: 2px 10px; }
.filecard { margin-left: 14px; display: flex; align-items: center; gap: 10px; width: 320px; max-width: calc(100% - 14px); padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: #F4F7FC; text-decoration: none; color: inherit; }
.filecard:hover { background: #EAF0F9; }
.filecard .fk { width: 38px; height: 38px; flex-shrink: 0; border-radius: 4px; background: var(--navy); color: var(--gold); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.filecard .fn { font-size: 13px; font-weight: 600; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filecard .fs { font-size: 11px; color: #5A6B80; }
.filecard .finfo { display: flex; flex-direction: column; min-width: 0; }
.imgthumb { margin-left: 14px; max-width: 280px; max-height: 220px; border-radius: 4px; border: 1px solid var(--line); display: block; }
.load-more { align-self: center; }

.composer { position: relative; display: flex; flex-direction: column; border: 1px solid var(--input); border-radius: 4px; background: #FFF; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 6px; border-bottom: 1px solid #DCE5F2; background: linear-gradient(#FFF, var(--body)); }
.tool { display: flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; border-radius: 3px; padding: 5px 8px; font-size: 12px; color: var(--navy); }
.tool:hover { border-color: var(--line); background: #FFF; }
.tool svg { width: 16px; height: 16px; }
.compose-row { display: flex; gap: 8px; padding: 8px; }
.compose-row textarea { flex: 1; height: 64px; resize: none; border: none; outline: none; }
.compose-row .btn-gold { align-self: flex-end; min-width: 92px; height: 44px; }
.popover { position: absolute; left: 0; bottom: 100%; margin-bottom: 6px; width: 420px; max-width: 92vw; background: #FFF; border: 1px solid var(--navy); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,20,60,.25); padding: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.popover strong { color: var(--navy); font-size: 12px; }
.sticker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sticker-grid button { border: 1px solid transparent; border-radius: 6px; background: #F4F7FC; padding: 6px 0; display: flex; justify-content: center; }
.sticker-grid button:hover { border-color: var(--line); background: #EAF0F9; }
.statusbar { height: 26px; flex-shrink: 0; display: flex; align-items: center; padding: 0 12px; background: #E4ECF7; border-top: 1px solid var(--line); font-size: 11px; color: #3B4A5E; }

/* ---------- figurinhas ---------- */
.sticker { display: inline-flex; flex-direction: column; align-items: center; }
.sticker svg { display: block; }
.sticker-lg svg { width: 120px; height: 120px; }
.sticker-sm svg { width: 80px; height: 80px; }
.msg .sticker { margin-left: 14px; align-self: flex-start; }
.sticker-label { font-weight: 800; line-height: 1.1; color: var(--navy); text-align: center; text-shadow: -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 2px 2px 0 #FFF; }
.sticker-lg .sticker-label { font-size: 17px; margin-top: -12px; }
.sticker-sm .sticker-label { font-size: 12px; margin-top: -8px; }
.stk-spin { transform-box: fill-box; transform-origin: center; animation: stkspin 8s linear infinite; }
.stk-spin.stk-fast { animation-duration: 1.6s; }
.stk-bounce { animation: stkbounce 1.2s ease-in-out infinite; }
.stk-wiggle-a { transform-box: fill-box; transform-origin: 30% 90%; animation: stkwiggle 1.4s ease-in-out infinite; }
.stk-wiggle-b { transform-box: fill-box; transform-origin: 20% 20%; animation: stkwiggle 1s ease-in-out infinite; }
.stk-steam { animation: stksteam 1.8s ease-in-out infinite; }
.stk-steam.stk-d1 { animation-delay: .6s; } .stk-steam.stk-d2 { animation-delay: 1.2s; }
@keyframes stkspin { to { transform: rotate(360deg); } }
@keyframes stkbounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes stkwiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
@keyframes stksteam { 0% { opacity: 0; transform: translateY(6px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }


/* ---------- diálogos ---------- */
.dialog { padding: 0; border: 1px solid var(--win-border); border-radius: 8px; width: 440px; max-width: 94vw; box-shadow: 0 10px 30px rgba(0,10,30,.5); background: var(--body); }
.dialog::backdrop { background: rgba(0, 20, 50, .45); }
.dialog form { display: flex; flex-direction: column; margin: 0; }
.dialog-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dialog-body label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--navy); }
.dialog-body input[type=text], .dialog-body input[type=search] { height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: 3px; background: #FFF; }
.people-list { max-height: 320px; overflow-y: auto; background: #FFF; border: 1px solid var(--input); border-radius: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #EEF2F8; font-size: 13px; }
.person:last-child { border-bottom: none; }
.person .sec { font-size: 11px; color: var(--muted); }
.person .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person input[type=checkbox] { width: 18px; height: 18px; }
.rename-row { display: flex; gap: 8px; }
.rename-row input { flex: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: #E4ECF7; }

/* ---------- celular / tela estreita ---------- */
@media (max-width: 820px) {
  .desktop { padding: 0; gap: 0; }
  .window { border-radius: 0; box-shadow: none; border: none; }
  .contacts-window, .conv-window { width: 100%; height: 100vh; height: 100dvh; }
  #main-view.show-conv .contacts-window { display: none; }
  #main-view:not(.show-conv) .conv-window { display: none; }
  .tb-back { display: inline-block; }
  .conv-side { display: none; }
  .conv-main { padding: 8px; }
  .history { padding: 10px; }
  .filecard { width: auto; }
  .login-window { border-radius: 8px; }
  .desktop.center { padding: 12px; }
}

/* ---------- animações de tela cheia ---------- */
.wink-overlay { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.wk-svg { width: min(60vh, 70vw); height: min(60vh, 70vw); overflow: visible; }
.wk-svg.wk-wide { width: 100vw; height: min(50vh, 50vw); }
.wk-caption { font-size: clamp(28px, 6vw, 56px); font-weight: 900; color: var(--navy); text-shadow: -3px -3px 0 #FFF, 3px -3px 0 #FFF, -3px 3px 0 #FFF, 3px 3px 0 #FFF, 0 6px 14px rgba(0,0,0,.35); animation: wkcap .5s .3s both; }
@keyframes wkcap { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.wink-overlay { animation: wkfade 3.4s forwards; }
@keyframes wkfade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* Toc-toc: mão vem da tela e bate três vezes */
.wk-toctoc .wk-fist { transform-box: fill-box; transform-origin: center; animation: wkfist 2.2s ease-out forwards; }
@keyframes wkfist { 0% { transform: translateY(160px) scale(.3); opacity: 0; } 14% { transform: translateY(0) scale(1.1); opacity: 1; }
  16% { transform: scale(1.35); } 20% { transform: scale(1.1); } 28% { transform: scale(1.35); } 32% { transform: scale(1.1); }
  40% { transform: scale(1.35); } 44% { transform: scale(1.1); } 85% { transform: scale(1.1); opacity: 1; } 100% { transform: translateY(120px) scale(.6); opacity: 0; } }
.wk-toctoc .wk-cracks { opacity: 0; animation: wkcrack 2.2s forwards; }
@keyframes wkcrack { 0%, 15% { opacity: 0; } 17% { opacity: .5; } 29% { opacity: .75; } 41%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* Porquinho: entra pulando e mexe o focinho */
.wk-porquinho .wk-pig { animation: wkpig 2.8s ease-in-out forwards; }
@keyframes wkpig { 0% { transform: translateX(-110vw); } 22% { transform: translateX(0) translateY(0); } 30% { transform: translateY(-30px); } 38% { transform: translateY(0); }
  46% { transform: translateY(-22px); } 54% { transform: translateY(0); } 85% { transform: translateX(0); } 100% { transform: translateX(110vw); } }
.wk-porquinho .wk-snout { transform-box: fill-box; transform-origin: center; animation: wksnout .19s 0.5s 6 alternate; }
@keyframes wksnout { from { transform: scale(1); } to { transform: scale(1.18, .85); } }
.wk-porquinho .wk-tail { transform-box: fill-box; transform-origin: 100% 50%; animation: wktail .3s infinite alternate; }
@keyframes wktail { to { transform: rotate(25deg); } }

/* Pneu: atravessa a tela cantando */
.wk-pneu .wk-roll { animation: wkroll 1.8s cubic-bezier(.3,.1,.4,1) forwards; }
@keyframes wkroll { from { transform: translateX(-60%); } to { transform: translateX(110%); } }
.wk-pneu .wk-spin { transform-box: fill-box; transform-origin: center; animation: stkspin .35s linear infinite; }
.wk-pneu .wk-skid { transform-box: fill-box; transform-origin: 0 50%; animation: wkskid 1.8s cubic-bezier(.3,.1,.4,1) forwards; }
@keyframes wkskid { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.wk-pneu .wk-smoke { animation: wksmoke 1.8s forwards; }
@keyframes wksmoke { from { transform: translateX(0); opacity: .9; } to { transform: translateX(520px) scale(2); opacity: 0; } }

/* Troféu: aparece com chuva de confete */
.wk-trofeu .wk-trophy { transform-box: fill-box; transform-origin: center; animation: wktrophy 3s ease-out forwards; }
@keyframes wktrophy { 0% { transform: scale(0) rotate(-20deg); } 18% { transform: scale(1.2) rotate(8deg); } 26% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.06); } 50% { transform: scale(1); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }
.wk-confetti { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 2px; animation-name: wkfall; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes wkfall { to { top: 105vh; transform: rotate(540deg); } }

/* Miniaturas no menu */
.wk-thumb { display: flex; flex-direction: column; align-items: center; }
.wk-thumb svg, .wk-thumb .wk-svg, .wk-thumb .wk-svg.wk-wide { width: 80px; height: 80px; max-width: 100%; overflow: hidden; }
.wink-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wk-thumb .sticker-label { font-size: 12px; margin-top: 2px; }
.wink-msg { margin-left: 14px; display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 22px; background: #F4F7FC; color: var(--navy); font-weight: 700; font-size: 13px; align-self: flex-start; }
.wink-msg:hover { background: #EAF0F9; }
.wink-msg .wk-thumb svg, .wink-msg .wk-thumb .wk-svg.wk-wide { width: 36px; height: 36px; }
.wink-msg .wk-thumb .sticker-label { display: none; }

/* Login: dois "A" girando enquanto conecta */
.login-avatar .spin-pair { display: none; position: relative; width: 84px; height: 84px; animation: pairspin 1.1s linear infinite; }
.login-avatar.connecting svg.person { display: none; }
.login-avatar.connecting .spin-pair { display: block; }
.spin-pair img { position: absolute; width: 40px; height: 40px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,20,60,.35); }
.spin-pair .a1 { top: 0; left: 22px; background: #FFF; }
.spin-pair .a2 { bottom: 0; left: 22px; background: var(--gold); }
@keyframes pairspin { to { transform: rotate(360deg); } }
.login-avatar.connecting { border-color: var(--away); }

@media (prefers-reduced-motion: reduce) { .stk-spin, .stk-bounce, .stk-wiggle-a, .stk-wiggle-b, .stk-steam { animation: none; } }

/* ---------- foto, opções e avisos ---------- */
.avatar { overflow: hidden; padding: 0; font-family: inherit; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn { cursor: pointer; }
.avatar-btn:hover { filter: brightness(1.05); outline: 2px solid var(--gold); }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; border-width: 2px; border-radius: 6px; box-shadow: inset 0 0 0 1px #FFF; }
.row .avatar-sm { flex-shrink: 0; }
.row.offline .avatar-sm { opacity: .55; }
.me-photo-links { display: flex; gap: 10px; }
.linkish { border: none; background: none; padding: 0; color: var(--blue); font-size: 11px; text-decoration: underline; cursor: pointer; }
.list-options { display: flex; flex-direction: column; gap: 4px; margin: -2px 12px 8px; font-size: 12px; color: #3B4A5E; }
.list-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.list-options input { width: 15px; height: 15px; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none; }
.toast { width: 300px; pointer-events: auto; border: 1px solid var(--win-border); border-radius: 6px; overflow: hidden; background: #FFF; box-shadow: 0 8px 22px rgba(0,20,60,.35); cursor: pointer; animation: toastin .35s ease-out; }
.toast.out { animation: toastout .35s ease-in forwards; }
.toast .tt { height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 8px; color: #FFF; font-size: 12px; font-weight: 600; background: linear-gradient(#0E4A93, #002C61); border-bottom: 2px solid var(--gold); }
.toast .tt img { width: 14px; height: 14px; border-radius: 3px; background: #FFF; }
.toast .tb { display: flex; gap: 10px; align-items: center; padding: 12px; background: linear-gradient(#FFF, #E4ECF7); font-size: 13px; }
.toast .tb .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast .tb .txt span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast .tb .hint { font-size: 11px; color: var(--muted); }
@keyframes toastin { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastout { to { transform: translateY(120%); opacity: 0; } }

/* ---------- mensagens estilo balão ---------- */
.history { background: #F3F6FB; gap: 6px; }
.msg { max-width: 72%; align-self: flex-start; gap: 0; }
.msg.mine { align-self: flex-end; }
.bubble { position: relative; padding: 6px 10px 4px; border-radius: 8px; background: #FFF; border: 1px solid #D9E2EF; box-shadow: 0 1px 1px rgba(0,20,60,.06); }
.msg.mine .bubble { background: #FFF5C2; border-color: #EAD679; }
.msg:not(.mine) .bubble { border-top-left-radius: 2px; }
.msg.mine .bubble { border-top-right-radius: 2px; }
.bubble .who { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.bubble .txt { margin: 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.msg.mine .bubble .txt { color: var(--text); }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: #6A7890; margin-top: 2px; }
.bubble.plain { background: transparent; border: none; box-shadow: none; padding: 0; }
.bubble .sticker, .bubble .imgthumb, .bubble .filecard, .bubble .wink-msg { margin-left: 0; }
.bubble .imgthumb { margin-bottom: 4px; }
.bubble .filecard { width: 300px; max-width: 100%; }
.tick { width: 17px; height: 11px; display: inline-block; }
.tick path { fill: none; stroke: #8A96A5; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tick.read path { stroke: #1E88E5; }
.sys { align-self: center; text-align: center; max-width: 85%; }
.day-sep { margin: 4px 0; }

/* setores dentro de um grupo */
.sec-head.sub-head { padding: 6px 12px 3px 30px; font-weight: 600; color: var(--blue); }
.row.nested { padding-left: 44px; }

/* ---------- instalar como aplicativo ---------- */
.install-banner { background: #EAF2FD; border-color: #9DBBE3; }
.install-banner .banner-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.install-banner .linkish { font-size: 11px; }
.notify-banner > span:first-child { flex: 1; }

/* ---------- câmera ---------- */
.dlg-camera { width: 680px; }
.cam-body { align-items: center; }
.cam-view { width: 100%; max-height: 60vh; object-fit: contain; background: #0B1A2E; border-radius: 6px; }
#cam-video { transform: scaleX(-1); } /* prévia em espelho, como um espelho de verdade; a foto sai normal */
.cam-msg { text-align: center; padding: 30px 10px; }

/* ---------- celular ---------- */
@media (max-width: 820px) {
  input, select, textarea { font-size: 16px; } /* evita o zoom automático do iPhone ao tocar no campo */
  .toolbar { flex-wrap: nowrap; justify-content: space-around; padding: 2px 4px; }
  .tool { padding: 8px 10px; }
  .tool .tl { display: none; }
  .tool svg { width: 24px; height: 24px; }
  .compose-row { align-items: flex-end; padding: 6px; }
  .compose-row textarea { height: 46px; padding: 11px 4px; }
  .compose-row .btn-gold { min-width: 76px; height: 46px; }
  .conv-head { padding: 6px 12px; }
  .conv-note { display: none; }
  .msg { max-width: 85%; }
  .bubble .imgthumb { max-width: 100%; height: auto; }
  .toast-stack { left: 8px; right: 8px; top: 8px; bottom: auto; flex-direction: column; }
  .toast { width: 100%; }
  .popover { width: auto; left: 0; right: 0; max-width: none; }
  .dlg-camera { width: 100vw; max-width: 100vw; }
}
