/* QRSocial R87 Run 9 — controls and actions polish.
   Scoped styling only: do not animate page containers, drawers, composer height,
   navigation routes, or call/recording state. Run 8 tokens remain authoritative. */


/* Restore Run 8 lobby hierarchy after the older Presence-specific CSS. */
.qs-presence-lab .qs-presence-friend-card>.qs-presence-friend-actions{
  grid-column:1/-1;min-width:0;
}
.qs-presence-lab .qs-presence-friend-actions{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px;
  width:100%;
  align-items:stretch;
}
.qs-presence-lab .qs-presence-friend-actions>button{
  appearance:none!important;
  -webkit-appearance:none!important;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  width:100%;min-width:0;grid-column:auto!important;
  min-height:44px;
  margin:0;
  padding:9px 8px;
  border-radius:14px;
  font-family:inherit;font-weight:800;font-size:clamp(.75rem,1vw,.86rem);line-height:1.1;
  letter-spacing:-.01em;
  cursor:pointer;
}
.qs-presence-lab .qs-presence-friend-actions>.qs-presence-call{
  background:linear-gradient(145deg,color-mix(in srgb,#3181ff 17%,var(--nb-surface)),color-mix(in srgb,#5c6fff 9%,var(--nb-surface-2)))!important;
  border:1px solid color-mix(in srgb,#708aff 42%,var(--nb-border))!important;
  color:var(--nb-text)!important;
  box-shadow:var(--nb-shadow-soft)!important;
}
.qs-presence-lab .qs-presence-friend-actions>.qs-presence-video-call{
  background:var(--nb-violet)!important;
  border:1px solid transparent!important;
  color:#fff!important;
  box-shadow:var(--nb-shadow-accent)!important;
}
.qs-presence-lab .qs-presence-friend-actions>.qs-presence-primary{
  background:var(--nb-presence)!important;
  border:1px solid transparent!important;
  color:#fff!important;
  box-shadow:var(--nb-shadow-cyan)!important;
}
.qs-presence-lab .qs-presence-friend-actions>button:focus-visible{
  outline:2px solid #89b5ff!important;outline-offset:3px;
}
.qs-presence-lab .qs-presence-friend-actions>button:disabled{
  opacity:.5;cursor:not-allowed;box-shadow:none!important;
}

/* PHONE: live toolbar, voice/video/presence controls and advanced sheet. */
.qs-presence-portal .qs-presence-controls{
  border-color:rgba(255,255,255,.14);
  background:linear-gradient(155deg,rgba(22,28,46,.85),rgba(9,12,21,.90));
  box-shadow:0 22px 58px rgba(0,0,0,.46),inset 0 1px 0 rgba(255,255,255,.10);
}
.qs-presence-portal[data-presence-kind] .qs-presence-controls>button:not(.qs-presence-end),
.qs-presence-portal .qs-presence-more-grid>button{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(160deg,rgba(255,255,255,.13),rgba(255,255,255,.045));
  color:#f8faff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 4px 12px rgba(0,0,0,.14);
  cursor:pointer;
  font-family:inherit;
  font-weight:750;
  transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease,filter .14s ease;
}
.qs-presence-portal[data-presence-kind] .qs-presence-controls>button:not(.qs-presence-end)[aria-pressed="true"],
.qs-presence-portal .qs-presence-more-grid>button[aria-pressed="true"]{
  background:linear-gradient(145deg,rgba(68,122,255,.42),rgba(124,72,255,.44));
  border-color:rgba(155,172,255,.68);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 0 0 2px rgba(118,101,255,.12);
}
@media(hover:hover){
  .qs-presence-portal[data-presence-kind] .qs-presence-controls>button:not(.qs-presence-end):hover:not(:disabled),
  .qs-presence-portal .qs-presence-more-grid>button:hover:not(:disabled){
    border-color:rgba(155,183,255,.42);
    background:linear-gradient(155deg,rgba(94,130,241,.28),rgba(117,86,217,.18));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 8px 22px rgba(0,0,0,.23);
  }
}
.qs-presence-portal .qs-presence-controls>button:focus-visible,
.qs-presence-portal .qs-presence-more-grid>button:focus-visible,
.qs-presence-portal .qs-presence-reaction-tray>button:focus-visible{
  outline:2px solid #9ed6ff;
  outline-offset:3px;
}
.qs-presence-portal .qs-presence-controls>button:disabled,
.qs-presence-portal .qs-presence-more-grid>button:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}
.qs-presence-portal .qs-presence-controls>.qs-presence-end{
  background:linear-gradient(135deg,#ff5967,#e03048)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.14)!important;
  box-shadow:0 9px 23px rgba(217,42,65,.24),inset 0 1px 0 rgba(255,255,255,.15)!important;
}
.qs-presence-portal .qs-presence-more-sheet>header>button,
.qs-presence-portal .qs-presence-card-composer>header>button{
  appearance:none;border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.10);
  color:#fff;border-radius:14px;min-width:38px;min-height:38px;
  cursor:pointer;
}
.qs-presence-portal .qs-presence-reaction-tray>button{
  border:1px solid rgba(255,255,255,.1);color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07);
}
.qs-presence-portal .qs-presence-controls>button>small{
  font-weight:780;letter-spacing:.015em;
}
/* Incoming rings retain the existing circular layout while giving clear choices. */
.qs-presence-portal .qs-nerddi-incoming-actions>.qs-nerddi-decline-control{
  background:linear-gradient(135deg,#fb536b,#d52949)!important;border-color:rgba(255,255,255,.16)!important;
}
.qs-presence-portal .qs-nerddi-incoming-actions>.qs-nerddi-answer-control{
  background:linear-gradient(135deg,#22d4a1,#129b78)!important;border-color:rgba(255,255,255,.16)!important;
}

/* NAVIGATION: surface colors and visible selection, without changing menu geometry. */
.qs-sidebar .qs-sidebar-more,
.qs-sidebar .qs-nerddi-entry{
  border:1px solid var(--nb-border);
  border-radius:16px;
  background:var(--nb-surface-2);
  color:var(--nb-text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
}
#menu-drawer .qs-drawer-controls>button{
  appearance:none;
  border:1px solid var(--nb-border);
  border-radius:11px;
  background:var(--nb-surface-2);
  color:var(--nb-text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
  cursor:pointer;
}
#menu-drawer .qs-drawer-controls>button[aria-pressed="true"]{
  background:color-mix(in srgb,#597cff 19%,var(--nb-surface-2));
  border-color:color-mix(in srgb,#7390ff 40%,var(--nb-border));
}
#menu-drawer .qs-drawer-group-title{
  border-radius:12px;
  min-height:36px;
  color:var(--nb-muted);
  background:transparent;
}
#menu-drawer .menu-link{
  box-sizing:border-box;
  border:1px solid transparent!important;
  border-radius:14px;
}
#menu-drawer .menu-link.is-active{
  border-color:color-mix(in srgb,#6e86ff 34%,transparent)!important;
  background:color-mix(in srgb,#577dff 11%,var(--nb-surface))!important;
  color:var(--nb-text);
  box-shadow:inset 3px 0 0 #748aff;
}
@media(hover:hover){
  #menu-drawer .qs-drawer-controls>button:hover,
  #menu-drawer .qs-drawer-group-title:hover{
    background:color-mix(in srgb,#5e7aff 12%,var(--nb-surface-2));
  }
}
#menu-drawer :is(.menu-link,.qs-drawer-group-title,.qs-drawer-controls>button):focus-visible,
.qs-sidebar :is(.qs-sidebar-more,.qs-nerddi-entry):focus-visible{
  outline:2px solid #7495ff;
  outline-offset:2px;
}

/* MESSENGER: controls around the input. No change to positioning/width. */
body.qs-thread-focus .composer-v2 .composer-rest{
  border-color:color-mix(in srgb,#748aff 18%,var(--nb-border));
}
body.qs-thread-focus .composer-v2 .pill-wrap{
  border:1px solid color-mix(in srgb,#748aff 18%,var(--nb-border));
  background:var(--nb-surface);
  box-shadow:inset 0 1px 2px rgba(15,23,42,.025);
}
body.qs-thread-focus .composer-v2 .pill-wrap:focus-within{
  border-color:color-mix(in srgb,#577dff 68%,var(--nb-border));
  box-shadow:0 0 0 3px rgba(89,124,255,.11),inset 0 1px 2px rgba(15,23,42,.025);
}
body.qs-thread-focus .composer-v2 :is(.plus-btn,.qs-r67-reply-ai){
  appearance:none;
  border:1px solid color-mix(in srgb,#5a7eff 20%,var(--nb-border));
  background:var(--nb-surface-2);
  color:var(--nb-text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 4px 13px rgba(30,40,70,.08);
  cursor:pointer;
}
body.qs-thread-focus .composer-v2 .orb{
  appearance:none;
  border:1px solid rgba(255,255,255,.22);
  background:var(--nb-blue)!important;
  color:#fff!important;
  box-shadow:0 8px 20px rgba(71,104,237,.23),inset 0 1px 0 rgba(255,255,255,.21)!important;
}
/* Recording feedback remains distinct from the blue Send state. */
body.qs-thread-focus .composer-v2 .orb.holding{
  background:linear-gradient(135deg,#ff6675,#db3856)!important;
  box-shadow:0 8px 20px rgba(221,56,86,.28),inset 0 1px 0 rgba(255,255,255,.2)!important;
}
body.qs-thread-focus .composer-v2 :is(.orb,.plus-btn,.qs-r67-reply-ai):disabled{
  opacity:.42;
  cursor:not-allowed;
  box-shadow:none;
}
body.qs-thread-focus .composer-v2 :is(.orb,.plus-btn,.qs-r67-reply-ai):focus-visible,
body.qs-thread-focus :is(.reply-composer button,.network-context-dismiss,.mode-badge):focus-visible{
  outline:2px solid #6d98ff;
  outline-offset:3px;
}
@media(hover:hover){
  body.qs-thread-focus .composer-v2 :is(.plus-btn,.qs-r67-reply-ai):hover:not(:disabled){
    border-color:color-mix(in srgb,#7091ff 55%,var(--nb-border));
    background:color-mix(in srgb,#6486ff 11%,var(--nb-surface-2));
  }
  body.qs-thread-focus .composer-v2 .orb:hover:not(:disabled){
    filter:brightness(1.06);
  }
}
body.qs-thread-focus .reply-composer button,
body.qs-thread-focus .network-context-dismiss{
  border:1px solid var(--nb-border);
  border-radius:10px;
  background:var(--nb-surface-2);
  color:var(--nb-text);
}
body.qs-thread-focus .mode-badge{
  border-color:color-mix(in srgb,#738aff 25%,var(--nb-border));
}
/* Sheet actions are visual-only; do not alter action sheet positioning or JS hooks. */
body.qs-thread-focus .sheet-inner :is(.settings-option,button):focus-visible{
  outline:2px solid #7b97ff;outline-offset:2px;
}

/* SETTINGS: linked rows retain their full-row tap targets; controls get a unified focus. */
.qs-settings-page .qs-settings-row{
  background:transparent;
  color:var(--nb-text);
}
.qs-settings-page .qs-settings-row-icon{
  border:1px solid color-mix(in srgb,#6284ff 16%,var(--nb-border));
  background:color-mix(in srgb,#678aff 7%,var(--nb-surface-2));
}
.qs-settings-page .qs-settings-back{
  background:var(--nb-surface-2);
  border-color:var(--nb-border);
  box-shadow:var(--nb-shadow-soft);
}
.qs-settings-page .qs-settings-inline-row{
  border-color:var(--nb-border);
  border-radius:16px;
}
.qs-settings-page .qs-settings-row:focus-visible,
.qs-settings-page .qs-settings-back:focus-visible,
.qs-settings-page .qs-settings-inline-row:focus-visible,
.qs-settings-page :is(button,a,input,select,textarea):focus-visible{
  outline:2px solid #7896ff;
  outline-offset:2px;
}
.qs-settings-page :is(button,.btn,.qs-primary,.qs-secondary):not(.qs-settings-row){
  font-weight:790;
}
.qs-settings-page .qs-push-commercial-actions :is(button,a){
  min-height:44px;
  border-radius:14px;
  font-weight:800;
}
.qs-settings-page .qs-settings-danger:is(:hover,:focus-visible){
  background:color-mix(in srgb,#df5268 7%,var(--nb-surface));
}
@media(hover:hover){
  .qs-settings-page :is(.qs-settings-row,.qs-settings-inline-row):hover{
    background:color-mix(in srgb,#5f83ff 5%,var(--nb-surface));
  }
}
/* Explicitly preserve disabled/hidden states and motion preference. */
@media(prefers-reduced-motion:reduce){
  .qs-presence-portal .qs-presence-controls>button,
  .qs-presence-portal .qs-presence-more-grid>button{
    transition:none!important;
  }
}

@media(max-width:520px){
  .qs-presence-lab .qs-presence-section-head{flex-direction:column;align-items:flex-start;gap:6px}
  .qs-presence-lab .qs-presence-section-head h2{margin-bottom:3px}
}
