/* Compact existing choices to their content. Labels, native controls, focus
   order, live media, unread badges and the bottom safe area keep their owners. */
body :is(.account-tabs,.social-tabs){
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  align-self:flex-start;
  width:max-content;
  max-width:100%;
  gap:8px;
  padding:4px;
}
body :is(.account-tabs,.social-tabs)>button{
  flex:0 1 auto;
  width:auto;
  min-width:44px;
  min-height:44px;
  max-width:100%;
  padding:8px 10px;
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Keep the existing sticky GIF-family row and its keyboard tab behavior. */
body .overlive-mood-families{
  width:max-content;
  max-width:100%;
  flex-wrap:wrap;
  gap:8px;
}
body .overlive-mood-families>button{
  flex:0 1 auto;
  width:auto;
  min-width:44px;
  min-height:44px;
  max-width:100%;
  padding:8px 10px;
  white-space:normal;
  overflow-wrap:anywhere;
}

body :is(#liveFilters,#emojiFilters){
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-block:12px;
  max-width:100%;
}
body :is(#liveFilters,#emojiFilters)>.filter{
  flex:0 1 auto;
  width:auto;
  min-width:44px;
  min-height:44px;
  max-width:100%;
  padding:8px 10px;
  white-space:normal;
  overflow-wrap:anywhere;
}

body .video-source-choices{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:8px;
  margin-block:12px;
  max-width:100%;
}
body .video-source-choices>button{
  flex:0 1 auto;
  width:auto;
  min-width:44px;
  min-height:44px;
  max-width:100%;
  padding:8px 10px;
  white-space:normal;
  overflow-wrap:anywhere;
}

/* These are the existing mode/category choices, not the separate home actions. */
body #liveChoice :is(.live-choice-options,.universe-choices){
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:8px;
}
body #liveChoice :is(.live-choice-options,.universe-choices)>.chill-action{
  flex:0 1 auto;
  width:max-content;
  max-width:100%;
  min-width:44px;
  min-height:44px;
  grid-template-columns:34px minmax(0,1fr) 16px;
  column-gap:8px;
  padding:8px 10px;
}
body #liveChoice :is(.live-choice-options,.universe-choices) .action-icon{
  width:34px;
  height:34px;
}
body #liveChoice :is(.live-choice-options,.universe-choices)>.chill-action>span:not(.action-icon):not(.action-arrow){
  min-width:0;
  overflow-wrap:anywhere;
}

/* The footer remains three labelled destinations with its existing safe area. */
body .nav{gap:8px;}
body .nav>button{
  min-width:44px;
  min-height:44px;
  padding:6px 8px;
  gap:2px;
}

/* Only the caption is visible. Its full44px target is the same native select,
   so tapping Ton statut opens the OS picker and keyboard/assistive navigation
   retains all four existing options. No custom menu or status logic is added. */
body .overlive-presence-field{
  position:relative;
  display:inline-flex;
  align-items:center;
  flex-wrap:nowrap;
  gap:0;
  width:max-content;
  max-width:100%;
  min-width:44px;
  min-height:44px;
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
}
body .overlive-presence-field>span{pointer-events:none;}
body .overlive-presence-field>select,
body .overlive-presence-field>select:disabled{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-width:44px;
  min-height:44px;
  max-width:100%;
  margin:0;
  padding:0;
  border:0;
  opacity:0!important;
  font-size:16px;
  cursor:inherit;
}
body .overlive-presence-field:focus-within{
  outline:2px solid var(--readable-focus,#fff);
  outline-offset:3px;
}

/* One compact heading and a stable two-line lead share the same discovery
   zone. Search, live count and the134.4px launch action retain their layout. */
body[data-page='discover'] #discover>.page-title{
  width:fit-content;
  max-width:100%;
  min-width:0;
  justify-self:start;
}
body[data-page='discover'] #discover>.page-title>h1{
  width:fit-content;
  max-width:100%;
  margin-block:4px;
  font-size:26px;
  line-height:1.15;
  letter-spacing:-.7px;
}
body[data-page='discover'] #discover>.page-title>.lead{
  width:32ch;
  max-width:100%;
  min-height:2.8em;
  margin:4px 0 0;
  line-height:1.4;
  overflow-wrap:anywhere;
}

