/* Message composer and contact profile refinements. */
.message-chat-button svg {
  width: 14px !important;
  height: 14px !important;
}

/* Settings needs a few strong anchors so the narrow panel stays easy to scan. */
#settingsView .settings-shell { gap: 10px; }
#settingsView .settings-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
}
#settingsView .settings-tab { min-height: 30px; border: 1px solid transparent; border-radius: 6px; }
#settingsView .settings-tab.active {
  border-color: color-mix(in srgb, var(--ui-accent) 88%, white 12%);
  outline: 1px solid color-mix(in srgb, var(--ui-accent) 38%, transparent);
  outline-offset: -3px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-accent) 22%, transparent);
}
#settingsView .settings-grid { display: grid; gap: 10px; }
#settingsView .settings-feature-card {
  border: 1px solid color-mix(in srgb, var(--ui-border) 88%, white 12%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-surface-soft) 92%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 7%, transparent);
}
#settingsView .settings-feature-heading { padding-bottom: 7px; border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 64%, transparent); }
#settingsView .settings-feature-heading p { margin: 2px 0 0; color: var(--ui-muted); font-size: 9px; font-weight: 600; }
#settingsView .settings-profile-card { display: grid; gap: 9px; padding: 11px; }
#settingsView .settings-profile-preview-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: stretch; gap: 9px; }
#settingsView .settings-profile-preview-row .profile-preview {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0;
  border: 2px solid color-mix(in srgb, var(--ui-accent) 52%, var(--ui-border));
  border-radius: 8px;
  object-fit: cover;
  background: var(--ui-surface);
}
#settingsView .settings-profile-preview-row .settings-actions { display: grid; grid-template-columns: 1fr; gap: 6px; min-width: 0; }
#settingsView .settings-profile-preview-row .settings-actions button { width: 100%; min-width: 0; min-height: 32px; }
#settingsView .settings-primary-action {
  border-color: color-mix(in srgb, var(--ui-accent) 82%, white 18%) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 30%, transparent);
}
.appearance-studio-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; }
.appearance-studio-heading > div { min-width: 0; }
.appearance-back-button { display: grid; place-items: center; width: 34px; min-width: 34px; height: 34px; padding: 0; border: 1px solid color-mix(in srgb, var(--ui-border) 90%, white 10%); border-radius: 7px; }
.appearance-back-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#accountsSettingsPanel { gap: 9px; }
#accountsSettingsPanel .settings-panel-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center!important; gap:8px!important; height:38px!important; min-height:38px; max-height:38px; margin-bottom:0!important; padding-bottom:6px; }
#accountsSettingsPanel .settings-panel-heading #refreshAccountStatus { width:auto; min-width:0; height:30px!important; min-height:30px; padding:4px 9px; align-self:start; justify-self:end; }
#accountsSettingsPanel .account-settings-card { gap: 9px; padding: 10px; border-radius: 8px; }
#accountsSettingsPanel .account-home-card { gap: 9px; }
#accountsSettingsPanel .account-profile-row { gap: 9px; }
#accountsSettingsPanel .account-home-card {
  padding: 8px 0 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#accountsSettingsPanel .account-profile-row { display:flex; flex-direction:column; align-items:center; gap:9px; padding:7px 8px 5px; text-align:center; }
#accountsSettingsPanel .account-avatar-editor { position:relative; width:86px; height:86px; }
#accountsSettingsPanel .account-profile-row img { width:86px; height:86px; border:2px solid color-mix(in srgb,var(--ui-accent) 65%,white); border-radius:50%; object-fit:cover; box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-accent) 15%,transparent),0 10px 28px rgb(0 0 0 / 22%); }
#accountsSettingsPanel .account-profile-copy { width:100%; min-width:0; display:grid; justify-items:center; gap:4px; }
#accountsSettingsPanel .account-name-line { display:grid; grid-template-columns:minmax(0,auto) 25px; justify-content:center; align-items:center; gap:6px; width:min(100%,260px); min-width:0; }
#accountsSettingsPanel .account-name-line h4 { min-width:0; max-width:225px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:18px; }
#accountsSettingsPanel .account-edit-button { display:grid; place-items:center; flex:0 0 25px; width:25px!important; min-width:25px!important; height:25px!important; min-height:25px!important; padding:0!important; border-radius:50%; }
#accountsSettingsPanel .account-avatar-editor .account-edit-button { position:absolute; right:-2px; bottom:0; border:2px solid var(--ui-surface); background:var(--ui-accent); color:#07130f; }
#accountsSettingsPanel .account-avatar-editor .account-history-button { position:absolute; left:96px; bottom:1px; width:auto; min-width:64px; min-height:28px; padding:5px 10px; border-radius:8px; white-space:nowrap; }
#accountsSettingsPanel .account-edit-button svg { width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#accountsSettingsPanel .account-profile-row h4 { margin-bottom:1px; font-size:18px; }
#accountsSettingsPanel .account-profile-row p { margin: 0; font-size: 10px; line-height: 1.3; }
#accountsSettingsPanel .copy-row { gap:6px; margin-top:3px; padding-top:10px; border-top:1px solid color-mix(in srgb,var(--ui-border) 72%,transparent); }
#accountsSettingsPanel .copy-row input, #accountsSettingsPanel .copy-row button { min-height: 32px; }
#accountsSettingsPanel .account-primary-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
#accountsSettingsPanel .account-primary-actions button { min-height: 30px; padding: 4px 7px; font-size: 9px; }
#accountsSettingsPanel :is(#openCreateAccount,#openSignIn) { font-size:11px!important; font-weight:850!important; }
#accountsSettingsPanel .account-secondary-actions { gap: 6px; }
#accountsSettingsPanel .account-secondary-actions button { min-height: 29px; padding: 4px 6px; font-size: 9px; }

#accountsSettingsPanel #copyAccountCode {
  border-color:color-mix(in srgb,var(--ui-accent) 68%,var(--ui-border))!important;
  color:var(--ui-accent)!important;
  background:color-mix(in srgb,var(--ui-accent) 10%,transparent)!important;
}
#accountsSettingsPanel #openCreateAccount,
#accountsSettingsPanel #openSignIn {
  border-color:color-mix(in srgb,var(--ui-accent) 72%,var(--ui-border))!important;
  color:color-mix(in srgb,var(--ui-accent) 72%,white)!important;
  background:color-mix(in srgb,var(--ui-accent) 14%,var(--ui-surface))!important;
}
#accountsSettingsPanel #changePasswordButton,
#accountsSettingsPanel #forgetTrustedDevice {
  border-color:var(--ui-border)!important;
  color:var(--ui-text)!important;
  background:var(--ui-surface-soft)!important;
}
#accountsSettingsPanel #signOutAccount {
  border-color:color-mix(in srgb,var(--ui-border) 78%,var(--ui-muted))!important;
  color:var(--ui-muted)!important;
  background:color-mix(in srgb,var(--ui-surface-soft) 88%,transparent)!important;
}
#accountsSettingsPanel #deleteAccountButton {
  border-color:#ed6872!important;
  color:#ffd8da!important;
  background:rgb(237 104 114 / 20%)!important;
}
#accountsSettingsPanel #refreshAccountStatus {
  border-color:color-mix(in srgb,var(--ui-accent) 78%,white)!important;
  color:color-mix(in srgb,var(--ui-accent) 68%,white)!important;
  background:color-mix(in srgb,var(--ui-accent) 12%,transparent)!important;
}

