/* v139 — Comunidade (relatos) e Bate-papo (salas). Load last; scoped to .pp-* classes, the dock and the menu account card. */
:root {
  --pp-accent: #0847a6;
  --pp-accent-ink: #fff;
  --pp-soft: #eaf1fb;
  --pp-surface: var(--paper, #fffef9);
  --pp-page: var(--cream, #f8f5ec);
  --pp-sunken: #f2f1ea;
  --pp-bubble: #eef1ef;
  --pp-bubble-own: #0847a6;
  --pp-bubble-own-ink: #fff;
  --pp-warn: #b4431f;
  --pp-warn-soft: #fff0e8;
  --pp-amber: #9a6200;
  --pp-amber-soft: #fff5dc;
  --pp-ok: #0f7a5c;
  --pp-ok-soft: #e2f5ee;
  --pp-shadow: 0 1px 2px #102d3f0d, 0 4px 18px #102d3f0f;
  --pp-radius: 18px;
  --pp-ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme=dark] {
  --pp-accent: #95c3ff;
  --pp-accent-ink: #0d1e27;
  --pp-soft: #203f59;
  --pp-sunken: #102631;
  --pp-bubble: #1c3643;
  --pp-bubble-own: #1f5fb8;
  --pp-bubble-own-ink: #fff;
  --pp-warn: #ffb49b;
  --pp-warn-soft: #3b2b27;
  --pp-amber: #f1d891;
  --pp-amber-soft: #3b3422;
  --pp-ok: #7adbc1;
  --pp-ok-soft: #173d37;
  --pp-shadow: 0 1px 2px #0005, 0 6px 20px #0003;
}

/* ---------- Shared page frame ---------- */
/* The map tabs are hidden on these screens, so the 76px band reserved for them is not needed. */
@media (min-width: 601px) {
  html body.map-shell.map-shell-ready[data-map-shell-view] > .pp-social.product-view { padding-top: calc(env(safe-area-inset-top, 0px) + 24px); }
}
.pp-social.product-page { box-sizing: border-box; width: 100%; max-width: 760px; margin: 0 auto; padding-inline: 16px; color: var(--ink); }
.pp-social.chat-page { max-width: 1200px; }
.pp-social :is(h1, h2, h3, p) { margin: 0; }
.pp-social button { font-family: 'DM Sans', sans-serif; }
.pp-social .ui-icon, .pp-room .ui-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.pp-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 16px; }
.pp-page-head h1 { font: 700 28px/1.1 'Bricolage Grotesque', sans-serif; letter-spacing: -.03em; outline: none; }
.pp-page-head p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.pp-icon-button { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--pp-surface); color: var(--pp-accent); cursor: pointer; }
.pp-icon-button:hover { background: var(--pp-soft); }
.pp-primary, .pp-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; font: 700 14px/1.2 'DM Sans', sans-serif; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.pp-primary { border: 0; background: var(--pp-accent); color: var(--pp-accent-ink); }
.pp-primary:hover { filter: brightness(1.08); }
.pp-secondary { border: 1px solid var(--line); background: var(--pp-surface); color: var(--pp-accent); }
.pp-secondary:hover { background: var(--pp-soft); }
.pp-text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 4px; border: 0; background: none; color: var(--pp-accent); font: 700 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-text-button .ui-icon { width: 18px; height: 18px; }
.pp-link-button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-link-button:hover { color: var(--ink); background: var(--pp-sunken); }
.pp-link-button[data-confirm="true"] { color: var(--pp-warn); background: var(--pp-warn-soft); }
.pp-footnote { margin: 22px 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.pp-footnote button { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--pp-accent); font: 600 12.5px 'DM Sans', sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pp-hero-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--pp-soft); color: var(--pp-accent); }
.pp-hero-icon .ui-icon { width: 24px; height: 24px; }
.pp-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pp-social :focus-visible, .pp-room :focus-visible, .pp-guide-dialog :focus-visible { outline: 3px solid var(--pp-accent); outline-offset: 2px; }
@keyframes pp-shimmer { to { background-position: -200% 0; } }
@keyframes pp-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pp-slide { from { opacity: .4; transform: translateX(24px); } }
@keyframes pp-fade { from { opacity: 0; } }
/* The shared view-in animation keeps a transform, which would turn the page into the containing block of the
   fixed mobile conversation pane. Bate-papo fades in with opacity only. */