/* Discovery search is a compact field rather than a full-width strip. */
body[data-page='discover'] #discover #publicLiveSearch{
 width:min(100%,230px);justify-self:start;min-height:44px;padding:8px 12px;
}

/* Stronger red launch treatment; the hit target remains stationary. */
body[data-page='discover'] #discover #createPublicLive.live-launch-control{
 background:linear-gradient(145deg,rgb(198 8 40 / .75),rgb(120 0 21 / .75))!important;
 border:1.5px solid #ff6a83!important;
 box-shadow:0 0 0 5px #ff173126,0 0 26px #f408398c,0 0 52px #ae002b40,inset 0 0 22px #ff4c6966!important;
}
body[data-page='discover'] #discover #createPublicLive .live-launch-ring{
 border-color:#ff3b60;border-width:2px;animation:overlive-launch-red-cut 1.85s steps(1,end) infinite;
}
body[data-page='discover'] #discover #createPublicLive .live-launch-ring-two{
 border-color:#ffb1bd;animation-delay:-.92s;animation-duration:2.2s;
}
body[data-page='discover'] #discover #createPublicLive .live-launch-label{
 text-shadow:-1px 0 #ff3971,1px 0 #ffb0ad,0 0 12px #ff3159;
 animation:overlive-launch-label-cut 2.35s steps(1,end) infinite;
}
body[data-page='discover'] #discover #createPublicLive::after{
 content:'';position:absolute;inset:10px -3px;pointer-events:none;border-radius:50%;
 background:repeating-linear-gradient(180deg,transparent 0 13px,#ff8a9a30 14px 15px,transparent 16px 29px);
 clip-path:polygon(0 18%,100% 18%,100% 26%,0 26%,0 55%,100% 55%,100% 61%,0 61%,0 82%,100% 82%,100% 88%,0 88%);
 opacity:.22;animation:overlive-launch-red-cut 2.6s steps(1,end) infinite;
}
@keyframes overlive-launch-red-cut{
 0%,76%,93%,100%{transform:translate3d(0,0,0) rotate(0);opacity:.6;}
 78%{transform:translate3d(3px,-1px,0) rotate(2deg);opacity:.85;}
 82%{transform:translate3d(-3px,1px,0) rotate(-2deg);opacity:.4;}
 88%{transform:translate3d(1px,-1px,0) rotate(1deg);opacity:.75;}
}
@keyframes overlive-launch-label-cut{
 0%,84%,94%,100%{transform:translate3d(0,0,0);}
 86%{transform:translate3d(1px,0,0);}
 89%{transform:translate3d(-1px,0,0);}
}
#createPublicLive[data-live-launch-motion='paused'] :is(.live-launch-ring,.live-launch-label),
#createPublicLive[data-live-launch-motion='paused']::after{animation-play-state:paused!important;}
@media(prefers-reduced-motion:reduce){
 body[data-page='discover'] #discover #createPublicLive :is(.live-launch-ring,.live-launch-label),
 body[data-page='discover'] #discover #createPublicLive::after{animation:none!important;}
}

/* Fit the public-live heading to the longest rotating phrase, with the same
   small edge padding. Its width stays stable when the shorter phrase returns. */
body.rgb-theme[data-page='discover'] #discover>.page-title{
 width:max-content;max-width:100%;justify-self:start;
}
body.rgb-theme[data-page='discover'] #discover>.page-title>.lead{
 width:max-content;max-width:100%;min-height:1.4em;white-space:normal;
}
body.rgb-theme[data-page='discover'] #discover>.page-title>.lead::after{
 /* overlive-discovery-copy-measure: invisible, in-flow intrinsic width only. */
 content:'Rejoins une diffusion en direct...';display:block;visibility:hidden;
 height:0;overflow:hidden;white-space:nowrap;pointer-events:none;
}

/* A compact search field: room for its placeholder and the two inner edges. */
body.rgb-theme[data-page='discover'] #discover #publicLiveSearch{
 width:calc(11ch + 26px);max-width:100%;min-width:0;box-sizing:border-box;
}

/* The closed profile editor is a short action; opening keeps the full form. */
body #overliveAccountPanel .account-profile-editor:not([open]){
 width:max-content;max-width:100%;justify-self:start;
}
body #overliveAccountPanel .account-profile-editor>summary{
 width:max-content;max-width:100%;justify-content:flex-start;gap:8px;
}