.contact-profile-tabs { gap:8px!important; padding:4px!important; background:transparent!important; }
.contact-profile-tabs > button { min-height:38px!important; border:2px solid color-mix(in srgb,var(--ui-border) 86%,white 14%)!important; border-radius:8px!important; font-weight:900!important; background:var(--ui-surface)!important; }
.contact-profile-tabs > button.active { border-color:var(--ui-accent)!important; background:color-mix(in srgb,var(--ui-accent) 18%,var(--ui-surface))!important; box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-accent) 32%,transparent),0 0 0 2px color-mix(in srgb,var(--ui-accent) 12%,transparent)!important; }
#accountsSettingsPanel .account-switcher-panel.hidden { display: none !important; }
#accountsSettingsPanel .account-switcher-heading { display:grid; grid-template-columns:minmax(0,1fr) 30px; align-items:start; gap:8px; }
#accountsSettingsPanel .account-switcher-heading p { margin:2px 0 0; color:var(--ui-muted); font-size:9px; }
#accountsSettingsPanel .account-switcher-close { display:grid; place-items:center; width:30px; min-width:30px; height:30px; padding:0; font-size:18px; line-height:1; }
#accountsSettingsPanel .known-account { grid-template-columns:36px minmax(0,1fr) auto; gap:7px; padding:7px; border-radius:7px; }
#accountsSettingsPanel .known-account img { width:36px; height:36px; border-radius:7px; }
#accountsSettingsPanel .known-account button { min-height:30px; padding:4px 7px; }
#accountsSettingsPanel .account-safety-card { padding:0; }
#accountsSettingsPanel .account-safety-card:not([open]) { display:block; min-height:0!important; height:40px!important; max-height:40px!important; overflow:hidden; }
#accountsSettingsPanel .account-safety-card[open] { height:auto!important; max-height:none!important; }
#accountsSettingsPanel .account-safety-card:not([open]) > :not(summary) { display:none!important; }
#accountsSettingsPanel .account-safety-card summary { padding:10px; cursor:pointer; font-weight:800; list-style-position:inside; }
#accountsSettingsPanel .account-safety-card[open] summary { border-bottom:1px solid color-mix(in srgb,var(--ui-border) 70%,transparent); }
#accountsSettingsPanel .account-safety-content { display:grid; gap:8px; padding:10px; }
@media(max-width:320px){#accountsSettingsPanel .account-primary-actions{grid-template-columns:repeat(2,minmax(0,1fr))}#accountsSettingsPanel .account-primary-actions button{padding-inline:4px;font-size:9px}#accountsSettingsPanel .account-secondary-actions{grid-template-columns:1fr 1fr}}
.account-profile-row #accountAvatar,.settings-profile-preview-row #profilePreview{cursor:pointer}
.profile-editor-heading{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto 32px;align-items:center;gap:8px}
.profile-editor-heading>div{text-align:center;min-width:0}.profile-editor-heading button{width:auto!important;min-width:58px;min-height:32px;padding:5px 8px}
.profile-editor-heading .profile-editor-close{width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;padding:0!important;border-radius:8px!important;font-size:20px;line-height:1}
.profile-editor-stage{position:relative}.profile-editor-stage #profileEditorDrawing{position:absolute;z-index:3;inset:0;width:100%;height:100%;pointer-events:none;touch-action:none}.profile-editor-stage.drawing-mode #profileEditorDrawing{pointer-events:auto;cursor:crosshair}.profile-editor-stage.drawing-mode #profileEditorCanvas{pointer-events:none}
.profile-editor-enhance-tools{display:grid;grid-template-columns:minmax(0,1fr) auto 34px auto;align-items:end;gap:6px}.profile-editor-enhance-tools label{display:grid;gap:3px}.profile-editor-enhance-tools button,.profile-editor-enhance-tools input{min-height:32px}.profile-editor-enhance-tools input[type=color]{width:34px;padding:2px}
@media(max-width:320px){.profile-editor-heading{grid-template-columns:auto minmax(0,1fr) auto 30px;gap:4px}.profile-editor-heading p{display:none}.profile-editor-heading button{min-width:48px;padding-inline:5px}.profile-editor-heading .profile-editor-close{width:30px!important;min-width:30px!important;height:30px!important;min-height:30px!important}.profile-editor-enhance-tools{grid-template-columns:minmax(0,1fr) auto 32px}.profile-editor-enhance-tools #profileEditorClearDrawing{grid-column:1/-1}}
.message-contact.is-pinned{border-color:#e85d68!important;box-shadow:inset 0 0 0 1px rgb(232 93 104 / 28%)}
.message-contact.support-ai-contact{min-height:54px;padding-block:5px;border-color:#53d58a!important;box-shadow:inset 0 0 0 1px rgb(83 213 138 / 30%)}
.message-contact.support-ai-contact .message-contact-summary{grid-template-columns:36px minmax(0,1fr) auto!important;min-height:42px;padding-left:0!important}
.message-contact.support-ai-contact .avatar{width:34px;height:34px}.message-contact.support-ai-contact .message-row-actions{grid-template-columns:30px 30px}.message-contact.support-ai-contact .message-row-button,.message-contact.support-ai-contact .contact-options-button{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important}
.story-comment-reply{margin:7px 0 0 10px;padding-left:8px;border-left:2px solid color-mix(in srgb,var(--ui-accent) 55%,transparent)}.story-comment-copy>[data-story-comment-reply]{width:auto;min-height:24px;margin-top:4px;padding:3px 7px;font-size:9px}
.missed-call-card{display:grid;grid-template-columns:36px minmax(0,1fr);align-items:center;gap:9px;min-width:min(230px,100%);padding:10px;border:1px solid color-mix(in srgb,#ef6b73 65%,var(--ui-border));border-radius:8px;background:color-mix(in srgb,var(--ui-surface-strong) 90%,#ef6b73 10%)}.missed-call-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:rgb(239 107 115 / 16%);color:#ff8990}.missed-call-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}.missed-call-card>span:nth-child(2){display:grid;gap:2px}.missed-call-card small{color:#ff8990;font-size:8px;font-weight:850}.missed-call-card strong{font-size:11px}.missed-call-card time{color:var(--ui-muted);font-size:9px}.missed-call-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:6px}.missed-call-actions button{min-height:30px;padding:4px 7px;font-size:9px}
#settingsView input:not([type="range"]), #settingsView select, #settingsView textarea { border-color: color-mix(in srgb, var(--ui-border) 90%, white 10%); }
#settingsView input:not([type="range"]):focus, #settingsView select:focus, #settingsView textarea:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-accent) 24%, transparent);
}

@media (max-width: 320px) {
  #settingsView .settings-tabs { overflow-x: auto; grid-template-columns: repeat(5, minmax(54px, 1fr)); scrollbar-width: none; }
  #settingsView .settings-profile-preview-row { grid-template-columns: 64px minmax(0, 1fr); }
  #settingsView .settings-profile-preview-row .profile-preview { width: 64px; height: 64px; }
}

.media-source-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.first-use-welcome {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  color: var(--ui-text, var(--text));
  background: color-mix(in srgb, var(--ui-bg, var(--background)) 92%, var(--ui-accent, var(--accent)) 8%);
  opacity: 1;
  transition: opacity 200ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}
.first-use-welcome.leaving {
  opacity: 0;
  transform: translateY(-8px) scale(.985);
  pointer-events: none;
}
.first-use-welcome-content {
  display: grid;
  justify-items: center;
  width: min(100%, 470px);
  text-align: center;
}
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > * {
  animation: first-use-drop-settle 620ms cubic-bezier(.2,.86,.26,1.18) both;
}
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > :nth-child(1) { animation-delay: 35ms; }
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > :nth-child(2) { animation-delay: 90ms; }
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > :nth-child(3) { animation-delay: 135ms; }
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > :nth-child(4) { animation-delay: 180ms; }
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > :nth-child(5) { animation-delay: 225ms; }
.first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > :nth-child(6) { animation-delay: 270ms; }
@keyframes first-use-drop-settle {
  0% { opacity: 0; transform: translateY(-34px) scale(.97); }
  68% { opacity: 1; transform: translateY(4px) scale(1.008); }
  84% { transform: translateY(-2px) scale(.997); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.first-use-brand-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 24px;
  border: 1px solid color-mix(in srgb, var(--ui-accent, var(--accent)) 44%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-surface-strong, var(--glass)) 88%, transparent);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--ui-accent, var(--accent)) 22%, transparent), inset 0 1px 0 rgb(255 255 255 / 18%);
}
.first-use-brand-mark img { width: 60px; height: 60px; object-fit: contain; }
.first-use-eyebrow {
  margin: 0 0 8px;
  color: var(--ui-accent, var(--accent));
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
}
.first-use-welcome h1 {
  max-width: 420px;
  margin: 0;
  font-size: clamp(32px, 9vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}
.first-use-welcome-content > p:not(.first-use-eyebrow) {
  margin: 15px 0 25px;
  color: var(--ui-muted, var(--muted));
  font-size: 15px;
  line-height: 1.5;
}
.first-use-welcome #continueFirstUse {
  width: min(100%, 280px);
  min-height: 46px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 850;
}
.first-use-welcome small {
  margin-top: 14px;
  color: var(--ui-muted, var(--muted));
  font-size: 9px;
}
@media (max-height: 560px) {
  .first-use-welcome { padding: 16px; }
  .first-use-brand-mark { width: 72px; height: 72px; margin-bottom: 15px; }
  .first-use-brand-mark img { width: 48px; height: 48px; }
  .first-use-welcome-content > p:not(.first-use-eyebrow) { margin: 10px 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .first-use-welcome { transition: opacity 1ms linear; }
  .first-use-welcome.leaving { transform: none; }
  .first-use-welcome:not(.hidden):not(.leaving) .first-use-welcome-content > * { animation: none; }
}
.auth-transition {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  color: white;
  background: #2468d7;
  clip-path: circle(0 at var(--auth-origin-x, 50%) var(--auth-origin-y, 50%));
  transition: clip-path 680ms cubic-bezier(.16,1,.3,1), opacity 360ms ease, filter 360ms ease;
}
.auth-transition.active { clip-path: circle(155vmax at var(--auth-origin-x, 50%) var(--auth-origin-y, 50%)); }
.auth-transition.complete { opacity: 0; filter: saturate(.72) brightness(1.14); pointer-events: none; }
.auth-transition-content {
  display: grid;
  justify-items: center;
  width: min(100%, 430px);
  text-align: center;
}
.auth-transition-content > img {
  width: 62px;
  height: 62px;
  margin-bottom: 17px;
  border: 1px solid rgb(255 255 255 / 36%);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgb(4 30 88 / 32%);
}
.auth-transition-content > p {
  margin: 0 0 7px;
  color: rgb(255 255 255 / 76%);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0;
}
.auth-transition h1 {
  margin: 0 0 24px;
  font-size: clamp(29px, 9vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}
.auth-transition-steps {
  display: grid;
  gap: 9px;
  width: min(100%, 330px);
  min-height: 150px;
  text-align: left;
}
.auth-transition-steps p {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
  color: rgb(255 255 255 / 84%);
  font-size: 12px;
  line-height: 1.25;
  animation: auth-step-arrive 220ms cubic-bezier(.2,.8,.2,1) both;
}
.auth-transition-steps p span {
  width: 10px;
  height: 10px;
  border: 2px solid rgb(255 255 255 / 52%);
  border-top-color: white;
  border-radius: 50%;
  animation: auth-step-spin 720ms linear infinite;
}
.auth-transition-steps p.done { color: white; }
.auth-transition-steps p.done span {
  border-color: #9ff4c7;
  background: #43d68f;
  animation: none;
}
@keyframes auth-step-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-step-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .auth-transition { transition: opacity 1ms linear; clip-path: none; }
  .auth-transition-steps p { animation: none; }
  .auth-transition-steps p span { animation: none; }
}
.auth-server-actions {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.auth-server-actions button { min-height: 38px !important; }
.auth-server-status {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--ui-border);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--ui-muted);
  background: var(--ui-surface-soft);
  font-size: 11px;
  font-weight: 750;
}
.auth-server-actions #connectAuthServers.connected {
  border-color: #43d68f !important;
  color: #8ff0bd !important;
  background: color-mix(in srgb, #43d68f 12%, var(--ui-surface-strong, var(--glass))) !important;
  box-shadow: inset 0 0 0 1px rgb(67 214 143 / 25%) !important;
}
.auth-server-actions #connectAuthServers.connection-failed { border-color: color-mix(in srgb, var(--ui-danger) 68%, var(--ui-border)) !important; color: var(--ui-danger); }
.auth-server-actions #connectAuthServers.connecting { color: var(--ui-info); }
.auth-server-actions .auth-reload-button {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  padding: 0 !important;
  border-radius: 8px 0 0 8px !important;
}
.auth-server-actions .auth-reload-button:disabled svg,
.auth-overlay.auth-server-gated .auth-reload-button svg {
  animation: auth-server-retry-spin .7s linear infinite !important;
  animation-duration: .7s !important;
  animation-iteration-count: infinite !important;
}
@keyframes auth-server-retry-spin { to { transform: rotate(360deg); } }
.auth-overlay.auth-server-gated .auth-card > :not(.auth-brand) {
  opacity: .34;
  filter: grayscale(1);
  pointer-events: none;
  user-select: none;
  transition: opacity 180ms ease, filter 180ms ease;
}
.auth-overlay.auth-server-gated .auth-brand > :not(.auth-server-actions) {
  opacity: .58;
  filter: grayscale(.7);
}
.auth-overlay.auth-server-gated .auth-server-actions {
  position: relative;
  z-index: 2;
  filter: none;
  opacity: 1;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-info) 28%, transparent), 0 8px 20px rgb(0 0 0 / 22%);
  border-radius: 8px;
}
.message-history-loading,
.conversation-say-hello {
  align-self: center;
  margin: auto;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.message-history-loading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.message-history-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--ui-muted) 34%, transparent);
  border-top-color: var(--ui-accent);
  border-radius: 50%;
  animation: auth-server-retry-spin .72s linear infinite !important;
  animation-iteration-count: infinite !important;
}
.conversation-say-hello { opacity: .62; }
.auth-reload-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#menuContentButton {
  grid-column: 1 / -1;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  min-height: 64px !important;
  padding: 10px 12px !important;
  border-color: color-mix(in srgb, var(--ui-accent, var(--accent)) 58%, var(--ui-border)) !important;
  background: color-mix(in srgb, var(--ui-accent, var(--accent)) 12%, var(--ui-surface-strong, var(--glass))) !important;
}
#menuContentButton .menu-content-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  color: white;
  background: var(--ui-accent, var(--accent));
}
#menuContentButton .menu-content-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#menuContentButton .menu-content-icon svg path:first-of-type { fill: currentColor; stroke: none; }
#menuContentButton strong { font-size: 12px; }
#menuContentButton small { font-size: 9px; }
.auth-brand {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) !important;
  align-items: center !important;
}
.auth-brand > img { grid-column: 1; grid-row: 1 / span 2; }
.auth-brand > div:not(.auth-server-actions) { grid-column: 2; grid-row: 1; min-width: 0; }
.auth-brand > .auth-server-actions { grid-column: 2; grid-row: 2; margin-top: 7px; }
@media (min-width: 520px) {
  .auth-brand { grid-template-columns: 40px minmax(0, 1fr) minmax(150px, 190px) !important; }
  .auth-brand > img { grid-row: 1; }
  .auth-brand > .auth-server-actions { grid-column: 3; grid-row: 1; margin-top: 0; }
}