.pp-social.chat-page.product-view { animation: pp-fade .2s ease both; }
.pp-skeleton-post i, .pp-skeleton-row, .pp-skeleton-bubble { display: block; border-radius: 10px; background: linear-gradient(100deg, var(--pp-sunken) 30%, color-mix(in srgb, var(--pp-sunken) 55%, var(--pp-surface)) 50%, var(--pp-sunken) 70%); background-size: 200% 100%; animation: pp-shimmer 1.4s linear infinite; }

/* ---------- Comunidade ---------- */
.pp-compose { padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--pp-surface); box-shadow: var(--pp-shadow); }
.pp-compose-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pp-compose-top h2 { font: 700 16px/1.25 'DM Sans', sans-serif; }
.pp-line-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 55%; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--pp-page); color: var(--pp-accent); font: 700 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-line-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-line-chip .ui-icon { width: 18px; height: 18px; }
.pp-social .community-quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.pp-social .community-quick-actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 10px 6px; border: 0; border-radius: 14px; background: var(--pp-soft); color: var(--ink); font: 700 13px/1.2 'DM Sans', sans-serif; text-align: center; box-shadow: none; cursor: pointer; transition: transform .12s var(--pp-ease), filter .12s; }
.pp-social .community-quick-actions button:hover { filter: brightness(.97); }
.pp-social .community-quick-actions button:active { transform: scale(.98); }
.pp-social .community-quick-actions [data-compose="traffic"] { background: var(--pp-amber-soft); }
.pp-social .community-quick-actions [data-compose="accident"] { background: var(--pp-warn-soft); }
.pp-social .community-quick-actions span { display: grid; place-items: center; color: var(--pp-accent); }
.pp-social .community-quick-actions [data-compose="traffic"] span { color: var(--pp-amber); }
.pp-social .community-quick-actions [data-compose="accident"] span { color: var(--pp-warn); }
.pp-social .community-quick-actions svg { width: 24px; height: 24px; }

