/* Account profile only. Existing navigation, chat keyboard and game styles stay intact. */
.rp-scope {
  --rp-bg: var(--rl-canvas, #f8f7fe);
  --rp-card: var(--rl-surface, #fff);
  --rp-soft: var(--rl-surface-muted, #f0ebfb);
  --rp-ink: var(--rl-text, #2a2640);
  --rp-muted: var(--rl-text-secondary, #746f87);
  --rp-line: var(--rl-outline, #e7e2f2);
  --rp-accent: var(--rl-primary, #7356d9);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.rp-scope *,
.rp-scope *::before,
.rp-scope *::after {
  box-sizing: border-box;
}
#moreProfile {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: 0 0 24px;
}
.rp-scope [hidden] {
  display: none !important;
}
.rp-scope button,
.rp-scope input,
.rp-scope textarea,
.rp-scope select {
  font: inherit;
  color: inherit;
}
.rp-scope button {
  cursor: pointer;
  min-height: 48px;
  border: 1px solid var(--rp-line);
  background: var(--rp-card);
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: none;
  touch-action: manipulation;
}
.rp-scope button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.rp-scope :is(button, input, textarea, select):focus-visible {
  outline: 3px solid var(--rp-accent);
  outline-offset: 3px;
}
.rp-scope .rp-primary {
  background: var(--rp-accent);
  color: var(--rl-on-primary, #fff);
  border-color: transparent;
  font-weight: 650;
  width: 100%;
}
.rp-scope .rp-quiet {
  background: transparent;
  border-color: transparent;
}
.rp-scope .rp-icon {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--rp-accent);
}
.rp-scope .rp-icon-button {
  padding: 10px;
  width: 48px;
  flex: none;
}
.rp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
}
.rp-head h2 {
  font-size: 1.18rem;
  line-height: 1.3;
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 700;
}
.rp-head .rp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.45rem;
  font-weight: 750;
  flex: 1;
}
.rp-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.rp-back {
  font-size: 26px;
  line-height: 1 !important;
}
.rp-hero {
  position: relative;
  text-align: center;
  padding-bottom: 12px;
}
.rp-cover {
  display: block;
  width: 100%;
  height: clamp(130px, 31vw, 205px);
  object-fit: cover;
  border-radius: 18px;
  background: var(--rp-soft);
}
.rp-avatar-wrap {
  position: relative;
  margin: -54px auto 8px;
  width: 128px;
  height: 128px;
}
.rp-avatar {
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--rp-card);
  border-radius: 50%;
  background: var(--rp-soft);
  overflow: hidden;
  font-size: 2.5rem;
  font-weight: 650;
  color: var(--rp-accent);
}
.rp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rp-scope .rp-photo-button {
  position: absolute;
  right: -5px;
  bottom: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rp-soft);
  border: 3px solid var(--rp-card);
  padding: 8px;
}
.rp-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7f8994;
  display: inline-block;
  flex: none;
  border: 2px solid var(--rp-card);
}
.rp-dot[data-online="true"] {
  background: #269557;
}
.rp-hero h3 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 10px 0 0;
  white-space: pre-wrap;
}
.rp-muted,
.rp-help,
.rp-counter {
  color: var(--rp-muted);
  font-size: 0.88rem;
}
.rp-presence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 0.9rem;
}
.rp-scope .rp-status-pill {
  display: flex;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  border-radius: 24px;
  background: var(--rp-soft);
  margin: 16px 0;
  min-height: 52px;
}
.rp-status-pill span {
  flex: 1;
  white-space: pre-wrap;
  min-width: 0;
}
.rp-about {
  white-space: pre-wrap;
  text-align: center;
  margin: 8px 0 18px;
}
.rp-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.rp-scope .rp-quick button {
  flex-direction: column;
  font-size: 0.83rem;
  padding: 12px 6px;
  gap: 7px;
  min-width: 0;
  line-height: 1.35;
}
.rp-list {
  background: var(--rp-card);
  border: 1px solid var(--rp-line);
  border-radius: 18px;
  overflow: hidden;
  margin: 16px 0;
}
.rp-scope .rp-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  min-height: 58px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 12px;
  line-height: 1.35;
}
.rp-row + .rp-row {
  border-top: 1px solid var(--rp-line) !important;
}
.rp-row > span:first-of-type:not(.rp-icon) {
  flex: 1;
  min-width: 0;
}
.rp-row .rp-row-copy {
  flex: 1;
  min-width: 0;
}
.rp-row small {
  display: block;
  font-size: 0.82rem;
  color: var(--rp-muted);
  margin-top: 3px;
}
.rp-row-value {
  color: var(--rp-muted);
  font-size: 0.85rem;
  max-width: 45%;
  text-align: right;
}
.rp-chevron {
  font-size: 22px;
  color: var(--rp-muted);
  flex: none;
}
.rp-scope .rp-danger {
  color: var(--rl-danger, #b94355);
}
.rp-message {
  padding: 8px 0;
  min-height: 1.6em;
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.rp-message[data-error="true"] {
  color: var(--rl-danger, #b94355);
}
.rp-loading {
  padding: 28px 8px;
  text-align: center;
  color: var(--rp-muted);
}
.rp-form label {
  display: block;
  font-weight: 600;
  margin-top: 16px;
}
.rp-form :is(input[type="text"], textarea, select) {
  width: 100%;
  min-height: 48px;
  background: var(--rp-soft);
  border: 1px solid var(--rp-line);
  border-radius: 13px;
  padding: 11px 12px;
  margin-top: 6px;
  resize: vertical;
  box-shadow: none;
}
.rp-form textarea {
  min-height: 90px;
  max-height: 240px;
}
.rp-counter {
  text-align: right;
  margin: 2px 0 0;
  font-weight: 400;
}
.rp-help {
  margin: 8px 0 14px;
  font-weight: 400;
  line-height: 1.5;
}
.rp-editor-art {
  position: relative;
  margin-bottom: 10px;
}
.rp-editor-art > .rp-icon-button {
  position: absolute;
  right: 10px;
  top: 10px;
}
.rp-editor-art .rp-avatar-wrap {
  margin-left: 14px;
}
.rp-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.rp-scope .rp-preset-grid button {
  justify-content: flex-start;
  background: var(--rp-soft);
  text-align: left;
}
.rp-preview-small {
  width: 100%;
  max-height: 145px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.rp-cover-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.rp-scope .rp-cover-options button {
  display: block;
  padding: 5px;
  font-size: 0.8rem;
}
.rp-cover-options img {
  width: 100%;
  height: 65px;
  object-fit: cover;
  border-radius: 9px;
  display: block;
  margin-bottom: 4px;
}
.rp-cover-options button[aria-pressed="true"] {
  outline: 2px solid var(--rp-accent);
  outline-offset: 1px;
}
.rp-scope.rp-dialog {
  padding: 20px;
  margin: auto;
  background: var(--rp-bg);
  border: 1px solid var(--rp-line);
  border-radius: 22px;
  width: calc(100% - 32px);
  max-width: 460px;
  max-height: calc(
    100dvh - 32px - var(--ryadom-safe-top, 0px) - var(--ryadom-safe-bottom, 0px)
  );
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 10px 40px #20103924;
}
.rp-dialog::backdrop {
  background: #15102370;
}
.rp-dialog h2 {
  font-size: 1.2rem;
  margin: 0;
  flex: 1;
}
.rp-dialog .rp-head {
  margin: 0 0 12px;
}
.rp-dialog .rp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.rp-dialog .rp-actions button {
  flex: 1;
}
.rp-crop-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  touch-action: none;
  border-radius: 15px;
  background: var(--rp-soft);
}
.rp-crop-slider {
  display: block;
  width: 100%;
  margin: 10px 0 18px;
  min-height: 36px;
  accent-color: var(--rp-accent);
}
.rp-data {
  margin: 14px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rp-info {
  background: var(--rp-soft);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
  color: var(--rp-muted);
  font-size: 0.9rem;
}
@media (min-width: 700px) {
  #moreProfile {
    padding: 0 16px 32px;
  }
  .rp-quick {
    gap: 14px;
  }
  .rp-hero {
    padding-inline: 8px;
  }
}
@media (max-width: 350px) {
  .rp-head h2 {
    font-size: 1.05rem;
  }
  .rp-row {
    gap: 8px !important;
  }
  .rp-row-value {
    font-size: 0.8rem;
  }
  .rp-scope .rp-quick button {
    font-size: 0.78rem;
  }
  .rp-scope.rp-dialog {
    padding: 14px;
    width: calc(100% - 20px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rp-scope * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Isolate the editor from legacy global form/card styling. */
form.rp-form {
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.rp-scope .rp-form label {
  font-size: 1rem;
  color: var(--rp-ink);
}
#moreProfile .rp-form :is(input[type="text"], textarea, select) {
  font-size: 1rem;
  background: var(--rp-soft);
  color: var(--rp-ink);
}
.rp-scope button {
  transition: transform 140ms ease;
}
body[data-theme="night"] .rp-scope .rp-primary {
  color: #241a38;
}
#rpDialog input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 36px;
}
.rp-room-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--rp-soft);
}
#moreProfile .rp-form label {
  font-size: 1rem;
  color: var(--rp-ink);
}
#moreProfile .rp-head h2 {
  font-size: 1.18rem;
  line-height: 1.3;
}

/* Profile friends: compact, accessible on 320 px, theme tokens inherited. */
.rp-scope .rp-consent{display:flex!important;align-items:flex-start;gap:12px;cursor:pointer;padding:13px;border:1px solid var(--rp-line);background:var(--rp-soft);border-radius:15px;margin:16px 0}
.rp-scope .rp-consent input[type="checkbox"]{width:23px;height:23px;min-height:23px;flex:none;accent-color:var(--rp-accent);margin:3px 0 0}
.rp-scope .rp-consent span{display:grid;gap:4px;min-width:0}
.rp-scope .rp-consent b{color:var(--rp-ink);font-size:.95rem;font-weight:750;line-height:1.35}
.rp-scope .rp-consent small{display:block;color:var(--rp-muted);font-size:.8rem;line-height:1.4}
.rp-scope .rp-friend-form{padding:0;margin:4px 0 8px}
.rp-scope .rp-friend-form label{display:block;font-weight:700;color:var(--rp-ink);margin:0 0 8px}
.rp-scope .rp-friend-add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.rp-scope .rp-friend-add input{width:100%;min-width:0;min-height:48px;padding:10px 12px;background:var(--rp-soft);border:1px solid var(--rp-line);border-radius:13px;color:var(--rp-ink);font-size:16px}
.rp-scope .rp-friend-add .rp-primary{width:auto;min-width:104px}
.rp-scope .rp-friends{display:grid;gap:12px}
.rp-scope .rp-friend-group{padding:12px;border:1px solid var(--rp-line);border-radius:16px;background:var(--rp-card)}
.rp-scope .rp-friend-group h3{font-size:.98rem;line-height:1.3;margin:0 0 10px}
.rp-scope .rp-friend-item{display:grid;gap:9px;padding:12px 0;border-top:1px solid var(--rp-line)}
.rp-scope .rp-friend-info{display:flex;align-items:center;gap:10px;min-width:0}
.rp-scope .rp-friend-name{display:flex;flex-direction:column;min-width:0;gap:2px}
.rp-scope .rp-friend-name strong{font-size:.95rem;overflow-wrap:anywhere}
.rp-scope .rp-friend-name small{font-size:.76rem;color:var(--rp-muted);line-height:1.35;overflow-wrap:anywhere}
.rp-scope .rp-friend-actions{display:flex;flex-wrap:wrap;gap:7px}
.rp-scope .rp-friend-actions button{min-height:44px;flex:1;min-width:90px;padding:8px 10px;font-size:.9rem}
.rp-scope .rp-friend-actions button:first-child{border-color:var(--rp-accent);color:var(--rp-accent)}
.rp-scope .rp-message[data-error="true"]{color:#ba4757}
@media(max-width:390px){.rp-scope .rp-friend-add{grid-template-columns:minmax(0,1fr)}.rp-scope .rp-friend-add .rp-primary{width:100%}}

/* Four equal profile navigation shortcuts, readable on 320 px. */
#moreProfile .rp-quick{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:550px){#moreProfile .rp-quick{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Friends request dialog — explicit readable contrast in both app themes. */
.rp-scope.rp-dialog .rp-friend-form > label{
 display:block;
 color:var(--rp-ink);
 font-size:.94rem;
 font-weight:750;
 line-height:1.45;
 letter-spacing:normal;
 text-shadow:none;
 margin:0 0 9px;
 opacity:1;
}
.rp-scope.rp-dialog .rp-friend-add input#rpFriendLogin{
 background:var(--rp-soft);
 color:var(--rp-ink);
 border:1.5px solid var(--rp-line);
 caret-color:var(--rp-accent);
 box-shadow:none;
 -webkit-text-fill-color:var(--rp-ink);
}
.rp-scope.rp-dialog .rp-friend-add input#rpFriendLogin::placeholder{
 color:var(--rp-muted);
 opacity:1;
}
.rp-scope.rp-dialog .rp-friend-add button.rp-primary{
 color:#fff;
 background:#7356d9;
 border:1px solid #6b4bcc;
 box-shadow:none;
 text-shadow:none;
 font-weight:750;
 opacity:1;
}
body[data-theme="night"] .rp-scope.rp-dialog .rp-friend-form > label{
 color:#f5f1fe;
}
body[data-theme="night"] .rp-scope.rp-dialog .rp-friend-add input#rpFriendLogin{
 color:#f5f1fe;
 -webkit-text-fill-color:#f5f1fe;
 background:#302a42;
 border-color:#75698c;
 caret-color:#dfd0ff;
}
body[data-theme="night"] .rp-scope.rp-dialog .rp-friend-add input#rpFriendLogin::placeholder{
 color:#c7badb;
 opacity:1;
}
body[data-theme="night"] .rp-scope.rp-dialog .rp-friend-add button.rp-primary{
 color:#21182d;
 background:#c3aeff;
 border-color:#d6c8ff;
 box-shadow:none;
}
body[data-theme="night"] .rp-scope.rp-dialog .rp-friend-add button.rp-primary:disabled{
 opacity:.57;
}