/* Chat video: large media, one central control, contextual secondary actions. */
.message:has(.attachment-video-frame) {
  width: min(94%, 430px) !important;
  max-width: min(94%, 430px) !important;
}
.message .attachment-video-frame {
  width: 100%;
  max-width: 430px;
  border-radius: 10px;
}
.message .video-stage {
  min-height: 150px;
  max-height: min(62vh, 520px);
  aspect-ratio: auto;
}
.message .attachment-video-frame video {
  min-height: 150px;
  max-height: min(62vh, 520px);
  object-fit: contain;
}
.video-center-play {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 160ms ease, transform 160ms ease !important;
  outline: 0 !important;
  box-shadow: 0 8px 22px rgb(0 0 0 / 34%), inset 0 0 0 1px rgb(255 255 255 / 68%) !important;
}
.video-center-play:hover,
.video-center-play:active,
.video-center-play:focus,
.video-center-play:focus-visible {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  outline: 0 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  box-shadow: 0 8px 22px rgb(0 0 0 / 34%), inset 0 0 0 1px rgb(255 255 255 / 68%) !important;
}
.video-center-play svg,
.video-center-play:hover svg,
.video-center-play:active svg,
.video-center-play:focus-visible svg {
  width: 17px !important;
  height: 17px !important;
}
.video-center-play.playing {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.92);
}
.video-center-play.playing:hover,
.video-center-play.playing:active,
.video-center-play.playing:focus-visible {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.92) !important;
}
.video-options-menu {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 8px;
  display: grid;
  min-width: 124px;
  padding: 4px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 7px;
  background: rgb(5 10 18 / 92%);
  box-shadow: 0 10px 28px rgb(0 0 0 / 38%);
  backdrop-filter: blur(10px);
}
.video-options-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  color: white;
  background: transparent;
  text-align: left;
}
.video-options-menu button:hover,
.video-options-menu button:focus-visible { background: rgb(255 255 255 / 12%); }
.video-options-menu svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.video-playback-error {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
  padding: 6px 8px !important;
  border-width: 0 0 0 3px !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--danger) 18%, var(--ui-surface-strong)) !important;
  backdrop-filter: none !important;
  font-size: 9px !important;
  line-height: 1.25 !important;
}
.video-download-source { display: none !important; }
.video-expanded-exit {
  position: absolute;
  z-index: 7;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50% !important;
  color: white;
  background: rgb(5 10 18 / 72%);
}
.video-player.video-expanded {
  position: fixed !important;
  z-index: 2147483600 !important;
  inset: 0 !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
}
body.video-overlay-open { overflow: hidden !important; }
.video-player.video-expanded .video-stage,
.video-player.video-expanded video {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}
.video-player.video-expanded .video-playback-error { position: absolute !important; inset: auto 10px 10px !important; z-index: 8; }