.pp-feed { margin-top: 22px; }
.pp-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pp-feed-head h2 { font: 700 20px/1.2 'Bricolage Grotesque', sans-serif; letter-spacing: -.02em; }
.pp-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 4px; border: 0; background: none; color: var(--ink); font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-toggle-track { position: relative; width: 36px; height: 22px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 35%, transparent); transition: background-color .15s; }
.pp-toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s var(--pp-ease); }
.pp-toggle[aria-pressed="true"] .pp-toggle-track { background: var(--pp-warn); }
.pp-toggle[aria-pressed="true"] .pp-toggle-track::after { transform: translateX(14px); }
.pp-chips { display: flex; gap: 8px; margin: 10px -16px 0; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.pp-chips::-webkit-scrollbar { display: none; }
.pp-chips button, .pp-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--pp-surface); color: var(--ink); font: 600 13px 'DM Sans', sans-serif; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.pp-chips button[aria-pressed="true"], .pp-chip.is-active { border-color: var(--pp-accent); background: var(--pp-soft); color: var(--pp-accent); }
.pp-feed-context { min-height: 18px; margin: 8px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.pp-post-list { display: grid; gap: 10px; }
.pp-post { padding: 14px 14px 6px; border: 1px solid var(--line); border-radius: var(--pp-radius); background: var(--pp-surface); box-shadow: var(--pp-shadow); animation: pp-in .2s var(--pp-ease) both; overflow-wrap: anywhere; }
.pp-post-head { display: flex; align-items: flex-start; gap: 10px; }
.pp-post-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: var(--pp-soft); color: var(--pp-accent); }
.pp-post[data-category="traffic"] .pp-post-icon { background: var(--pp-amber-soft); color: var(--pp-amber); }
.pp-post[data-category="accident"] .pp-post-icon, .pp-post[data-category="alert"] .pp-post-icon { background: var(--pp-warn-soft); color: var(--pp-warn); }
.pp-post-title { min-width: 0; flex: 1; }
.pp-post-title p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pp-post-title strong { font-size: 15px; }
.pp-line-tag { padding: 2px 8px; border-radius: 999px; background: var(--pp-page); color: var(--pp-accent); font-size: 12px; font-weight: 700; }
.pp-post-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.pp-post-place { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px !important; color: var(--ink); font-size: 13.5px; line-height: 1.4; }
.pp-post-place .ui-icon { width: 16px; height: 16px; margin-top: 1px; color: var(--pp-warn); }
.pp-post-body { margin-top: 8px !important; font-size: 15px; line-height: 1.55; }
.pp-post-note { margin-top: 8px !important; color: var(--muted); font-size: 12px; }
.pp-post-photo { margin: 10px 0 0; }
.pp-post-photo button { display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; background: none; cursor: zoom-in; overflow: hidden; }
.pp-post-photo img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.pp-post .community-poll { margin-top: 10px; }
.pp-post-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.pp-post-spacer { flex: 1; }
.pp-react { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 700 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-react .ui-icon { width: 18px; height: 18px; }
.pp-react b { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--pp-page); color: var(--ink); font-size: 12px; }
.pp-react:hover { background: var(--pp-sunken); color: var(--ink); }
.pp-react.active { background: var(--pp-ok-soft); color: var(--pp-ok); }
.pp-react.active b { background: transparent; color: inherit; }
.pp-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--pp-radius); text-align: center; }
.pp-empty strong { font-size: 16px; }
.pp-empty p { max-width: 360px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pp-empty button { margin-top: 4px; }
.pp-post-skeletons { display: grid; gap: 10px; }
.pp-skeleton-post { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--pp-radius); background: var(--pp-surface); }
.pp-skeleton-post i { height: 12px; }
.pp-skeleton-post i:first-child { width: 45%; height: 16px; }
.pp-skeleton-post i:last-child { width: 70%; }
.pp-locked { position: relative; }
.pp-locked-preview { display: grid; gap: 10px; max-height: 300px; margin-top: 12px; overflow: hidden; opacity: .55; filter: saturate(.7); -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); pointer-events: none; user-select: none; }
.pp-locked-card { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; margin: 0; padding: 20px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--pp-surface); box-shadow: 0 10px 40px #102d3f1f; text-align: center; }
.pp-locked-card strong { font-size: 17px; line-height: 1.3; }
.pp-locked-card p { max-width: 400px; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- Bate-papo: list ---------- */
.pp-section { margin-top: 22px; }
.pp-section:first-child { margin-top: 0; }
.pp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.pp-section-title { color: var(--muted); font: 700 13px/1.3 'DM Sans', sans-serif; letter-spacing: .01em; }
.pp-section > .pp-section-title { margin-bottom: 8px !important; }
.pp-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--pp-accent); color: var(--pp-accent-ink); font-size: 12px; font-weight: 700; }
.pp-room-list, .pp-section, #pp-chat-rooms { display: grid; gap: 6px; }
.pp-section { gap: 6px; }
.pp-room-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--pp-surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: background-color .15s, border-color .15s; }
.pp-room-row:hover { background: color-mix(in srgb, var(--pp-soft) 45%, var(--pp-surface)); }
.pp-room-row.is-active { border-color: var(--pp-accent); background: var(--pp-soft); }
.pp-room-row.is-locked { cursor: pointer; opacity: .85; }
.pp-room-row.is-cta { border-style: dashed; }
.pp-row-main { display: grid; gap: 3px; min-width: 0; }
.pp-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.pp-row-top strong { overflow: hidden; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pp-row-top time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.pp-row-preview { display: flex; align-items: center; gap: 4px; overflow: hidden; color: var(--muted); font-size: 13.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.pp-row-preview.is-empty { font-style: normal; opacity: .85; }
.pp-row-preview .ui-icon { width: 14px; height: 14px; }
.pp-room-row.is-unread .pp-row-top strong, .pp-room-row.is-unread .pp-row-preview { color: var(--ink); font-weight: 700; }
.pp-room-row.is-unread time { color: var(--pp-accent); font-weight: 700; }
.pp-unread { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pp-accent); }
.pp-avatar, .pp-msg-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: var(--pp-soft); color: var(--pp-accent); font: 700 12px/1 'DM Sans', sans-serif; letter-spacing: -.01em; overflow: hidden; }
.pp-avatar .ui-icon { width: 22px; height: 22px; }
.pp-avatar-line { border-radius: 14px; font-size: 12.5px; }
.pp-avatar-bus { background: var(--pp-ok-soft); color: var(--pp-ok); }
.pp-avatar-city { background: var(--pp-amber-soft); color: var(--pp-amber); }
.pp-avatar-group { background: color-mix(in srgb, #7a5cc2 16%, var(--pp-surface)); color: #6246a8; }
.pp-avatar-person, .pp-msg-avatar { background: hsl(var(--pp-hue, 205) 65% 91%); color: hsl(var(--pp-hue, 205) 45% 30%); }
:root[data-theme=dark] :is(.pp-avatar-person, .pp-msg-avatar) { background: hsl(var(--pp-hue, 205) 35% 26%); color: hsl(var(--pp-hue, 205) 70% 84%); }
:root[data-theme=dark] .pp-avatar-group { background: #2e2748; color: #c9b8ff; }
.pp-region-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pp-region-chips .pp-chip { min-height: 44px; }
.pp-region-chips .pp-unread { width: 8px; height: 8px; }
.pp-seg { display: inline-flex; gap: 4px; justify-self: start; max-width: 100%; padding: 4px; border-radius: 14px; background: var(--pp-sunken); overflow-x: auto; }
.pp-seg button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 700 13px 'DM Sans', sans-serif; white-space: nowrap; cursor: pointer; }
.pp-seg button[aria-pressed="true"] { background: var(--pp-surface); color: var(--pp-accent); box-shadow: 0 1px 3px #102d3f1a; }
.pp-empty-row { display: grid; justify-items: start; gap: 4px; margin: 0; padding: 14px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.pp-empty-row strong { color: var(--ink); font-size: 14px; }
.pp-row-skeletons { display: grid; gap: 6px; }
.pp-skeleton-row { height: 68px; border-radius: 16px; }
.pp-invite { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--pp-surface); }
.pp-invite.is-incoming { border-color: var(--pp-accent); }
.pp-invite-actions { grid-column: 2; display: flex; gap: 8px; }
.pp-invite-actions button { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.pp-hero { display: grid; justify-items: center; gap: 10px; padding: 24px 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--pp-surface); box-shadow: var(--pp-shadow); text-align: center; }
.pp-hero h2 { max-width: 420px; font: 700 21px/1.2 'Bricolage Grotesque', sans-serif; letter-spacing: -.02em; }
.pp-hero p { max-width: 420px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.pp-hero .pp-hero-actions { margin-top: 4px; }
.pp-preview { margin-top: 18px; }
#pp-chat-layout[data-access="guest"] :is(#private-invites-panel, #line-groups-hub, #pp-chat-city),
#pp-chat-layout[data-access="unverified"] :is(#private-invites-panel, #line-groups-hub, #pp-chat-city) { display: none; }
/* Particular conversations appear once an invite exists; the how-to lives in the room menu and the chat rules. */
#private-invites-panel:not(.has-rooms) { display: none; }

/* ---------- Bate-papo: layout and pane ---------- */
.pp-chat-layout { position: relative; }
.pp-chat-list { min-width: 0; padding-bottom: 8px; }
.pp-chat-pane { display: none; min-width: 0; }
.pp-chat-placeholder { display: none; }
.pp-chat-layout[data-room] .pp-chat-pane { display: flex; flex-direction: column; }

@media (max-width: 959px) {
  .pp-chat-layout[data-room] .pp-chat-pane { position: fixed; z-index: 2300; inset: 0; background: var(--pp-surface); animation: pp-slide .18s var(--pp-ease) both; }
  html body.map-shell.pp-room-open[data-map-shell-view="chat"] { overflow: hidden; }
  body.map-shell.pp-room-open[data-map-shell-view="chat"] :is(.map-shell-navigation, .map-shell-brand) { display: none !important; }
  body.map-shell.pp-room-open[data-map-shell-view="chat"] .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
}
@media (min-width: 960px) {
  .pp-chat-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px - var(--shell-bottom, 114px) - 12px); min-height: 480px; }
  .pp-chat-list { overflow-y: auto; padding-right: 4px; scrollbar-width: thin; overscroll-behavior: contain; }
  .pp-chat-pane { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; background: var(--pp-surface); box-shadow: var(--pp-shadow); overflow: hidden; }
  .pp-chat-layout:not([data-room]) .pp-chat-placeholder { display: grid; place-content: center; justify-items: center; gap: 8px; height: 100%; padding: 24px; color: var(--muted); text-align: center; }
  .pp-chat-placeholder .ui-icon { width: 40px; height: 40px; color: var(--pp-accent); opacity: .7; }
  .pp-chat-placeholder strong { color: var(--ink); font-size: 16px; }
  .pp-chat-placeholder span { max-width: 260px; font-size: 14px; line-height: 1.5; }
  .pp-room .pp-room-back { display: none; }
  html body.map-shell.map-shell-ready[data-map-shell-view="chat"] { overflow: hidden; }
  html body.map-shell.map-shell-ready[data-map-shell-view] > .chat-page.product-view { padding-bottom: 0; }
}

dialog.pp-room { position: static; inset: auto; box-sizing: border-box; display: none; flex: 1; flex-direction: column; width: 100%; max-width: none; height: 100%; max-height: none; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--pp-surface); color: var(--ink); box-shadow: none; overflow: hidden; }
dialog.pp-room[open] { display: flex; }
.pp-room-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; border-bottom: 1px solid var(--line); background: var(--pp-surface); }
@media (min-width: 960px) { .pp-room-head { padding: 12px 14px; } }
.pp-room-back, .pp-room-menu > summary { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--pp-accent); cursor: pointer; list-style: none; }
.pp-room-back:hover, .pp-room-menu > summary:hover { background: var(--pp-sunken); }
.pp-room-back .ui-icon { width: 22px; height: 22px; transform: rotate(180deg); }
.pp-room-menu > summary::-webkit-details-marker { display: none; }
.pp-room-menu > summary .ui-icon { width: 24px; height: 24px; }
.pp-room-head .pp-avatar { width: 40px; height: 40px; }
.pp-avatar-slot { display: contents; }
.pp-room-title { flex: 1; min-width: 0; }
.pp-room-title h2 { overflow: hidden; font: 700 16px/1.25 'DM Sans', sans-serif; text-overflow: ellipsis; white-space: nowrap; outline: none; }
.pp-room-title p { overflow: hidden; color: var(--muted); font-size: 12.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.pp-room-menu { position: relative; }
.pp-room-menu-list { position: absolute; top: calc(100% + 6px); right: 0; display: grid; gap: 2px; width: min(260px, calc(100vw - 32px)); padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--pp-surface); box-shadow: 0 12px 40px #102d3f2e; animation: pp-in .14s var(--pp-ease) both; }
.pp-room-menu-list button { min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 600 14px 'DM Sans', sans-serif; text-align: left; cursor: pointer; }
.pp-room-menu-list button:hover { background: var(--pp-sunken); }
.pp-room-menu-list #chat-block-user, .pp-room-menu-list #archive-line-group, .pp-room-menu-list #leave-line-group { color: var(--pp-warn); }
#chat-block-user.confirm { background: var(--pp-warn-soft); }
.pp-room-alias { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px !important; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.pp-room-alias strong { display: block; color: var(--ink); font-size: 14px; }
.pp-room-note { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 14px; background: var(--pp-page); color: var(--muted); font-size: 12px; line-height: 1.35; text-align: center; }
.pp-room-note .ui-icon { width: 14px; height: 14px; color: var(--pp-ok); }
.pp-room-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 16px; background: var(--pp-page); overscroll-behavior: contain; scroll-behavior: auto; }
.pp-day { display: flex; justify-content: center; margin: 12px 0 4px !important; }
.pp-day span { padding: 3px 10px; border-radius: 999px; background: var(--pp-surface); color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: capitalize; box-shadow: 0 1px 2px #102d3f12; }
.pp-msg { display: flex; align-items: flex-start; gap: 8px; max-width: min(88%, 560px); margin-top: 10px; animation: pp-in .16s var(--pp-ease) both; }
.pp-msg.grouped { margin-top: 3px; padding-left: 40px; }
.pp-msg.own { margin-left: auto; justify-content: flex-end; }
.pp-msg-avatar { width: 32px; height: 32px; font-size: 11px; }
.pp-msg-body { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 4px; min-width: 0; }
.pp-msg.own .pp-msg-body { justify-content: flex-end; }
.pp-msg-author { flex-basis: 100%; padding-left: 12px; color: hsl(var(--pp-hue, 205) 55% 32%); font-size: 12.5px; font-weight: 700; }
:root[data-theme=dark] .pp-msg-author { color: hsl(var(--pp-hue, 205) 70% 78%); }
.pp-bubble { min-width: 0; max-width: calc(100% - 40px); padding: 8px 12px 6px; border-radius: 18px 18px 18px 6px; background: var(--pp-bubble); color: var(--ink); }
.pp-msg.grouped .pp-bubble { border-radius: 6px 18px 18px 6px; }
.pp-msg.own .pp-bubble { max-width: 100%; border-radius: 18px 18px 6px 18px; background: var(--pp-bubble-own); color: var(--pp-bubble-own-ink); }
.pp-msg.own.grouped .pp-bubble { border-radius: 18px 6px 6px 18px; }
.pp-bubble p { display: inline; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.pp-bubble time { float: right; margin: 6px 0 -2px 10px; color: var(--muted); font-size: 11px; line-height: 1; }
.pp-msg.own .pp-bubble time { color: color-mix(in srgb, var(--pp-bubble-own-ink) 78%, transparent); }
.pp-msg-tools { display: contents; }
.pp-msg-more { position: relative; display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; opacity: .75; }
.pp-msg-more::after { content: ''; position: absolute; inset: -4px; }
.pp-msg-more:hover, .pp-msg-more[aria-expanded="true"] { background: var(--pp-surface); color: var(--ink); opacity: 1; }
.pp-msg-more .ui-icon { width: 20px; height: 20px; }
.pp-msg-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px 4px; }
.pp-msg-actions[hidden] { display: none !important; }
.pp-msg-actions button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--pp-surface); color: var(--ink); font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-msg-actions [data-report-message], .pp-msg-actions [data-group-report] { color: var(--pp-warn); }
.pp-msg-actions [data-confirm="true"] { border-color: var(--pp-warn); background: var(--pp-warn-soft); }
.pp-msg-actions button:disabled { opacity: .7; cursor: default; }
.pp-log-empty { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 100%; padding: 32px 16px; color: var(--muted); text-align: center; }
.pp-log-empty .ui-icon { width: 36px; height: 36px; color: var(--pp-accent); opacity: .75; }
.pp-log-empty strong { color: var(--ink); font-size: 16px; }
.pp-log-empty span { max-width: 300px; font-size: 14px; line-height: 1.5; }
.pp-log-empty.is-error .ui-icon { color: var(--pp-warn); }
.pp-log-empty button { margin-top: 6px; }
.pp-log-loading { display: grid; gap: 10px; padding-top: 8px; }
.pp-skeleton-bubble { width: var(--w, 60%); height: 38px; border-radius: 18px 18px 18px 6px; }
.pp-skeleton-bubble.own { justify-self: end; border-radius: 18px 18px 6px 18px; }
.pp-quick { display: flex; gap: 6px; padding: 8px 10px 0; overflow-x: auto; background: var(--pp-surface); scrollbar-width: none; }
.pp-quick::-webkit-scrollbar { display: none; }
.pp-quick button { flex: 0 0 auto; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--pp-surface); color: var(--pp-accent); font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.pp-quick button:hover { background: var(--pp-soft); }
.pp-composer { display: grid; gap: 2px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--pp-surface); }
.pp-quick:not([hidden]) + .pp-composer { border-top: 0; }
.pp-composer-row { display: flex; align-items: center; gap: 8px; }
.pp-composer-row input { flex: 1; min-width: 0; height: 48px; margin: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 24px; background: var(--pp-page); color: var(--ink); font: 400 16px 'DM Sans', sans-serif; }
.pp-composer-row input:focus { border-color: var(--pp-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pp-accent) 22%, transparent); }
.pp-send { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--pp-accent); color: var(--pp-accent-ink); cursor: pointer; transition: transform .12s var(--pp-ease), filter .12s; }
.pp-send:hover { filter: brightness(1.08); }
.pp-send:active { transform: scale(.95); }
.pp-send .ui-icon { width: 22px; height: 22px; }
.pp-composer[aria-busy="true"] .pp-send, .pp-send:disabled { opacity: .6; cursor: wait; }
.pp-composer-meta { display: none; padding: 0 16px; color: var(--muted); font-size: 11px; text-align: right; }
.pp-composer:focus-within .pp-composer-meta { display: block; }
.pp-composer-error { padding: 2px 16px; color: var(--pp-warn); font-size: 13px; line-height: 1.4; }
.pp-composer-error:empty { display: none; }
.group-room-dialog .pp-room-note .ui-icon { color: #6246a8; }

/* ---------- Guide ---------- */
.pp-guide-dialog { width: min(480px, calc(100% - 24px)); padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--pp-surface); color: var(--ink); }
.pp-guide-dialog h2 { margin: 12px 44px 12px 0; font: 700 22px/1.2 'Bricolage Grotesque', sans-serif; }
.pp-guide-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--pp-ok-soft); color: var(--pp-ok); }
.pp-guide-icon .ui-icon { width: 24px; height: 24px; }
.pp-guide-list { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.pp-guide-list li { position: relative; padding-left: 26px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pp-guide-list li::before { content: ''; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--pp-accent); }
.pp-guide-list strong { color: var(--ink); }
.pp-guide-dialog .pp-primary { width: 100%; min-height: 48px; }

/* ---------- Dock and menu: five destinations, account in the menu ---------- */
html body.map-shell .map-shell-dock { grid-template-columns: repeat(5, minmax(0, 1fr)); }
html body.map-shell .map-shell-dock > button > span { white-space: nowrap; letter-spacing: -.01em; }
@media (max-width: 400px) { html body.map-shell .map-shell-dock > button > span { font-size: 10.5px; letter-spacing: -.02em; } }
@media (max-width: 340px) { html body.map-shell .map-shell-dock > button { padding-inline: 0; } html body.map-shell .map-shell-dock > button > span { font-size: 10px; } }
body.map-shell #mobile-nav .map-shell-menu-account { display: block; }
body.map-shell #mobile-nav .map-shell-menu-account #account-button { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; justify-items: stretch; gap: 12px; width: 100%; min-width: 0; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--pp-soft); color: var(--ink); text-align: left; }
body.map-shell #mobile-nav .map-shell-menu-account #account-button::after { content: ''; width: 9px; height: 9px; justify-self: center; border-top: 2px solid var(--pp-accent); border-right: 2px solid var(--pp-accent); transform: rotate(45deg); }
body.map-shell #mobile-nav .map-shell-menu-account #account-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--pp-accent); color: var(--pp-accent-ink); font: 700 15px 'DM Sans', sans-serif; }
body.map-shell #mobile-nav .map-shell-menu-account #account-avatar.guest { background: var(--pp-surface); color: var(--pp-accent); }
body.map-shell #mobile-nav .map-shell-menu-account #account-avatar svg { width: 22px; height: 22px; }
body.map-shell #mobile-nav .map-shell-menu-account #account-button > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
body.map-shell #mobile-nav .map-shell-menu-account #account-label { overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
body.map-shell #mobile-nav .map-shell-menu-account #account-detail { display: block; margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------- Dark theme touches ---------- */
:root[data-theme=dark] .pp-social .community-quick-actions button { color: var(--ink); }
:root[data-theme=dark] .pp-bubble time { color: #a9bfcb; }
:root[data-theme=dark] .pp-toggle-track::after { background: #edf4f7; }

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .pp-social.product-page { padding-inline: 12px; }
  .pp-chips { margin-inline: -12px; padding-inline: 12px; }
  .pp-page-head h1 { font-size: 25px; }
  .pp-social .community-quick-actions button { min-height: 66px; font-size: 12.5px; }
  .pp-compose-top h2 { font-size: 15px; }
  .pp-line-chip { max-width: 52%; padding-inline: 10px; }
  .pp-msg { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-post, .pp-msg, .pp-room-menu-list, .pp-chat-layout[data-room] .pp-chat-pane { animation: none !important; }
  .pp-skeleton-post i, .pp-skeleton-row, .pp-skeleton-bubble { animation: none; }
}
body.reduce-motion :is(.pp-post, .pp-msg, .pp-room-menu-list, .pp-chat-pane) { animation: none !important; }
body.reduce-motion :is(.pp-skeleton-post i, .pp-skeleton-row, .pp-skeleton-bubble) { animation: none; }
body.large-reading .pp-bubble p, body.large-reading .pp-post-body { font-size: 18px; }
body.strong-contrast :is(.pp-post, .pp-room-row, .pp-compose, .pp-hero) { border-width: 2px; border-color: var(--ink); }
.community-page:is([data-access="guest"], [data-access="unverified"]) :is(.pp-chips, .pp-toggle) { display: none; }
@media (max-width: 959px) { .pp-social.chat-page { max-width: 760px; } }
/* QA mobile v139: touch targets of at least 44 px on phones — segmented group tabs (were 40 px) and the quick-message chips
 * and message actions (were 40 px); the 36 px quick-reply pills keep their look with a larger invisible hit area. */
@media (max-width: 600px) {
  .pp-seg button, .pp-msg-actions button { min-height: 44px; }
  .pp-quick { padding-bottom: 4px; }
  .pp-quick button { position: relative; }
  .pp-quick button::after { content: ''; position: absolute; inset: -4px -3px; }
}
/* QA mobile v139: the publish dialog's sticky "Cancelar / Publicar" bar stopped 20 px above the sheet's bottom padding, so the
 * photo row scrolled visibly underneath it. Stick it to the real bottom edge. */
@media (max-width: 600px) {
  .post-dialog .form-footer { bottom: calc(-1 * max(20px, env(safe-area-inset-bottom, 0px))); padding-bottom: calc(8px + max(20px, env(safe-area-inset-bottom, 0px))); }
}
/* QA desktop v139: with a conversation open, notices ("Mensagem enviada", "Você saiu do grupo"...) sat on the message box
 * and the quick replies. From tablet up they appear just below the room header instead. */
@media (min-width: 601px) {
  body.map-shell.pp-room-open[data-map-shell-view="chat"] .toast { top: calc(env(safe-area-inset-top, 0px) + 88px); bottom: auto; }
}
@media (min-width: 960px) {
  /* Centered on the conversation pane (list 380 px + 20 px gap → pane center is 200 px right of the page center). */
  body.map-shell.pp-room-open[data-map-shell-view="chat"] .toast { top: calc(env(safe-area-inset-top, 0px) + 130px); left: calc(50% + 200px); width: max-content; max-width: min(440px, calc(100vw - 520px)); }
}
/* QA mobile v139: "Linha salva · sem mensagens" rows dropped to 3.5:1 in the light theme because of an extra opacity. */
.pp-row-preview.is-empty { opacity: 1; }
/* QA desktop v139: on 1280×800 / 1366×768 laptops "Publicar alerta" sat below the fold of the (scrolling) publish dialog;
 * keep Cancelar / Publicar pinned to its bottom edge, as on phones. */
@media (min-width: 601px) {
  .post-dialog .form-footer { position: sticky; bottom: -30px; z-index: 2; padding: 12px 0 30px; border-top: 1px solid var(--line); background: var(--paper); }
}
/* QA desktop v139: the dark-theme time color (#a9bfcb) also reached your own blue bubbles, where it read at 3.2:1. */
:root[data-theme=dark] .pp-msg.own .pp-bubble time { color: color-mix(in srgb, var(--pp-bubble-own-ink) 86%, transparent); }
/* QA desktop v139: ".pp-social :is(h1,h2,h3,p) { margin: 0 }" beat ".pp-footnote" and ".pp-feed-context", so the footnote touched the
 * chips/cards above it and the feed context line was glued between the filters and the first post. */
.pp-social .pp-footnote { margin: 22px 0 8px; }
.pp-social .pp-feed-context { margin: 8px 0 12px; }
