/* iOS interaction layer: safe areas, native glass, messaging gestures and official identity. */
.pm-federation-mark { display: block; width: 100%; height: 100%; object-fit: contain; }
.pm-federation-lockup { display: flex; align-items: center; gap: 8px; }
.pm-federation-lockup > .pm-federation-mark { width: 38px; height: 38px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.9); filter: drop-shadow(0 5px 10px rgba(28,62,137,.14)); }
.pm-federation-lockup > span { display: grid; gap: 2px; }
.pm-federation-lockup small { color: #3159a9; font-size: 7px; font-weight: 800; letter-spacing: .8px; }
.pm-federation-lockup strong { color: var(--pm-ink); font-size: 11px; }
.pm-federation-lockup.is-compact > .pm-federation-mark { width: 34px; height: 34px; }
.pm-brand-orbit--official { width: 94px; height: 94px; margin-bottom: 16px; padding: 9px; border: 1px solid rgba(255,255,255,.8); border-radius: 31px; background: rgba(255,255,255,.88); box-shadow: 0 18px 40px rgba(19,50,118,.18), inset 0 1px rgba(255,255,255,.9); backdrop-filter: blur(20px); }
.pm-brand-orbit--official .pm-federation-mark { filter: drop-shadow(0 8px 12px rgba(39,76,160,.14)); }
.pm-official-id { display: flex; align-items: center; gap: 6px; }
.pm-official-id > .pm-federation-mark { width: 25px; height: 25px; padding: 2px; border-radius: 8px; background: white; box-shadow: 0 4px 10px rgba(23,70,176,.12); }
.pm-sheet__header--brand > div { display: flex; align-items: center; gap: 10px; }
.pm-sheet__header--brand .pm-federation-mark { width: 42px; height: 42px; padding: 4px; border-radius: 14px; background: white; box-shadow: 0 6px 15px rgba(23,70,176,.12); }
.pm-sheet__header--brand span { display: grid; }

.pm-phone { -webkit-user-select: none; user-select: none; }
.pm-tabbar { left: 0; right: 0; bottom: 0; height: calc(78px + var(--safe-bottom)); padding: 7px 8px calc(16px + var(--safe-bottom)); border-width: 1px 0 0; border-radius: 0; background: rgba(250,250,252,.88); box-shadow: 0 -9px 30px rgba(16,31,61,.055), inset 0 1px rgba(255,255,255,.8); }
.pm-tab { border-radius: 13px; }
.pm-tab.is-active .pm-tab__icon { background: transparent; transform: translateY(-1px); }
.pm-tab__icon { transition: transform 260ms var(--pm-ease-emphasized), color 180ms ease; }
.pm-tab small { font-size: 10px; }
.pm-home-indicator { bottom: calc(5px + var(--safe-bottom)); height: 5px; background: rgba(3,9,19,.86); }

.pm-inbox { background: #f2f2f7; }
.pm-chat-list { border: .5px solid rgba(60,60,67,.08); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 12px 34px rgba(31,38,52,.055); }
.pm-chat-list > button { min-height: 82px; padding: 10px 12px; }
.pm-chat-list > button:active { background: rgba(118,118,128,.09); }
.pm-chat-list__copy strong { font-size: 14px; font-weight: 650; letter-spacing: -.2px; }
.pm-chat-list__copy > small { color: #6c6c72; font-size: 11.5px; line-height: 1.25; }
.pm-chat-list__copy > em { font-size: 9px; }
.pm-chat-list__copy time { font-size: 10px; }
.pm-chat-list__avatar.is-maria { color: white; background: linear-gradient(145deg,#9b74ef,#5f3bb9); }
.pm-chat-list__avatar.is-federation { color: white; background: linear-gradient(145deg,#3159ad,#ef3733); }
.pm-chat-list__avatar.is-event { color: white; background: linear-gradient(145deg,#ff644f,#bf2b5c); }

.pm-chat-topbar { top: 46px; height: 62px; padding: 5px 7px; border-bottom: .5px solid rgba(60,60,67,.18); background: rgba(248,248,250,.82); backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7); }
.pm-chat-topbar__person { grid-template-columns: 42px minmax(0,1fr); }
.pm-chat-topbar__person strong { font-size: 14px; font-weight: 650; letter-spacing: -.2px; }
.pm-chat-topbar__person small { color: #6d6d72; font-size: 10px; font-weight: 500; }
.pm-community-avatar { width: 40px!important; height: 40px!important; border-radius: 50%!important; box-shadow: none; }
.pm-community-avatar.is-maria { background: linear-gradient(145deg,#9b74ef,#5f3bb9); }
.pm-community-avatar.is-federation { background: linear-gradient(145deg,#3159ad,#ef3733); }
.pm-chat-thread { inset: 108px 0 0; padding: 12px 10px calc(102px + var(--safe-bottom)); background: radial-gradient(circle at 15% 8%,rgba(49,89,173,.08),transparent 28%),radial-gradient(circle at 88% 62%,rgba(239,55,51,.055),transparent 24%),#e9edf3; }
.pm-chat-order { width: calc(100% - 6px); margin: 0 3px 11px; border: .5px solid rgba(60,60,67,.12); border-radius: 15px; background: rgba(255,255,255,.82); backdrop-filter: blur(16px); }
.pm-chat-order strong { font-size: 11px; }
.pm-chat-day span { padding: 5px 9px; color: rgba(255,255,255,.94); background: rgba(84,91,105,.54); backdrop-filter: blur(12px); font-size: 9px; font-weight: 650; }
.pm-chat-service { width: fit-content; max-width: 85%; display: flex; align-items: center; gap: 5px; margin: 7px auto; padding: 5px 9px; border-radius: 10px; color: rgba(255,255,255,.95); background: rgba(84,91,105,.5); backdrop-filter: blur(14px); font-size: 9px; line-height: 1.35; text-align: center; }

.pm-message-row { --pm-message-swipe: 0px; max-width: 100%; display: flex; align-items: center; gap: 4px; position: relative; margin: 3px 0; transform: translateX(var(--pm-message-swipe)); transition: transform 210ms var(--pm-ease-emphasized); touch-action: pan-y; }
.pm-message-row::before { content: "↩"; position: absolute; left: -34px; top: 50%; width: 28px; height: 28px; display: grid; place-items: center; transform: translateY(-50%) scale(.75); border-radius: 50%; color: white; background: var(--pm-blue); opacity: 0; transition: opacity 120ms ease, transform 160ms var(--pm-ease-emphasized); }
.pm-message-row.is-reply-ready::before { opacity: 1; transform: translateY(-50%) scale(1); }
.pm-message-row.is-outgoing { justify-content: flex-end; }
.pm-message-row.is-touching .pm-native-bubble { filter: brightness(.96); transform: scale(.985); }
.pm-native-bubble { max-width: 79%; min-width: 72px; position: relative; display: grid; gap: 4px; padding: 8px 10px 6px; border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: 0 1px 2px rgba(20,31,52,.1); transition: transform 130ms ease, filter 130ms ease; }
.pm-message-row.is-outgoing .pm-native-bubble { border-radius: 18px 18px 6px 18px; background: #d9e7ff; }
.pm-native-bubble > p { font-size: 13px; line-height: 1.34; letter-spacing: -.06px; white-space: pre-wrap; }
.pm-native-bubble > footer { display: flex; justify-content: flex-end; align-items: center; gap: 3px; min-height: 13px; color: #8a8a91; font-size: 8px; }
.pm-message-row.is-outgoing .pm-native-bubble > footer { color: #5876aa; }
.pm-message-sender { color: var(--pm-blue); font-size: 10px; font-weight: 700; }
.pm-native-bubble blockquote { display: grid; gap: 2px; margin: 0 0 2px; padding: 4px 7px; border-left: 3px solid var(--pm-blue); border-radius: 4px 8px 8px 4px; background: rgba(23,70,176,.07); }
.pm-native-bubble blockquote strong { color: var(--pm-blue); font-size: 9px; }
.pm-native-bubble blockquote span { max-width: 230px; overflow: hidden; color: #657087; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pm-message-more { width: 44px; height: 44px; position: absolute; z-index: 2; right: 0; top: 50%; display: grid; place-items: center; transform: translateY(-50%); border-radius: 50%; color: #8d94a1; background: rgba(233,237,243,.78); opacity: 0; transition: opacity 140ms ease; }
.pm-message-row:hover .pm-message-more,.pm-message-more:focus-visible { opacity: 1; }
.pm-message-row.is-outgoing .pm-message-more { left: 0; right: auto; }
.pm-message-reaction { position: absolute; right: 1px; bottom: -25px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 2px 7px; border: 9px solid #e9edf3; border-radius: 999px; background: white; box-shadow: 0 2px 5px rgba(30,43,66,.12); font-size: 12px; }
.pm-message-reaction small { color: #676e7b; font-size: 8px; }
.pm-message-row:has(.pm-message-reaction) { margin-bottom: 25px; }

.pm-native-voice { min-width: 218px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.pm-native-voice > button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--pm-blue); }
.pm-native-voice > strong { font-size: 9px; font-variant-numeric: tabular-nums; }
.pm-native-photo { display: grid; gap: 6px; margin: -5px -7px 0; }
.pm-native-photo img { width: 238px; height: 150px; border-radius: 15px 15px 8px 8px; object-fit: cover; }
.pm-native-photo figcaption { padding: 0 7px; font-size: 12px; line-height: 1.35; }
.pm-native-round { display: flex; align-items: flex-end; gap: 8px; }
.pm-native-round > button { width: 96px; height: 96px; position: relative; flex: 0 0 auto; padding: 0; border: 3px solid rgba(255,255,255,.86); border-radius: 50%; overflow: hidden; background: #16274a; }
.pm-native-round img { width: 100%; height: 100%; object-fit: cover; }
.pm-native-round button span { position: absolute; inset: 0; display: grid; place-items: center; color: white; background: rgba(7,19,39,.22); }
.pm-native-round button i { position: absolute; right: 11px; bottom: 8px; padding: 2px 5px; border-radius: 999px; color: white; background: rgba(0,0,0,.52); font-size: 8px; font-style: normal; }
.pm-native-round > p { max-width: 112px; padding-bottom: 7px; font-size: 12px; line-height: 1.35; }
.pm-native-file { min-width: 220px; display: grid; grid-template-columns: 38px minmax(0,1fr) 24px; align-items: center; gap: 8px; }
.pm-native-file > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg,#4576dc,#234ca8); }
.pm-native-file > p { min-width: 0; display: grid; gap: 2px; }
.pm-native-file strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pm-native-file small { overflow: hidden; color: var(--pm-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.pm-native-file > svg { color: var(--pm-blue); }
.pm-message-row.is-sticker .pm-native-bubble { min-width: 128px; padding: 0; background: transparent; box-shadow: none; }
.pm-native-sticker { width: 128px; height: 124px; margin: 0; }
.pm-native-sticker img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 15px rgba(29,41,69,.18)); animation: pm-sticker-float 3.4s ease-in-out infinite; }
.pm-message-row.is-sticker .pm-native-bubble > footer { padding-right: 5px; text-shadow: 0 1px 3px rgba(255,255,255,.9); }
.pm-message-row.has-round-video .pm-native-bubble { max-width: 88%; }

.pm-chat-composer { left: 6px; right: 6px; bottom: calc(8px + var(--safe-bottom)); min-height: 56px; padding: 5px; border: .5px solid rgba(60,60,67,.14); border-radius: 21px 21px 28px 28px; background: rgba(249,249,251,.9); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6); box-shadow: 0 12px 30px rgba(21,35,61,.16); }
.pm-chat-composer > button { border-radius: 50%; background: rgba(118,118,128,.1); }
.pm-chat-composer > button:first-of-type { color: var(--pm-blue); }
.pm-chat-composer > div:not(.pm-composer-reply) { min-height: 44px; height: auto; border: .5px solid rgba(60,60,67,.18); border-radius: 20px; background: white; }
.pm-chat-composer textarea { width: 100%; min-width: 0; max-height: 92px; min-height: 42px; resize: none; padding: 11px 4px 8px 12px; border: 0; outline: 0; color: var(--pm-ink); background: transparent; font: 15px/1.28 var(--pm-font); }
.pm-chat-composer.has-reply { grid-template-rows: auto auto; min-height: 102px; }
.pm-composer-reply { grid-column: 1 / -1; height: 40px!important; display: grid!important; grid-template-columns: 24px minmax(0,1fr) 36px!important; align-items: center; gap: 5px; padding: 3px 4px 3px 9px; border: 0!important; border-left: 3px solid var(--pm-blue)!important; border-radius: 7px 13px 13px 7px!important; background: rgba(23,70,176,.065)!important; }
.pm-composer-reply > span { color: var(--pm-blue); }
.pm-composer-reply p { min-width: 0; display: grid; gap: 1px; }
.pm-composer-reply strong { color: var(--pm-blue); font-size: 9px; }
.pm-composer-reply small { overflow: hidden; color: #687187; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pm-composer-reply button { width: 36px!important; height: 36px!important; }

.pm-message-action-preview { display: grid; gap: 7px; margin: 3px 0 12px; padding: 12px; border-left: 3px solid var(--pm-blue); border-radius: 8px 16px 16px 8px; background: rgba(23,70,176,.07); }
.pm-message-action-preview small { color: var(--pm-blue); font-size: 8px; font-weight: 800; letter-spacing: .8px; }
.pm-message-action-preview p { max-height: 58px; overflow: hidden; font-size: 12px; line-height: 1.4; }
.pm-message-actions { display: grid; overflow: hidden; border: .5px solid rgba(60,60,67,.12); border-radius: 17px; background: white; }
.pm-message-actions > button { min-height: 60px; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 12px; color: var(--pm-blue); text-align: left; background: transparent; }
.pm-message-actions > button + button { border-top: .5px solid rgba(60,60,67,.12); }
.pm-message-actions span { display: grid; gap: 2px; color: var(--pm-ink); }
.pm-message-actions strong { font-size: 12px; }
.pm-message-actions small { color: var(--pm-muted); font-size: 9px; }

.pm-chat-unavailable > section { display: grid; justify-items: center; gap: 10px; margin-top: 35px; padding: 28px 20px; border-radius: 24px; background: white; text-align: center; }
.pm-chat-unavailable > section > svg { color: var(--pm-blue); }
.pm-chat-unavailable h2 { font-size: 18px; }
.pm-chat-unavailable p { color: var(--pm-muted); font-size: 12px; line-height: 1.45; }

@media (pointer: coarse) {
  .pm-message-more { display: none; }
  button { touch-action: manipulation; }
}

@media (max-width: 680px) {
  .pm-status { font-size: 13px; }
  .pm-chat-topbar { top: calc(46px + var(--safe-top)); }
  .pm-chat-thread { inset: calc(108px + var(--safe-top)) 0 0; }
}