.attachment-preview:has(.attachment-video-frame) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  max-height: 180px;
  overflow: auto;
  padding: 6px;
}
.attachment-preview .media-preview-content:has(.attachment-video-frame) { max-width: 190px; }
.attachment-preview .attachment-video-frame { max-width: 190px; border-radius: 7px; }
.attachment-preview .video-stage,
.attachment-preview .attachment-video-frame video {
  min-height: 0;
  max-height: 112px;
  aspect-ratio: 16 / 9;
}
.attachment-preview .video-center-play {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}
.attachment-preview .video-center-play:hover,
.attachment-preview .video-center-play:active,
.attachment-preview .video-center-play:focus-visible {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}
.attachment-preview .video-options-menu { right: 4px; bottom: 4px; }

.contact-profile-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--ui-border, var(--glass-line));
  border-radius: 8px;
  background: var(--ui-surface-soft, var(--glass));
}
.contact-profile-tabs button {
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--ui-muted, var(--muted));
}
.contact-profile-tabs button.active {
  border-color: color-mix(in srgb, var(--ui-accent, var(--accent)) 38%, transparent);
  background: color-mix(in srgb, var(--ui-accent, var(--accent)) 17%, var(--ui-surface-strong, var(--glass)));
  color: var(--ui-text, var(--text));
}
.contact-profile-panel { min-width: 0; }
.contact-profile-panel[hidden] { display: none !important; }
.contact-profile-content { display: grid; gap: 7px; min-height: 116px; }
.contact-profile-content-empty {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 116px;
  padding: 18px;
  text-align: center;
  color: var(--ui-muted, var(--muted));
}
.contact-profile-content-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.contact-profile-content-card {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 9 / 13;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 7px !important;
  background: var(--ui-surface-strong, var(--glass));
  text-align: left;
}
.contact-profile-content-card img,
.contact-profile-content-card video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.contact-profile-content-card .profile-content-fallback { display: grid; place-items: center; height: 100%; padding: 9px; text-align: center; }
.contact-profile-content-card span:last-child {
  position: absolute;
  inset: auto 5px 5px;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgb(4 10 18 / 72%);
  color: white;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-profile-page {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: block;
  color: var(--ui-text, var(--text));
  background: var(--ui-bg, var(--background, #080b12));
  overflow: hidden;
}
.contact-profile-page.hidden { display: none; }
.contact-profile-page-inner {
  width: 100%;
  height: 100%;
  padding: 58px 16px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.contact-profile-page-controls {
  position: fixed;
  inset: 12px 12px auto;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.contact-profile-page-controls .icon-command {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  color: var(--ui-text, var(--text));
  background: color-mix(in srgb, var(--ui-surface-strong, #151c27) 92%, transparent);
  box-shadow: 0 6px 18px rgb(0 0 0 / 24%);
  pointer-events: auto;
}
.contact-profile-page-controls .icon-command.active {
  border-color: var(--ui-accent, var(--accent));
  color: var(--ui-accent, var(--accent));
}
.contact-profile-page-controls svg,
.support-ai-actions-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-profile-page .contact-profile-hero {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 4px 0 18px;
  text-align: center;
}
.contact-profile-page .contact-dialog-avatar { width: 88px; height: 88px; }
.contact-profile-page .contact-profile-hero h3 { max-width: min(100%, 360px); margin: 3px 0 0; overflow-wrap: anywhere; }
.contact-profile-page .contact-profile-panel { width: min(100%, 720px); margin-inline: auto; }
.contact-profile-page .contact-settings-panel { display: grid; gap: 12px; padding-bottom: 22px; }
.contact-profile-page .contact-code { margin: 0; text-align: center; }
.contact-profile-content { gap: 14px; min-height: 0; }
.contact-highlight-strip {
  display: flex;
  gap: 11px;
  padding: 3px 1px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
}
.contact-profile-highlight {
  flex: 0 0 74px;
  width: 74px;
  aspect-ratio: 1;
  border: 2px solid color-mix(in srgb, var(--ui-accent, var(--accent)) 72%, white) !important;
  border-radius: 50% !important;
  scroll-snap-align: start;
}
.contact-profile-highlight span:last-child {
  inset: auto 2px -22px;
  padding: 0;
  background: transparent;
  color: var(--ui-text, var(--text));
  text-align: center;
}
.contact-highlight-strip:has(.contact-profile-highlight) { padding-bottom: 27px; }
.contact-profile-reel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.contact-profile-reel { aspect-ratio: 9 / 14; border-radius: 8px !important; }
.contact-profile-reel-grid:empty,
.contact-highlight-strip:empty { display: none; }

.badge-detail-page { z-index: 10020; }

.support-ai-actions-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(3 7 13 / 64%);
  backdrop-filter: blur(12px);
}
.support-ai-actions-card {
  position: relative;
  display: grid;
  gap: 11px;
  width: min(330px, 100%);
  padding: 18px;
  border: 1px solid var(--ui-border, var(--glass-line));
  border-radius: 8px;
  color: var(--ui-text, var(--text));
  background: var(--ui-surface-strong, #151c27);
  box-shadow: 0 22px 70px rgb(0 0 0 / 42%);
}
.support-ai-actions-card h2 { margin: 0 40px 2px 0; font-size: 18px; }
.support-ai-actions-card label { display: grid; gap: 6px; color: var(--ui-muted, var(--muted)); font-size: 10px; font-weight: 800; }
.support-ai-actions-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

@media (max-width: 520px) {
  .contact-profile-page-inner { padding-inline: 12px; }
  .contact-profile-reel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .conversation-screen > .composer {
    grid-template-columns: 32px 38px 32px minmax(0, 1fr) !important;
    gap: 5px !important;
    padding: 7px !important;
  }
  .conversation-screen > .composer > #messageInput {
    grid-column: 1 / -1 !important;
    order: -1;
    min-height: 38px !important;
  }
  .conversation-screen > .composer > #attachButton { grid-column: 1; }
  .conversation-screen > .composer > #messageGiphyButton { grid-column: 2; }
  .conversation-screen > .composer > #voiceNoteButton { grid-column: 3; }
  .conversation-screen > .composer > #sendMessageButton {
    grid-column: 4;
    justify-self: end;
    min-width: 58px !important;
  }
  .conversation-screen > .composer > :is(.reply-preview, .voice-recording-bar, .attachment-preview, .upload-progress, .mention-suggestions) {
    grid-column: 1 / -1 !important;
    order: -2;
  }
}

/* Release 5.5.40: stable chat tools, faithful social media, and compact destinations. */
.conversation-screen > .composer {
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  gap: 5px 7px !important;
  padding: 7px 8px !important;
}
.conversation-screen > .composer > #messageInput {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  min-height: 38px !important;
}
.conversation-screen > .composer > .composer-tool-bar {
  grid-column: 1 !important;
  grid-row: 2 !important;
  display: grid;
  grid-template-columns: repeat(3, 36px);
  justify-content: start;
  gap: 7px;
  width: max-content;
  padding: 3px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-surface-soft);
}
.conversation-screen > .composer > .composer-tool-bar > button {
  width: 36px !important;
  min-width: 36px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  box-shadow: none !important;
}
.conversation-screen > .composer > .composer-tool-bar > button:hover,
.conversation-screen > .composer > .composer-tool-bar > button:focus-visible {
  background: color-mix(in srgb, var(--ui-accent) 16%, transparent) !important;
}
.conversation-screen > .composer > #sendMessageButton {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 58px !important;
}
.conversation-screen > .composer > :is(.reply-preview, .voice-recording-bar, .attachment-preview, .upload-progress, .mention-suggestions) {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
}

.reel-card,
.reel-editor-stage { container-type: inline-size; }
.reel-card .reel-media-stage > video,
.reel-card .reel-media-stage > img,
.app-shell.discover-mode.reels-active.reel-focus-mode .reel-card .reel-media-stage > video,
.app-shell.discover-mode.reels-active.reel-focus-mode .reel-card .reel-media-stage > img,
.reel-editor-stage > video,
.reel-editor-stage > img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0 !important;
}
.reel-rendered-overlays,
.reel-overlay-layer { width: 100%; height: 100%; }
.reel-gradient { pointer-events: none; }

.reel-comments-dialog[open] {
  padding: 8px !important;
  place-items: end center !important;
}
.reel-comments-sheet {
  width: min(100%, 520px);
  max-height: min(76dvh, 680px);
  border: 1px solid var(--ui-border-strong);
  border-radius: 16px 16px 0 0;
  background: var(--ui-bg-raised);
  box-shadow: 0 -18px 48px rgb(0 0 0 / 35%);
}
.reel-comments-sheet > header {
  grid-template-columns: minmax(0, 1fr) 88px 34px;
  padding: 10px 12px;
  text-align: left;
}
.reel-comments-list { gap: 4px; padding: 8px 10px 12px; }
.reel-comment {
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 70%, transparent);
}
.reel-comment:last-child { border-bottom: 0; }
.reel-comment p { margin: 2px 0 4px; font-size: 12px; }
.reel-comment-reply {
  margin: 6px 0 0 2px;
  padding: 7px 0 0 8px;
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--ui-accent) 45%, transparent);
}
.reel-comment-form { padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }

.content > .activity-view.active-view {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 8px !important;
  overflow-y: auto !important;
}
.activity-view .activity-heading { padding: 9px 10px !important; border-radius: 10px !important; }
.activity-view .activity-filters { position: static !important; border-radius: 10px !important; }
.activity-view button.activity-item { border-radius: 9px !important; }

#settingsView .settings-profile-card { display: none !important; }

.call-dialog .call-card { width: min(100%, 390px) !important; gap: 8px !important; padding: 10px !important; }
.call-dialog .call-panel-header { grid-template-columns: 48px minmax(0, 1fr) 34px; gap: 8px; }
.call-dialog .call-avatar { width: 48px; height: 48px; }
.call-dialog .call-media-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.call-dialog .call-media-actions button { min-width: 0; min-height: 38px; padding: 6px 4px; font-size: 10px; }
.call-dialog .call-media-actions { justify-items: center; }
.call-dialog .call-media-button { display:grid; place-items:center; width:44px; min-width:44px!important; height:44px; min-height:44px!important; padding:0!important; border-radius:12px; color:var(--ui-text); background:color-mix(in srgb,var(--ui-surface-strong) 92%,white 8%); transition:color 160ms ease,border-color 160ms ease,background 160ms ease,box-shadow 160ms ease,transform 160ms ease; }
.call-dialog .call-media-button:hover:not(:disabled) { transform:translateY(-1px); }
.call-dialog .call-media-button:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; }
.call-dialog .call-control-icon { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.call-dialog .call-media-button .state-slash { opacity:0; }
.call-dialog #toggleCallMutePanel.is-muted { color:#fff; border-color:#ef6b73; background:#b93643; box-shadow:0 0 0 2px rgb(239 107 115 / 16%); }
.call-dialog #toggleCallMutePanel.is-muted .state-slash { opacity:1; }
.call-dialog #toggleCamera.is-on { color:#062016; border-color:#64dda6; background:#64dda6; box-shadow:0 0 0 2px rgb(100 221 166 / 16%); }
.call-dialog #toggleCamera:not(.is-on) .state-slash { opacity:1; }
.call-dialog .remote-mic-status { display:inline-flex; align-items:center; gap:4px; width:max-content; max-width:100%; margin-top:3px; padding:3px 7px; border:1px solid rgb(239 107 115 / 58%); border-radius:999px; color:#ff9da3; background:rgb(239 107 115 / 11%); font-size:9px; font-weight:850; line-height:1.2; }
.call-dialog .remote-mic-status.hidden { display:none; }
.call-dialog .remote-mic-status svg { flex:0 0 auto; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.call-dialog .remote-mic-status span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.call-dialog .call-top-up-controls {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 6px !important;
  padding: 8px !important;
  border-radius: 10px !important;
}
.call-dialog .call-top-up-controls > label:first-child { grid-column: 1 / -1; }
.call-dialog .call-top-up-controls select { grid-column: 1; min-width: 0; }
.call-dialog .call-top-up-controls #callTopUp { grid-column: 2; min-width: 92px !important; }
.call-dialog #endCall { min-height: 42px; }

.story-viewer-dialog[open] { padding: 7px !important; }
.story-viewer-dialog .story-viewer-card {
  width: min(100%, 405px) !important;
  height: calc(100dvh - 14px) !important;
  max-height: 760px !important;
  padding: 0 !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}
.story-viewer-stage img,
.story-viewer-stage video { object-fit: contain !important; }
.story-comments-drawer { max-height: min(38dvh, 300px); border-radius: 10px; }
.story-composer-tool-rail .icon-command::after { transition: none !important; }

.discover-view .destination-heading {
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr) !important;
  gap: 8px !important;
}
.discover-header-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
  align-items: center;
  min-width: 0;
}
.discover-header-actions input {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 10px;
}
.discover-header-actions #refreshDiscover {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
}
.reel-feed-navigation { grid-template-columns: 36px minmax(0, 1fr) auto !important; gap: 5px !important; }
.reel-feed-tabs { padding: 3px !important; border-radius: 9px !important; }
.reel-feed-tabs button {
  min-height: 28px !important;
  height: 28px !important;
  padding: 3px 7px !important;
  border-radius: 7px !important;
  font-size: 9px !important;
}
.discover-create-reel { min-height: 34px !important; height: 34px !important; padding: 4px 7px !important; font-size: 9px !important; }