/* Polished profile header controls: independent sharp SVGs, not legacy sprite glyphs. */
#moreProfile #rpView > .rp-head .rp-top-control{
 display:inline-grid;
 place-items:center;
 width:46px;
 min-width:46px;
 height:46px;
 padding:0;
 border:1px solid var(--rp-line);
 border-radius:16px;
 background:var(--rp-soft);
 color:var(--rp-ink);
 box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
 transition:background-color .16s ease,transform .16s ease,border-color .16s ease;
}
#moreProfile #rpView > .rp-head .rp-top-control .rp-top-icon{
 display:block;
 width:24px;
 height:24px;
 overflow:visible;
 stroke:currentColor;
 stroke-width:1.85;
 fill:none;
 vector-effect:non-scaling-stroke;
}
#moreProfile #rpView > .rp-head .rp-top-control:hover{
 border-color:var(--rp-accent);
 background:var(--rp-card);
}
#moreProfile #rpView > .rp-head .rp-top-control:active{
 transform:scale(.95);
}
body[data-theme="night"] #moreProfile #rpView > .rp-head .rp-top-control{
 background:#373047;
 color:#f3ebff;
 border-color:#665a7d;
 box-shadow:inset 0 1px 0 #ffffff12;
}
body[data-theme="night"] #moreProfile #rpView > .rp-head .rp-top-control:hover{
 background:#45395d;
 border-color:#b9a7f5;
}
@media(max-width:350px){
 #moreProfile #rpView > .rp-head .rp-top-control{
  width:44px;min-width:44px;height:44px;border-radius:14px;
 }
}