.discover-search-scope-card,
.pin-limit-card { width: min(100%, 360px) !important; position: relative; }
.discover-search-scope-dialog { width: min(390px, calc(100vw - 18px)) !important; border-radius: 12px !important; }
.discover-search-scope-card { gap: 12px; padding: 16px; background: linear-gradient(145deg, rgb(26 43 55 / 98%), rgb(14 24 34 / 99%)); }
.discover-search-scope-card .story-dialog-heading { padding-right: 38px; }
.discover-search-scope-card .story-dialog-heading h2 { font-size: 18px; }
.discover-search-scope-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; border: 1px solid var(--ui-border); border-radius: 8px; background: rgb(4 10 16 / 38%); }
.discover-search-scope-actions button { min-width: 0; min-height: 34px; height: 34px; padding: 5px; border-radius: 6px !important; background: transparent !important; }
.discover-search-scope-actions button.active { color: #07131b !important; border-color: #7ce0da !important; background: #69cbc5 !important; box-shadow: 0 0 18px rgb(105 203 197 / 22%) !important; }
.discover-search-results { display: grid; gap: 7px; max-height: min(420px, 52dvh); overflow-y: auto; }
.discover-search-result { display: grid !important; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 9px; width: 100%; min-height: 54px; padding: 7px 9px !important; text-align: left; border: 1px solid var(--ui-border) !important; border-radius: 8px !important; background: rgb(255 255 255 / 4%) !important; }
.discover-search-result:hover { border-color: #69cbc5 !important; background: rgb(105 203 197 / 10%) !important; transform: none !important; }
.discover-search-result-avatar { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; background: var(--ui-surface-soft); font-weight: 800; }
.discover-search-result-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.discover-search-result-copy { min-width: 0; display: grid; gap: 2px; }
.discover-search-result-copy strong, .discover-search-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-search-result-copy small { color: var(--ui-muted); font-size: 10px; }
.discover-search-result-arrow { color: #69cbc5; font-size: 22px; text-align: right; }
.discover-search-empty { display: grid; place-items: center; gap: 5px; min-height: 150px; padding: 20px; text-align: center; color: var(--ui-muted); }
.discover-search-empty strong { color: var(--ui-text); }
.dialog-corner-close { position: sticky !important; z-index: 100; top: 8px; float: right; display: grid !important; place-items: center; width: 32px !important; min-width: 32px !important; height: 32px !important; min-height: 32px !important; margin: 8px 8px -40px auto !important; padding: 0 !important; border-radius: 8px !important; font-size: 21px !important; line-height: 1 !important; }
.reels-background-refresh { position: sticky; z-index: 8; top: 6px; display: flex; align-items: center; gap: 6px; width: fit-content; margin: 6px auto -34px; padding: 5px 9px; border: 1px solid var(--ui-border); border-radius: 8px; color: var(--ui-muted); background: rgb(10 19 27 / 88%); backdrop-filter: blur(12px); font-size: 10px; }
.reels-background-refresh .loading-spinner { width: 12px; height: 12px; border-width: 2px; }
.pin-limit-card { display: grid; gap: 9px; }
.pin-limit-card h2,
.pin-limit-card p { margin: 0; }
.pin-limit-close { position: absolute; top: 9px; right: 9px; width: 32px !important; min-width: 32px !important; height: 32px !important; min-height: 32px !important; }

.message-contact { position: relative; }
.message-contact .message-contact-summary { padding-left: 28px !important; }
.message-pin-toggle {
  position: absolute !important;
  z-index: 3;
  left: 4px;
  top: 50%;
  display: grid !important;
  place-items: center;
  width: 23px !important;
  min-width: 23px !important;
  height: 23px !important;
  min-height: 23px !important;
  padding: 4px !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 7px !important;
  color: color-mix(in srgb, var(--ui-muted) 72%, transparent) !important;
  background: var(--ui-surface-soft) !important;
  box-shadow: inset 0 1px rgb(255 255 255 / 8%) !important;
  transform: translateY(-50%);
}
.message-pin-toggle:hover,
.message-pin-toggle:focus-visible,
.message-pin-toggle:active { transform: translateY(-50%) !important; }
.message-pin-toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.message-pin-toggle.active {
  border-color: #ef5c67 !important;
  color: #ff6d78 !important;
  background: rgb(239 92 103 / 13%) !important;
}
.message-pin-toggle.support-pin {
  border-color: #43d68f !important;
  color: #56e5a0 !important;
  background: rgb(67 214 143 / 13%) !important;
  opacity: 1 !important;
}
.message-contact .message-pin { display: none !important; }

@media (max-width: 320px) {
  .discover-view .destination-heading { grid-template-columns: 88px minmax(0, 1fr) !important; }
  .discover-header-actions { grid-template-columns: minmax(0, 1fr) 32px; }
  .discover-header-actions #refreshDiscover { width: 32px !important; min-width: 32px !important; }
  .discover-header-actions input { font-size: 9px; padding-inline: 6px; }
}
.perimeter-loader {
  position: absolute;
  inset: 0;
  z-index: 10020;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.perimeter-loader rect {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 84%, white 16%);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 50 50;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 70%, transparent));
  animation: perimeter-loader-run .72s linear infinite;
}

@keyframes perimeter-loader-run { to { stroke-dashoffset: -100; } }

.activity-view .activity-person {
  position: relative;
  overflow: visible;
  padding: 0;
  background: color-mix(in srgb, var(--pg-mid) 90%, transparent);
}

.activity-view .activity-person > img,
.activity-view .activity-person > span {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: grid;
  place-items: center;
}

.activity-view .activity-person > i {
  position: absolute;
  right: -9px;
  bottom: -6px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ui-bg);
  border-radius: 50%;
  color: #07130f;
  background: var(--accent);
  font: 900 9px/1 system-ui, sans-serif;
  font-style: normal;
}

#toggleCamera.is-busy { opacity: .68; }

@media (prefers-reduced-motion: reduce) {
  .perimeter-loader rect { animation-duration: 1.4s; }
}
.name-with-badge { min-width: 0; max-width: 100%; }
.name-with-badge > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-with-badge > .profile-badge { flex: 0 1 auto; min-width: 0; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-badge { cursor: pointer; }

.global-search-page,
.badge-detail-page {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  color: var(--text);
  background: var(--background, #080b12);
  overflow: auto;
}

.global-search-page.hidden,
.badge-detail-page.hidden { display: none; }

.global-search-page .global-search-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  min-height: 100%;
}

.badge-detail-header { display: flex; justify-content: space-between; }
.badge-owner { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.badge-owner .avatar { width: 48px; height: 48px; }
.badge-owner > span:last-child { display: grid; gap: 3px; }
.badge-owner small { color: var(--muted); }
.badge-showcase { display: grid; place-items: center; min-height: 230px; }
.badge-detail-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: min(230px, 68vw);
  min-height: 150px;
  padding: 30px 22px;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 72%, white);
  border-radius: 18px;
  color: var(--ui-text);
  background: linear-gradient(145deg, color-mix(in srgb, var(--ui-accent) 28%, var(--ui-surface-strong)), color-mix(in srgb, var(--ui-info) 16%, var(--ui-bg-raised)));
  box-shadow: inset 0 1px rgb(255 255 255 / .26), inset 0 0 32px color-mix(in srgb, var(--ui-accent) 18%, transparent), 0 18px 48px rgb(0 0 0 / .28), 0 0 28px color-mix(in srgb, var(--ui-accent) 28%, transparent);
  text-align: center;
  font-size: clamp(22px, 7vw, 34px);
  font-weight: 950;
  overflow-wrap: anywhere;
}
.badge-detail-page > h2, .badge-detail-page > p { text-align: center; }
.badge-detail-help { padding: 12px; border: 1px solid var(--pg-stroke); border-radius: 8px; background: var(--pg-low); }