/* Compact last-visit consent: stable two-column text + real native checkbox. */
#moreProfile .rp-form .rp-lastseen-card{
 display:grid;
 grid-template-columns:minmax(0,1fr) auto;
 align-items:center;
 gap:12px;
 min-width:0;
 margin:12px 0 19px;
 padding:15px 14px;
 border:1px solid var(--rp-line);
 border-radius:17px;
 background:var(--rp-card);
 box-shadow:0 2px 9px rgba(30,20,50,.05);
}
#moreProfile .rp-lastseen-copy,
#pane-more .settings-friend-copy{
 display:flex;
 flex-direction:column;
 gap:4px;
 min-width:0;
 text-align:left;
 white-space:normal;
}
#moreProfile .rp-lastseen-copy strong,
#pane-more .settings-friend-copy strong{
 font-size:14px;
 line-height:1.35;
 color:var(--rp-ink);
 font-weight:750;
 overflow-wrap:normal;
 word-break:normal;
}
#moreProfile .rp-lastseen-copy small,
#pane-more .settings-friend-copy small{
 font-size:12px;
 line-height:1.4;
 color:var(--rp-muted);
 font-weight:450;
 overflow-wrap:normal;
 word-break:normal;
}
#moreProfile .rp-form label.rp-privacy-switch,
#pane-more label.rp-privacy-switch{
 position:relative;
 display:inline-block;
 flex:0 0 52px;
 width:52px;
 height:44px;
 min-width:52px;
 min-height:44px;
 margin:0;
 padding:0;
 border:0;
 border-radius:17px;
 background:transparent;
 cursor:pointer;
}
.rp-privacy-switch input[type="checkbox"]{
 position:absolute!important;
 inset:0!important;
 width:100%!important;
 height:100%!important;
 margin:0!important;
 padding:0!important;
 opacity:0!important;
 cursor:pointer;
 z-index:2;
}
.rp-privacy-switch .rp-privacy-track{
 position:absolute;
 left:0;
 right:0;
 top:6px;
 bottom:6px;
 display:block;
 border:1px solid var(--rp-line);
 border-radius:999px;
 background:#b5aec0;
 transition:background-color .18s ease,border-color .18s ease;
 pointer-events:none;
}
.rp-privacy-switch .rp-privacy-track::after{
 content:"";
 position:absolute;
 top:3px;
 left:3px;
 width:24px;
 height:24px;
 border-radius:50%;
 background:#fff;
 box-shadow:0 1px 4px #17102935;
 transition:transform .18s ease;
}
.rp-privacy-switch input:checked + .rp-privacy-track{
 background:#7456d8;
 border-color:#7456d8;
}
.rp-privacy-switch input:checked + .rp-privacy-track::after{transform:translateX(20px)}
.rp-privacy-switch input:focus-visible + .rp-privacy-track{
 outline:3px solid #ae94ff;
 outline-offset:3px;
}
.rp-privacy-switch input:disabled + .rp-privacy-track{
 opacity:.55;
}
#pane-more .settings-friend-consent{
 display:flex;
 align-items:center;
 gap:12px;
 min-width:0;
 padding:14px 17px 12px;
}
#pane-more .settings-friend-consent > .settings-icon{flex-shrink:0}
#pane-more .settings-friend-copy{flex:1;min-width:0}
#pane-more .settings-friend-copy strong{color:var(--rl-text,var(--rp-ink))}
#pane-more .settings-friend-copy small{color:var(--rl-text-secondary,var(--rp-muted))}
#pane-more .settings-lastseen-status{
 margin:0;
 padding:0 17px 13px;
 font-size:12px;
 line-height:1.4;
 color:var(--rl-text-secondary,var(--rp-muted));
}
#pane-more .settings-lastseen-status[data-error="true"]{color:#d24f60}
body[data-theme="night"] #moreProfile .rp-lastseen-card{
 background:#30283f;
 border-color:#6a5e80;
}
body[data-theme="night"] #moreProfile .rp-lastseen-copy strong{color:#f5f0ff}
body[data-theme="night"] #moreProfile .rp-lastseen-copy small{color:#c5b8d9}
body[data-theme="night"] .rp-privacy-switch .rp-privacy-track{
 background:#4a4359;
 border-color:#80718f;
}
body[data-theme="night"] .rp-privacy-switch input:checked + .rp-privacy-track{
 background:#9978f0;
 border-color:#9978f0;
}
@media(max-width:390px){
 #pane-more .settings-friend-consent{
  flex-wrap:wrap;
  gap:9px;
  padding:13px 12px 10px;
 }
 #pane-more .settings-friend-consent .settings-icon{display:none}
 #pane-more .settings-friend-copy{flex-basis:calc(100% - 67px)}
 #moreProfile .rp-form .rp-lastseen-card{padding:12px 10px}
 #moreProfile .rp-lastseen-copy strong,
 #pane-more .settings-friend-copy strong{font-size:13px}
}
@media(prefers-reduced-motion:reduce){
 .rp-privacy-switch .rp-privacy-track,
 .rp-privacy-switch .rp-privacy-track::after{transition:none}
}