.discover-header-actions { grid-template-columns: minmax(0, 1fr) 34px 34px !important; }
.discover-header-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.profile-picture-choice-card { width:min(360px,calc(100vw - 24px)); padding:14px; border-radius:8px; }
.profile-picture-choice-heading { display:grid; grid-template-columns:minmax(0,1fr) 32px; align-items:start; gap:10px; padding-bottom:10px; border-bottom:1px solid var(--ui-border); }
.profile-picture-choice-heading h3 { margin:2px 0 0; font-size:16px; }
.profile-picture-choice-heading .icon-command { width:32px; min-width:32px; height:32px; padding:0; }
.profile-picture-choice-actions { display:grid; gap:8px; padding-top:12px; }
.profile-picture-choice-actions > button { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:9px; min-height:54px; padding:8px 10px; border-radius:8px; text-align:left; }
.profile-picture-choice-actions svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.profile-picture-choice-actions span { display:grid; gap:2px; min-width:0; }
.profile-picture-choice-actions strong { font-size:11px; }
.profile-picture-choice-actions small { color:var(--ui-muted); font-size:9px; line-height:1.3; }
.profile-picture-choice-actions > button:disabled { opacity:.42; cursor:not-allowed; }
.menu-account-hub { display:grid; gap:10px; padding:10px; border:1px solid color-mix(in srgb,var(--ui-border) 76%,transparent); border-radius:8px; background:color-mix(in srgb,var(--ui-surface) 72%,transparent); }
#menuSidebar .menu-profile-header { display:grid!important; grid-template-columns:52px minmax(0,1fr)!important; gap:10px!important; padding:2px 0 10px!important; border-bottom:1px solid color-mix(in srgb,var(--ui-border) 70%,transparent)!important; }
#menuSidebar .menu-profile-header > img { width:52px!important; height:52px!important; border:2px solid color-mix(in srgb,var(--ui-accent) 58%,white); border-radius:50%!important; object-fit:cover; }
#menuSidebar .menu-profile-copy { display:grid; align-content:center; gap:3px; min-width:0; }
#menuSidebar .menu-profile-copy h1 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:17px; }
#menuSidebar .menu-code-row { display:grid; grid-template-columns:minmax(0,auto) 28px; align-items:center; justify-content:start; gap:4px; min-width:0; }
#menuSidebar .menu-code-row input { width:68px; min-width:0; height:25px; min-height:25px; padding:2px 4px; border:0; background:transparent; color:var(--ui-muted); font-size:10px; }
#menuSidebar .menu-copy-code { display:grid; place-items:center; width:26px; min-width:26px; height:26px; min-height:26px; padding:0; border-radius:6px; }
#menuSidebar .menu-copy-code svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:1.8; }
#menuSidebar .account-credit-wallet { display:none!important; }
#menuSidebar .menu-presence-toggle { display:flex; align-items:center; justify-content:space-between; min-height:36px; padding:6px 8px; border:0; border-radius:0; background:transparent; box-shadow:none; }
#menuSidebar .menu-presence-copy { display:flex; align-items:center; gap:7px; }
#menuSidebar .menu-presence-copy i { width:8px; height:8px; border-radius:50%; background:#53d58a; box-shadow:0 0 0 3px rgb(83 213 138 / 14%); }
#menuSidebar .menu-presence-copy strong { font-size:11px; }
#menuSidebar .menu-presence-toggle:has(input:checked) .menu-presence-copy i { background:#8a94a3; box-shadow:none; }
#menuSidebar .menu-quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
#menuSidebar .menu-quick-actions button { min-height:36px; padding:5px 7px; border-radius:8px; font-size:10px; font-weight:850; }
#menuSidebar #toggleMenuAddContact { border-color:#53d58a; color:#9aefbb; background:rgb(83 213 138 / 11%); }
#menuSidebar #menuSwitchAccount { border-color:#6da8ff; color:#a8caff; background:rgb(109 168 255 / 11%); }
#menuSidebar .menu-add-contact { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; padding:8px 0 2px; border-top:1px solid color-mix(in srgb,var(--ui-border) 68%,transparent); }
#menuSidebar .menu-add-contact.hidden { display:none; }
#menuSidebar .menu-add-contact label { grid-column:1/-1; font-size:9px; }
#menuSidebar .menu-add-contact input { min-width:0; min-height:34px; }
#menuSidebar .menu-add-contact button { min-height:34px; padding:4px 10px; border-radius:8px; }
#menuSidebar .menu-shortcuts { display:grid; grid-template-columns:minmax(0,1fr)!important; gap:0; border-top:1px solid color-mix(in srgb,var(--ui-border) 70%,transparent); }
#menuSidebar .menu-shortcuts button { display:grid!important; grid-template-columns:34px minmax(0,1fr) 18px!important; align-items:center; gap:9px; width:100%!important; min-height:52px; padding:7px 4px!important; border:0!important; border-bottom:1px solid color-mix(in srgb,var(--ui-border) 60%,transparent)!important; border-radius:0!important; background:transparent!important; text-align:left; box-shadow:none!important; }
#menuSidebar .menu-shortcuts button:last-child { border-bottom:0!important; }
#menuSidebar .menu-shortcut-icon { display:grid; place-items:center; width:32px; height:32px; border:1px solid color-mix(in srgb,var(--ui-accent) 40%,var(--ui-border)); border-radius:8px; color:var(--ui-accent); background:color-mix(in srgb,var(--ui-accent) 10%,transparent); }
#menuSidebar .menu-shortcut-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#menuSidebar .menu-chevron { color:var(--ui-muted); font-size:22px; text-align:center; }
#menuSidebar .menu-shortcuts strong { font-size:11px; font-weight:850; }
#menuSidebar .menu-shortcuts small { font-size:9px; }
#menuSidebar .menu-shortcuts button > span:nth-child(2) { display:grid; gap:2px; min-width:0; overflow:hidden; }
#menuSidebar .menu-shortcuts button > span:nth-child(2) strong,
#menuSidebar .menu-shortcuts button > span:nth-child(2) small { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.group-create-action > button > span:first-child { line-height:32px!important; text-align:center; padding:0!important; transform:none!important; }
.activity-payment-amount { display:block; width:fit-content; margin-top:1px; font-size:12px; font-weight:900; }
.activity-payment-amount.credit { color:var(--ui-success); }
.activity-payment-amount.debit { color:var(--ui-danger); }
.activity-copy > small { display:block; }
/* Profile pictures use one circular geometry everywhere they appear. */
.avatar,
.avatar-wrap .avatar,
.contact-dialog-avatar,
.auth-search-avatar,
.account-profile-row img,
.profile-preview,
.quick-add-row .avatar,
.activity-person,
.reel-owner-avatar,
.story-avatar,
.call-avatar,
.wallet-recipient .avatar,
.known-account img,
#menuProfileAvatar,
#accountAvatar,
#contactDialogAvatar,
#quickAddDialogAvatar {
  aspect-ratio:1!important;
  border-radius:50%!important;
  overflow:hidden!important;
  object-fit:cover!important;
  align-self:center;
  flex:0 0 auto;
}

.avatar img,
.avatar-wrap img,
.contact-dialog-avatar img,
.auth-search-avatar img,
.profile-preview img,
.quick-add-row .avatar img,
.activity-person img,
.reel-owner-avatar img,
.story-avatar img,
.call-avatar img,
.wallet-recipient .avatar img,
.known-account img,
#menuProfileAvatar,
#accountAvatar,
#contactDialogAvatar img,
#quickAddDialogAvatar img {
  display:block;
  width:100%!important;
  height:100%!important;
  border-radius:50%!important;
  object-fit:cover!important;
  object-position:center!important;
}

.profile-picture-history-card { width:min(520px,calc(100vw - 24px)); max-height:min(680px,calc(100dvh - 24px)); padding:14px; overflow:hidden; }
.profile-picture-history-heading { display:grid; grid-template-columns:minmax(0,1fr) 32px; align-items:start; gap:10px; padding-bottom:10px; border-bottom:1px solid var(--ui-border); }
.profile-picture-history-heading h3 { margin:2px 0 0; font-size:18px; }
.profile-picture-history-heading .icon-command { width:32px; min-width:32px; height:32px; min-height:32px; padding:0; }
.profile-picture-history-list { display:grid; gap:8px; padding-top:12px; overflow:auto; }
.profile-picture-history-item { display:grid; grid-template-columns:58px minmax(0,1fr) auto; align-items:center; gap:10px; min-width:0; padding:8px; border:1px solid var(--ui-border); border-radius:8px; background:var(--ui-surface-soft); }
.profile-picture-history-item img { width:58px; height:58px; border-radius:50%; object-fit:cover; }
.profile-picture-history-item > div { display:grid; gap:3px; min-width:0; }
.profile-picture-history-item strong { font-size:12px; }
.profile-picture-history-item small { color:var(--ui-muted); font-size:9px; }
.profile-picture-history-item button { min-height:34px; padding:6px 10px; }
.profile-picture-history-empty { display:grid; place-items:center; gap:5px; min-height:180px; padding:20px; color:var(--ui-muted); text-align:center; }
.profile-picture-history-empty strong { color:var(--ui-text); }
@media(max-width:420px){
  .profile-picture-history-item { grid-template-columns:52px minmax(0,1fr); }
  .profile-picture-history-item img { width:52px; height:52px; }
  .profile-picture-history-item button { grid-column:1/-1; width:100%; }
}
